From 99f08276c6bcdaa86ccca2727416a1d17743c4d4 Mon Sep 17 00:00:00 2001 From: Vittorio Alfieri Date: Sun, 28 May 2023 23:17:21 +0200 Subject: [PATCH] Addes some new primitives from BRO set, fixes BRO and BRC dat files, updated image list url for BRO and BRS sets, imrpoved an AI deck, improved meld ability with "and" option, added new ability to allow a planeswalker to activate its loyalty abilities twice in a turn, improved Android downloader. --- .../src/net/wagic/utils/ImgDownloader.java | 8 +- projects/mtg/CardImageLinks.csv | 30 +- projects/mtg/bin/Res/ai/baka/deck143.txt | 6 +- projects/mtg/bin/Res/sets/BRC/_cards.dat | 132 ++++++- projects/mtg/bin/Res/sets/BRO/_cards.dat | 2 +- .../bin/Res/sets/primitives/borderline.txt | 346 +++++++++++++++++- .../bin/Res/sets/primitives/planeswalkers.txt | 15 +- projects/mtg/include/AllAbilities.h | 4 +- projects/mtg/include/MTGDefinitions.h | 3 +- projects/mtg/src/AllAbilities.cpp | 13 +- projects/mtg/src/MTGAbility.cpp | 14 +- projects/mtg/src/MTGDefinitions.cpp | 3 +- 12 files changed, 560 insertions(+), 16 deletions(-) diff --git a/projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java b/projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java index fb7514cf4..5ad0da6ba 100644 --- a/projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java +++ b/projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java @@ -3964,7 +3964,7 @@ public class ImgDownloader { || scryset.equals("HTR18") || scryset.equals("HTR19") || scryset.equals("DKM") || scryset.equals("S00") || scryset.equals("XLN") || scryset.equals("SOI") || scryset.equals("UST") || scryset.equals("PLG21") || scryset.equals("J21") || scryset.equals("CC2") || scryset.equals("Q06") || scryset.equals("DBL") || scryset.equals("Y22") | scryset.equals("CLB") || scryset.equals("MOM") - || scryset.equals("MOC") || scryset.equals("BRO") || scryset.equals("MAT")){ + || scryset.equals("MOC") || scryset.equals("BRO") || scryset.equals("MAT") || scryset.equals("BRC")){ try { doc = Jsoup.connect(imageurl + scryset.toLowerCase()).get(); Elements outlinks = doc.select("body a"); @@ -4132,7 +4132,7 @@ public class ImgDownloader { && !scryset.equals("HTR18") && !scryset.equals("HTR19") && !scryset.equals("DKM") && !scryset.equals("S00") && !scryset.equals("XLN") && !scryset.equals("SOI") && !scryset.equals("UST") && !scryset.equals("PLG21") && !scryset.equals("J21") && !scryset.equals("CC2") && !scryset.equals("Q06") && !scryset.equals("DBL") && !scryset.equals("Y22") && !scryset.equals("CLB") && !scryset.equals("MOM") - && !scryset.equals("MOC") && !scryset.equals("BRO") && !scryset.equals("MAT")){ + && !scryset.equals("MOC") && !scryset.equals("BRO") && !scryset.equals("MAT") && !scryset.equals("BRC")){ try { doc = Jsoup.connect(imageurl + scryset.toLowerCase()).get(); Elements outlinks = doc.select("body a"); @@ -4251,7 +4251,7 @@ public class ImgDownloader { && !scryset.equals("HTR18") && !scryset.equals("HTR19") && !scryset.equals("DKM") && !scryset.equals("S00") && !scryset.equals("XLN") && !scryset.equals("SOI") && !scryset.equals("UST") && !scryset.equals("PLG21") && !scryset.equals("J21") && !scryset.equals("CC2") && !scryset.equals("Q06") && !scryset.equals("DBL") && !scryset.equals("Y22") && !scryset.equals("CLB") && !scryset.equals("MOM") - && !scryset.equals("MOC") && !scryset.equals("BRO") && !scryset.equals("MAT")){ + && !scryset.equals("MOC") && !scryset.equals("BRO") && !scryset.equals("MAT") && !scryset.equals("BRC")){ try { doc = Jsoup.connect(imageurl + scryset.toLowerCase()).get(); } catch (Exception e) { @@ -4422,7 +4422,7 @@ public class ImgDownloader { || scryset.equals("HTR19") || scryset.equals("DKM") || scryset.equals("S00") || scryset.equals("XLN") || scryset.equals("SOI") || scryset.equals("UST") || scryset.equals("PLG21") || scryset.equals("J21") || scryset.equals("CC2") || scryset.equals("Q06") || scryset.equals("DBL") || scryset.equals("Y22") || scryset.equals("CLB") || scryset.equals("MOM") || scryset.equals("MOC") - || scryset.equals("BRO") || scryset.equals("MAT")){ + || scryset.equals("BRO") || scryset.equals("MAT") || scryset.equals("BRC")){ Elements metadata = doc.select("head meta"); if(metadata != null) { for (int j = 0; j < metadata.size(); j++){ diff --git a/projects/mtg/CardImageLinks.csv b/projects/mtg/CardImageLinks.csv index dbd2bb7ee..1ee751c33 100644 --- a/projects/mtg/CardImageLinks.csv +++ b/projects/mtg/CardImageLinks.csv @@ -62881,7 +62881,7 @@ BRO;583816;https://cards.scryfall.io/large/front/0/b/0ba00d0f-0ea5-417c-a792-06b BRO;583817;https://cards.scryfall.io/large/front/9/c/9c0a17e2-e019-4686-9795-651da2d2955c.jpg BRO;583818;https://cards.scryfall.io/large/front/c/3/c31e6768-bcab-43c4-bfc1-76e961689ae9.jpg BRO;588289;https://cards.scryfall.io/large/front/0/2/02aea379-b444-46a3-82f4-3038f698d4f4.jpg -BRO;588290;https://cards.scryfall.io/large/back/4/0/40a01679-3224-427e-bd1d-b797b0ab68b7.jpg +BRO;588290;https://cards.scryfall.io/large/front/4/0/40a01679-3224-427e-bd1d-b797b0ab68b7.jpg BRO;583819;https://cards.scryfall.io/large/front/5/a/5aa63321-aa28-449d-a31f-869a98c5a6be.jpg BRO;583820;https://cards.scryfall.io/large/front/5/f/5f608efc-0dbc-4cc3-aadd-ed473bfc29ab.jpg BRO;583821;https://cards.scryfall.io/large/front/9/9/99965310-e4bd-40d9-80f5-3fd1754c61c5.jpg @@ -65568,6 +65568,34 @@ ZNR;495099;https://cards.scryfall.io/large/front/5/8/589a324f-4466-4d4a-8cfb-806 ZNR;495100;https://cards.scryfall.io/large/front/1/9/1967d4a8-6cc4-4a4d-9d24-93257de35e6d.jpg ZNR;495101;https://cards.scryfall.io/large/front/3/c/3c6a38dd-e8f5-420f-9576-66937c71286b.jpg ZNR;495102;https://cards.scryfall.io/large/front/2/b/2b90e88b-60a3-4d1d-bb8c-14633e5005a5.jpg +BRC;588357t;https://cards.scryfall.io/large/front/9/1/914fecab-24c0-4179-84d6-ded78c29134f.jpg +BRC;588406t;https://cards.scryfall.io/large/front/b/9/b9a21809-84cb-45f4-8314-80055983450d.jpg +BRC;588408t;https://cards.scryfall.io/large/front/0/0/003367c7-6cb8-4451-8349-76ce5d21e367.jpg +BRC;588414t;https://cards.scryfall.io/large/front/c/e/cef0352e-f879-44f1-ac24-71bab8fbf6d5.jpg +BRC;586467t;https://cards.scryfall.io/large/front/e/e/ee793f2e-f5e0-4cdb-b620-6959ff4b6541.jpg +BRC;586469t;https://cards.scryfall.io/large/front/7/4/74de70f2-93b6-4fc5-8c4d-464f880d3c54.jpg +BRC;589544t;https://cards.scryfall.io/large/front/9/1/914fecab-24c0-4179-84d6-ded78c29134f.jpg +BRC;588500t;https://cards.scryfall.io/large/front/e/e/ee793f2e-f5e0-4cdb-b620-6959ff4b6541.jpg +BRC;588504t;https://cards.scryfall.io/large/front/9/1/914fecab-24c0-4179-84d6-ded78c29134f.jpg +BRC;588505t;https://cards.scryfall.io/large/front/7/4/74de70f2-93b6-4fc5-8c4d-464f880d3c54.jpg +BRC;588557t;https://cards.scryfall.io/large/front/b/9/b9a21809-84cb-45f4-8314-80055983450d.jpg +BRC;588559t;https://cards.scryfall.io/large/front/0/0/003367c7-6cb8-4451-8349-76ce5d21e367.jpg +BRC;588565t;https://cards.scryfall.io/large/front/c/e/cef0352e-f879-44f1-ac24-71bab8fbf6d5.jpg +BRC;588682t;https://cards.scryfall.io/large/front/9/1/914fecab-24c0-4179-84d6-ded78c29134f.jpg +BRC;588685t;https://cards.scryfall.io/large/front/8/b/8baa11ac-c774-4faf-8bc3-e8e1fb945c01.jpg +BRC;588704t;https://cards.scryfall.io/large/front/c/e/cef0352e-f879-44f1-ac24-71bab8fbf6d5.jpg +BRC;588705t;https://cards.scryfall.io/large/front/c/e/cef0352e-f879-44f1-ac24-71bab8fbf6d5.jpg +BRC;588708t;https://cards.scryfall.io/large/front/c/e/cef0352e-f879-44f1-ac24-71bab8fbf6d5.jpg +BRC;588712t;https://cards.scryfall.io/large/front/c/e/cef0352e-f879-44f1-ac24-71bab8fbf6d5.jpg +BRC;588716t;https://cards.scryfall.io/large/front/f/6/f602f9b0-a492-483f-9326-a06a0a63d047.jpg +BRC;588720t;https://cards.scryfall.io/large/front/8/c/8c6e94bc-9d23-44db-a961-677d95dd67d0.jpg +BRC;588730t;https://cards.scryfall.io/large/front/f/1/f1c9e102-7abb-4b72-867f-3aa2f51f6f77.jpg +BRC;588733t;https://cards.scryfall.io/large/front/5/9/59d1db83-674d-4389-837d-564ee7ed07af.jpg +BRC;588738t;https://cards.scryfall.io/large/front/3/5/35dd4d3f-ac03-4bf0-bae2-ad44f61578a8.jpg +BRC;588755t;https://cards.scryfall.io/large/front/e/0/e0747a00-b43a-45de-947f-76d414159f92.jpg +BRC;588762t;https://cards.scryfall.io/large/front/4/3/43b8035b-3e3e-44bb-bfef-4c5474fcc7d8.jpg +BRC;588769t;https://cards.scryfall.io/large/front/8/c/8c6e94bc-9d23-44db-a961-677d95dd67d0.jpg +BRC;588780t;https://cards.scryfall.io/large/front/7/f/7fc777ba-4380-4d9d-8a0d-88e3213107cf.jpg BRC;588356;https://cards.scryfall.io/large/front/7/f/7f5b1daa-ec45-48de-9496-6ca5b491a0dc.jpg BRC;588357;https://cards.scryfall.io/large/front/e/a/ea409050-4296-4b76-a6cd-2896ce1b88e4.jpg BRC;588378;https://cards.scryfall.io/large/front/b/d/bdf67de0-f468-4f04-99ab-a442347bb16b.jpg diff --git a/projects/mtg/bin/Res/ai/baka/deck143.txt b/projects/mtg/bin/Res/ai/baka/deck143.txt index 3867286b9..9fafef019 100644 --- a/projects/mtg/bin/Res/ai/baka/deck143.txt +++ b/projects/mtg/bin/Res/ai/baka/deck143.txt @@ -1,5 +1,9 @@ -#NAME:Phantom Premonition +#NAME:Ranar Commander 2023 +#DESC:Kaldheim Commander Deck +#DESC:Phantom Premonition #HINT:castpriority(commander,*) +#HINT:dontattackwith(Ranar the Ever-Watchful) +#HINT:dontblockwith(Ranar the Ever-Watchful) Angel of Finality (*) * 1 Angel of Serenity (*) * 1 Arcane Artisan (*) * 1 diff --git a/projects/mtg/bin/Res/sets/BRC/_cards.dat b/projects/mtg/bin/Res/sets/BRC/_cards.dat index 414c6100b..b0dea46ed 100644 --- a/projects/mtg/bin/Res/sets/BRC/_cards.dat +++ b/projects/mtg/bin/Res/sets/BRC/_cards.dat @@ -2,9 +2,139 @@ author=Wagic Team name=The Brothers' War Commander year=2022-11-18 -total=209 +total=226 [/meta] [card] +primitive=Construct +id=-588357 +rarity=T +[/card] +[card] +primitive=Powerstone +id=-588406 +rarity=T +[/card] +[card] +primitive=Thopter +id=-588414 +rarity=T +[/card] +[card] +primitive=Elemental +id=-586467 +rarity=T +[/card] +[card] +primitive=Forest Dryad +id=-586469 +rarity=T +[/card] +[card] +primitive=Construct +id=-589544 +rarity=T +[/card] +[card] +primitive=Elemental +id=-588500 +rarity=T +[/card] +[card] +primitive=Construct +id=-588504 +rarity=T +[/card] +[card] +primitive=Forest Dryad +id=-588505 +rarity=T +[/card] +[card] +primitive=Powerstone +id=-588557 +rarity=T +[/card] +[card] +primitive=Thopter +id=-588565 +rarity=T +[/card] +[card] +primitive=Construct +id=-588682 +rarity=T +[/card] +[card] +primitive=Horror +id=-588685 +rarity=T +[/card] +[card] +primitive=Thopter +id=-588704 +rarity=T +[/card] +[card] +primitive=Thopter +id=-588705 +rarity=T +[/card] +[card] +primitive=Thopter +id=-588708 +rarity=T +[/card] +[card] +primitive=Thopter +id=-588712 +rarity=T +[/card] +[card] +primitive=Treasure +id=-588716 +rarity=T +[/card] +[card] +primitive=Servo +id=-588720 +rarity=T +[/card] +[card] +primitive=Faerie +id=-588730 +rarity=T +[/card] +[card] +primitive=Myr +id=-588733 +rarity=T +[/card] +[card] +primitive=Construct +id=-588738 +rarity=T +[/card] +[card] +primitive=Eldrazi +id=-588755 +rarity=T +[/card] +[card] +primitive=Myr +id=-588762 +rarity=T +[/card] +[card] +primitive=Servo +id=-588769 +rarity=T +[/card] +[card] +primitive=Goat +id=-588780 +rarity=T +[/card] +[card] primitive=Mishra, Eminent One id=588356 rarity=M diff --git a/projects/mtg/bin/Res/sets/BRO/_cards.dat b/projects/mtg/bin/Res/sets/BRO/_cards.dat index 21a56c724..4565e2ec5 100644 --- a/projects/mtg/bin/Res/sets/BRO/_cards.dat +++ b/projects/mtg/bin/Res/sets/BRO/_cards.dat @@ -1417,7 +1417,7 @@ rarity=R [card] primitive=Urza, Planeswalker id=588290 -rarity=T +rarity=M [/card] [card] primitive=Mine Worker diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 9f4e5d75d..7ccec0993 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -1,7 +1,7 @@ grade=borderline #Bordeline Primitives Pack for Wagic the Homebrew. #Please keep these card alphabetized, and try to have the "name=" line at the top of each card -#I sorted this programmatically - Thanks to Vitty85 25-05-2023 +#I sorted this programmatically - Thanks to Vitty85 28-05-2023 [card] name=+2 Mace auto={3}:equip @@ -12,6 +12,18 @@ type=Artifact subtype=Equipment [/card] [card] +name=A-Haywire Mite +auto=life:3 controller +auto={G}{S}:name(Exile enchantment) target(enchantment[-creature] moveTo(ownerexile) +auto={G}{S}:name(Exile artifact) target(artifact[-creature] moveTo(ownerexile) +text=When Haywire Mite dies, you gain 3 life. -- {G}, Sacrifice Haywire Mite: Exile target noncreature artifact or noncreature enchantment. +mana={1} +type=Artifact Creature +subtype=Insect +power=1 +toughness=2 +[/card] +[card] name=Aarakocra Sneak auto=_INITIATIVE_CONTROLLER_ abilities=flying @@ -3008,6 +3020,18 @@ power=3 toughness=5 [/card] [card] +name=Arbalest Engineers +auto=choice name(Deal 1 damage) damage:1 target(player,creature,planeswalker) +auto=choice name(Put 1/1 counter) target(creature|battlefield) transforms((,newability[counter(1/1)],newability[trample])) ueot +auto=choice name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=When Arbalest Engineers enters the battlefield, choose one -- Arbalest Engineers deals 1 damage to any target. -- Put a +1/+1 counter on target creature. It gains trample and haste until end of turn. -- Create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={1}{R}{G} +type=Creature +subtype=Human Artificer +power=2 +toughness=2 +[/card] +[card] name=Arbor Armament target=creature auto=counter(1/1) @@ -3860,6 +3884,16 @@ text=Argoth, Sanctum of Nature enters the battlefield tapped unless you control type=Land [/card] [card] +name=Argothian Opportunist +auto=name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=When Argothian Opportunist enters the battlefield, create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={2}{G} +type=Creature +subtype=Human Scout +power=3 +toughness=2 +[/card] +[card] name=Argothian Sprite auto=cantbeblockedby(artifact) auto={7}:counter(1/1,2) @@ -4447,6 +4481,18 @@ power=3 toughness=1 [/card] [card] +name=Ashnod, Flesh Mechanist +abilities=deathtouch +auto=_ATTACKING_may name(Sacrifice creature) target(creature|myBattlefield) sacrifice and!( token(Powerstone) and!( tap(noevent) )! )! +auto={5}{E(creature|mygraveyard)}:name(Create zombie) token(Zombie,Artifact Creature Zombie,3/3) and!( tap(noevent) )! +text=Deathtouch -- Whenever Ashnod, Flesh Mechanist attacks, you may sacrifice another creature. If you do, create a tapped Powerstone token. -- {5}, Exile a creature card from your graveyard: Create a tapped 3/3 colorless Zombie artifact creature token. +mana={B} +type=Legendary Creature +subtype=Human Artificer +power=1 +toughness=1 +[/card] +[card] name=Asmodeus the Archfiend auto=replacedraw transforms((,newability[all(*[zpos=1]|mylibrary) moveto(myexile) and!( counter(0/0.1.AsmodeusExiled) )!])) oneshot auto={B}{B}{B}:name(Draw 7 cards) all(*[zpos<=7]|mylibrary) moveto(myexile) and!( counter(0/0.1.AsmodeusExiled) )! @@ -6585,6 +6631,17 @@ power=2 toughness=2 [/card] [card] +name=Battery Bearer +auto=lord(creature|myBattlefield) transforms((,newability[this(variable{type:artifact:myrestrictedcastingzone}>0) {T}:name(Add mana) add{C}])) +auto=@movedTo(artifact[manacost>=6]|mystack):name(Draw a card) draw:1 controller +text=Creatures you control have "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell." -- Whenever you cast an artifact spell with mana value 6 or greater, draw a card. +mana={2}{G}{U} +type=Creature +subtype=Human Artificer +power=3 +toughness=4 +[/card] +[card] name=Battle Angels of Tyr abilities=flying auto=@combatdamaged(player) from(this) restriction{compare(ohandcount)~morethan~compare(phandcount)}:name(Draw a card) name(Draw a card) draw:1 controller @@ -15179,6 +15236,19 @@ abilities=shroud,indestructible,doublefacedeath,nofizzle type=Emblem [/card] [card] +name=Cityscape Leveler +abilities=trample +auto=may name(Destroy non-land permanent) target(*[-land]|battlefield) destroy and!( transforms((,newability[name(Create powerstone) token(Powerstone) and!( tap(noevent) )!])) oneshot )! +auto=_ATTACKING_may name(Destroy non-land permanent) target(*[-land]|battlefield) destroy and!( transforms((,newability[name(Create powerstone) token(Powerstone) and!( tap(noevent) )!])) oneshot )! +autograveyard={8}:_UNEARTH_ +text=Trample -- When you cast this spell and whenever Cityscape Leveler attacks, destroy up to one target nonland permanent. Its controller creates a tapped Powerstone token. -- Unearth {8} +mana={8} +type=Artifact Creature +subtype=Construct +power=8 +toughness=8 +[/card] +[card] name=Citystalker Connoisseur abilities=deathtouch auto=token(Blood) @@ -21788,6 +21858,15 @@ mana={2}{R} type=Sorcery [/card] [card] +name=Desynchronize +target=*[-land]|battlefield +auto=_SCRY_(2) +auto=name(Put top or bottom) transforms((,newability[choice name(Put on top) moveto(mylibrary)],newability[choice name(Put on bottom) bottomoflibrary])) oneshot +text=Target nonland permanent's owner puts it on the top or bottom of their library. Scry 2. +mana={4}{U} +type=Instant +[/card] +[card] name=Detection Tower auto={T}:add{C} auto={1}{T}:name(Opponent loses hexproof) all(*|opponentbattlefield) transforms((,newability[-opponentshroud],newability[-controllershroud])) ueot @@ -27924,6 +28003,15 @@ power=3 toughness=5 [/card] [card] +name=Excavation Explosion +target=player,creature,planeswalker +auto=damage:3 +auto=name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=Excavation Explosion deals 3 damage to any target. Create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={2}{R} +type=Sorcery +[/card] +[card] name=Excavation Mole auto=deplete:3 controller text=Trample -- When Excavation Mole enters the battlefield, put the top three cards of your library into your graveyard. @@ -29027,6 +29115,14 @@ power=5 toughness=5 [/card] [card] +name=Fallaji Excavation +auto=life:3 controller +auto=name(Create powerstone) token(Powerstone)*3 and!( tap(noevent) )! +text=Create three tapped Powerstone tokens. You gain 3 life. (The tokens are artifacts with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={3}{G}{G} +type=Sorcery +[/card] +[card] name=Fallaji Vanguard abilities=first strike auto=target(creature) 2/0 ueot @@ -33849,6 +33945,17 @@ power=4 toughness=3 [/card] [card] +name=Geology Enthusiast +auto=@each my endofturn:name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +auto={6}:name(Draw and put counter) transforms((,newability[draw:1 controller],newability[counter(1/1)])) oneshot +text=At the beginning of your end step, create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") -- {6}: Draw a card and put a +1/+1 counter on Geology Enthusiast. +mana={3}{U}{U} +type=Creature +subtype=Human Artificer +power=2 +toughness=5 +[/card] +[card] name=Geomancer's Gambit target=land auto=destroy && ability$!name(search land) notatarget(land[basic]|mylibrary) moveTo(mybattlefield) and!(tap(noevent))!!$ targetcontroller @@ -34799,6 +34906,15 @@ power=1 toughness=2 [/card] [card] +name=Gix's Caress +auto=if type(*[-land]|opponenthand)~morethan~0 then name(Discard opponent non-land card) name(Discard opponent non-land card) target(*[-land]|opponenthand) reject +auto=if type(*[-land]|opponenthand)~equalto~0 then name(Look opponent hand) name(Look opponent hand) target(*|opponenthand) moveto(myreveal) and!( moveto(opponenthand) )! +auto=name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=Target opponent reveals their hand. You choose a nonland card from it. That player discards that card. -- Create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={2}{B} +type=Sorcery +[/card] +[card] name=Gixian Infiltrator auto=@sacrificed(other *|mybattlefield):counter(1/1) all(this) text=Whenever you sacrifice another permanent, put a +1/+1 counter on Gixian Infiltrator. @@ -35739,6 +35855,16 @@ power=2 toughness=1 [/card] [card] +name=Goblin Blast-Runner +auto=@sacrificed(*|mybattlefield):name(Gets 2/0 and menace) transforms((,newability[2/0],newability[menace])) ueot +text=Goblin Blast-Runner gets +2/+0 and has menace as long as you sacrificed a permanent this turn. +mana={R} +type=Creature +subtype=Goblin +power=1 +toughness=2 +[/card] +[card] name=Goblin Bowling Team auto=@damaged(creature) from(this):all(trigger[to]) rolld6 6 winability damage:lastrollresult winabilityend loseability damage:lastrollresult loseabilityend rolld6end auto=@damageof(player) from(this):all(this) rolld6 6 winability damage:lastrollresult controller winabilityend loseability damage:lastrollresult controller loseabilityend rolld6end @@ -37247,6 +37373,16 @@ power=3 toughness=4 [/card] [card] +name=Great Desert Prospector +auto=name(Create powerstone) foreach(other creature|myBattlefield) token(Powerstone) and!( tap(noevent) )! +text=When Great Desert Prospector enters the battlefield, create a tapped Powerstone token for each other creature you control. (The tokens are artifacts with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={4}{W} +type=Creature +subtype=Human Artificer +power=3 +toughness=2 +[/card] +[card] name=Great Hall of Starnheim auto=tap(noevent) auto={T}:add{B} @@ -38650,6 +38786,18 @@ text=If you control two or more other lands, Hall of Storm Giants enters the bat type=Land [/card] [card] +name=Hall of Tagsin +auto={T}:add{C} +auto={1}{T}:add{W} +auto={1}{T}:add{U} +auto={1}{T}:add{B} +auto={1}{T}:add{R} +auto={1}{T}:add{G} +auto={4}{T}:name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text={T}: Add {C}. -- {1}, {T}: Add one mana of any color. -- {4}, {T}: Create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +type=Land +[/card] +[card] name=Hallar, the Firefletcher abilities=trample auto=@movedto(*[kicked>=1]|mystack):transforms((,newability[counter(1/1)],newability[thisforeach(counter{1/1.1}) damage:1 opponent])) oneshot @@ -41419,6 +41567,18 @@ power=3 toughness=3 [/card] [card] +name=Horned Stoneseeker +abilities=menace +auto=name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +auto=@movedto(*|nonbattlezone) from(mybattlefield):name(Sacrifice powerstone) target(powerstone|mybattlefield) sacrifice +text=Menace -- When Horned Stoneseeker enters the battlefield, create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") -- When Horned Stoneseeker leaves the battlefield, sacrifice a Powerstone. +mana={1}{R} +type=Creature +subtype=Lizard +power=2 +toughness=2 +[/card] +[card] name=Hornswoggle target=creature|stack auto=fizzle @@ -43170,6 +43330,14 @@ mana={G}{G} type=Enchantment [/card] [card] +name=In the Trenches +auto=lord(creature|myBattlefield) +1/+1 +auto=this(cantargetcard(*[-effectdone]) {5}{W}:name(Exile nonland permanent) name(Exile nonland permanent) becomes(effectdone) forever && transforms((,newability[name(Exile nonland permanent) (blink)forsrc target(*[-land]|opponentbattlefield)])) forever asSorcery +text=Creatures you control get +1/+1. -- {5}{W}: Exile target nonland permanent you don't control until In the Trenches leaves the battlefield. Activate only as a sorcery and only once. +mana={1}{W}{W} +type=Enchantment +[/card] +[card] name=Inalla, Archmage Ritualist auto=@movedto(other wizard[-token]|mybattlefield):all(trigger[to]) pay[[{1}]] clone with(unearth,haste) auto={T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}{T(wizard|myBattlefield)}:target(player) life:-7 @@ -45178,6 +45346,13 @@ mana={1}{U}{U}{U}{U} type=Sorcery [/card] [card] +name=Involuntary Cooldown +auto=may name(Tap and stun) target(*[artifact;creature]|battlefield) transforms((,newability[tap],newability[counter(0/0.2.Stun)])) oneshot +text=Tap up to two target artifacts and/or creatures. Put two stun counters on each of them. (If a permanent with a stun counter would become untapped, remove one from it instead.) +mana={3}{U} +type=Sorcery +[/card] +[card] name=Involuntary Employment target=creature auto=moveto(mybattlefield) and!(transforms((,newability[phaseaction[endofturn sourceinplay] moveTo(previousbattlefield)],newability[untap],haste)) ueot)! @@ -47494,6 +47669,14 @@ mana={W}{W}{B}{B} type=Sorcery [/card] [card] +name=Kayla's Reconstruction +aicode=activate transforms((,newability[if type(creature[manacost<=3&zpos<=7]|mylibrary)~equalto~0 then if type(artifact[manacost<=3&zpos<=7]|mylibrary)~equalto~0 then all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )!],newability[if type(creature[manacost<=3&zpos<=7]|mylibrary)~morethan~0 then target(creature[manacost<=3&zpos<=7]|mylibrary) moveto(mybattlefield) and!( transforms((,newability[all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )!],newability[if type(artifact[manacost<=3&zpos<=7]|mylibrary)~morethan~0 then target(artifact[manacost<=3&zpos<=7]|mylibrary) moveto(mybattlefield) and!( transforms((,newability[all(*[zpos<=7]|mylibrary) moveto(myreveal) and!( bottomoflibrary )!])) oneshot )! ])) oneshot +auto=name(Look top 7 cards) reveal:7 optionone name(Choose artifacts or creatures) target(*[manacost<=3]|reveal) moveto(mylibrary) and!( if cantargetcard(*[artifact;creature]|*) then becomes(tobecast) ueot )! optiononeend optiontwo name(Put on bottom) target(*|reveal) bottomoflibrary and!( all(*|reveal) bottomoflibrary )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(mybattlefield) afterrevealedend revealend +text=Look at the top seven cards of your library. Put up to X artifact and/or creature cards with mana value 3 or less from among them onto the battlefield. Put the rest on the bottom of your library in a random order. +mana={X}{W}{W}{W} +type=Sorcery +[/card] +[card] name=Kaza, Roil Chaser abilities=flying,haste auto={T}:name(Next spell cost less) target(*[instant;sorcery]|myhand) transforms((,newability[changecost(colorless:-cardcounttypewizard) forcedalive])) ueot @@ -48908,6 +49091,17 @@ power=7 toughness=6 [/card] [card] +name=Koilos Roc +abilities=flash,flying +auto=name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=Flash -- Flying -- When Koilos Roc enters the battlefield, create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={4}{U} +type=Creature +subtype=Bird +power=3 +toughness=3 +[/card] +[card] name=Kolaghan Warmonger abilities=haste aicode=activate transforms((,newability[if type(dragon[zpos<=6]|mylibrary)~morethan~0 then target(dragon[zpos<=6]|mylibrary) moveto(myhand) and!( all(*[zpos<=6]|mylibrary) moveto(myreveal) and!( bottomoflibrary )! )!],newability[if type(dragon[zpos<=6]|mylibrary)~equalto~0 then all(*[zpos<=6]|mylibrary) moveto(myreveal) and!( bottomoflibrary )!])) oneshot @@ -50521,6 +50715,15 @@ mana={W} type=Legendary Enchantment [/card] [card] +name=Legions to Ashes +target=*[-land]|opponentbattlefield +auto=moveto(exile) +auto=all(*[token&share!name!]|opponentbattlefield) moveto(exile) +text=Exile target nonland permanent an opponent controls and all tokens that player controls with the same name as that permanent. +mana={1}{W}{B} +type=Sorcery +[/card] +[card] name=Leinore, Autumn Sovereign auto=@each my combatbegins:name(Put 1/1 counter) transforms((,newability[choice name(Put 1/1 counter) target(creature|mybattlefield) counter(1/1) && if coven then name(Draw a card) draw:1 controller],newability[if coven then choice name(Don't put counter) name(Don't put counter) draw:1 controller],newability[ifnot coven then choice name(Don't put counter) name(Don't put counter) donothing])) oneshot text=Coven - At the beginning of combat on your turn, put a +1/+1 counter on up to one target creature you control. Then if you control three or more creatures with different powers, draw a card. @@ -54535,6 +54738,16 @@ power=3 toughness=4 [/card] [card] +name=Mechanized Warfare +auto=@damaged(*|opponentbattlefield) from(artifact[-red]|mybattlefield):all(trigger[to]) damage:1 +auto=@damagefoeof(player) from(artifact[-red]|mybattlefield):damage:1 opponent +auto=@damaged(*|opponentbattlefield) from(*[-Mechanized Warfare;red]|mybattlefield):all(trigger[to]) damage:1 +auto=@damagefoeof(player) from(*[-Mechanized Warfare;red]|mybattlefield):damage:1 opponent +text=If a red or artifact source you control would deal damage to an opponent or a permanent an opponent controls, it deals that much damage plus 1 instead. +mana={1}{R}{R} +type=Enchantment +[/card] +[card] name=Meddling Mage auto=chooseanameopp transforms((,newability[maxCast(*[chosenname])0 controller],newability[maxCast(*[chosenname])0 opponent])) forever chooseend nonland text=As Meddling Mage enters the battlefield, name a nonland card. -- The named card can't be cast. @@ -55158,6 +55371,13 @@ type=Artifact subtype=Equipment [/card] [card] +name=Meticulous Excavation +auto={2}{W}:name(Return permanent) target(*|myBattlefield) transforms((,newability[if cantargetcard(*[unearth]|*) then moveto(ownerexile) and!( moveto(ownerhand) )!],newability[if cantargetcard(*[-unearth]|*) then moveto(ownerhand)])) oneshot myturnonly +text={2}{W}: Return target permanent you control to its owner's hand. If it has unearth, instead exile it, then return that card to its owner's hand. Activate only during your turn. +mana={W} +type=Enchantment +[/card] +[card] name=Metropolis Angel abilities=flying auto=@combat(attacking) source(creature[counter{any}]|mybattlefield) turnlimited:draw:1 @@ -62457,6 +62677,15 @@ mana={3}{G}{G} type=Sorcery [/card] [card] +name=Overwhelming Remorse +abilities=affinitygravecreatures +target=*[creature;planeswalker]|battlefield +auto=moveto(exile) +text=This spell costs {1} less to cast for each creature card in your graveyard. -- Exile target creature or planeswalker. +mana={4}{B} +type=Instant +[/card] +[card] name=Overwhelming Splendor target=player auto=lord(creature|targetedpersonsbattlefield) transforms((,setpower=1,settoughness=1,newability[noactivatedability])) @@ -65555,6 +65784,23 @@ mana={2}{U} type=Sorcery [/card] [card] +name=Powerstone +auto=this(variable{type:artifact:myrestrictedcastingzone}>0) {T}:name(Add mana) add{C} +text={T}: Add {C}. This mana can't be spent to cast a nonartifact spell. +type=Artifact +subtype=Powerstone +[/card] +[card] +name=Powerstone Engineer +auto=_DIES_name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=When Powerstone Engineer dies, create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={1}{W} +type=Creature +subtype=Human Artificer +power=2 +toughness=1 +[/card] +[card] name=Powerstone Fracture target=creature,planeswalker auto=destroy @@ -74449,6 +74695,17 @@ power=3 toughness=4 [/card] [card] +name=Sarinth Greatwurm +abilities=trample +auto=@movedto(land|battlefield):name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=Trample -- Whenever a land enters the battlefield, create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={4}{R}{G} +type=Creature +subtype=Wurm +power=7 +toughness=6 +[/card] +[card] name=Sarkhan's Catharsis target=player,planeswalker auto=damage:5 @@ -78375,6 +78632,15 @@ power=3 toughness=2 [/card] [card] +name=Sibling Rivalry +target=*[creature;artifact]|battlefield +auto=moveto(mybattlefield) and!( transforms((,newability[phaseaction[endofturn sourceinplay] moveTo(previousbattlefield)],newability[untap],newability[haste])) ueot )! +auto=name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=Gain control of target artifact or creature until end of turn. Untap it. It gains haste until end of turn. Create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={3}{R} +type=Sorcery +[/card] +[card] name=Sickening Dreams auto=if type(*|myHand)~morethan~0 then choice ability$!name(X=1) target(*|myhand) reject!$ controller && damage:1 all(creature) && damage:1 all(player) auto=if type(*|myHand)~morethan~1 then choice ability$!name(X=2) target(<2>*|myhand) reject!$ controller && damage:2 all(creature) && damage:2 all(player) @@ -83943,6 +84209,17 @@ power=2 toughness=2 [/card] [card] +name=Steel Exemplar +abilities=trample,sunburst +auto=if compare(sunburst)~equalto~1 then counter(1/1,2) +text=Trample -- Steel Exemplar enters the battlefield with two +1/+1 counters on it unless two or more colors of mana were spent to cast it. +mana={5} +type=Artifact Creature +subtype=Wizard +power=4 +toughness=4 +[/card] +[card] name=Steel Hellkite abilities=flying auto={2}:name(Gains 1/0) 1/0 ueot @@ -84143,6 +84420,14 @@ mana={U} type=Instant [/card] [card] +name=Stern Lesson +auto=name(Draw and discard) draw:2 controller && transforms((,newability[name(Discard a card) target(*|myhand) reject])) forever +auto=name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=Draw two cards, then discard a card. Create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={2}{U} +type=Instant +[/card] +[card] name=Steward of Solidarity auto=@exerted(this):token(Warrior,creature Warrior,1/1,white,vigilance) auto={T}:exert @@ -84383,6 +84668,16 @@ power=2 toughness=2 [/card] [card] +name=Stone Retrieval Unit +auto=name(Create powerstone) token(Powerstone) and!( tap(noevent) )! +text=When Stone Retrieval Unit enters the battlefield, create a tapped Powerstone token. (It's an artifact with "{T}: Add {C}. This mana can't be spent to cast a nonartifact spell.") +mana={4} +type=Artifact Creature +subtype=Construct +power=2 +toughness=3 +[/card] +[card] name=Stonebinder's Familiar auto=@movedto(*|exile) restriction{during my turn} turnlimited:counter(1/1) text=Whenever one or more cards are put into exile during your turn, put a +1/+1 counter on Stonebinder's Familiar. This ability triggers only once each turn. @@ -86608,6 +86903,13 @@ power=1 toughness=1 [/card] [card] +name=Symmetry Matrix +auto=@movedTo(creature[power=toughness]|myBattlefield):may pay({1}) draw:1 controller +text=Whenever a creature with power equal to its toughness enters the battlefield under your control, you may pay {1}. If you do, draw a card. +mana={4} +type=Artifact +[/card] +[card] name=Symmetry Sage abilities=flying auto=@movedto(*[instant;sorcery]|mystack):name(Creature has base power 2) target(creature|mybattlefield) transforms((,settoughness=2)) ueot @@ -89185,6 +89487,16 @@ type=Enchantment subtype=Saga [/card] [card] +name=The Mightstone and Weakstone +auto=choice name(Draw 2 cards) draw:2 controller +auto=if type(creature|battlefield)~morethan~0 then choice name(Creature gets -5/-5) name(Creature gets -5/-5) target(creature|battlefield) transforms((,newability[-5/-5])) ueot +auto=this(variable{type:artifact:myrestrictedcastingzone}>0) {T}:name(Add mana) add{C}{C} +text=When The Mightstone and Weakstone enters the battlefield, choose one -- Draw two cards. -- Target creature gets -5/-5 until end of turn. -- {T}: Add {C}{C}. This mana can't be spent to cast nonartifact spells. -- (Melds with Urza, Lord Protector.) +mana={5} +type=Legendary Artifact +subtype=Powerstone +[/card] +[card] name=The Mirari Conjecture auto=counter(0/0,1,Lore) auto=@each my firstmain:counter(0/0,1,Lore) @@ -89317,6 +89629,13 @@ power=6 toughness=5 [/card] [card] +name=The Stasis Coffin +auto={2}{T}{E}:name(Gain protection) token(Coffin Protection,Emblem,0/0,indestructible,shroud,controllershroud,notrigger) and!( transforms((,newability[preventalldamage to(controller) from(*|opponentzones)],newability[preventalldamage to(controller) from(*|myzones)],newability[@each my untap:sacrifice])) forever )! +text={2}, {T}, Exile The Stasis Coffin: You gain protection from everything until your next turn. +mana={3} +type=Legendary Artifact +[/card] +[card] name=The Surgical Bay auto=tap(noevent) auto={T}:Add{U} @@ -89823,6 +90142,13 @@ mana={4} type=Artifact [/card] [card] +name=Thran Vigil +auto=@movedto(creature|mystack,mycommandzone,mylibrary,mybattlefield,mysideboard,myexile) from(mygraveyard):name(Put 1/1 counter) target(creature|myBattlefield) counter(1/1) +text=Whenever one or more artifact and/or creature cards leave your graveyard during your turn, put a +1/+1 counter on target creature you control. +mana={1}{B} +type=Enchantment +[/card] +[card] name=Thrash // Threat other={2}{R}{G} name(Threat) otherrestriction=myturnonly @@ -98041,6 +98367,13 @@ power=2 toughness=1 [/card] [card] +name=Wasteful Harvest +auto=name(Mill 5 cards) all(*[zpos<=4]|mylibrary) moveto(mygraveyard) and!( transforms((tobereturn,newability[all(*[zpos=5]|mylibrary) moveto(mygraveyard) and!( transforms((tobereturn,newability[may name(Return a permanent) target(tobereturn[-instant&-sorcery]|mygraveyard) moveto(myhand)])) ueot )!])) ueot )! +text=Mill five cards. You may put a permanent card from among the cards milled this way into your hand. (To mill a card, put the top card of your library into your graveyard.) +mana={2}{G} +type=Instant +[/card] +[card] name=Wasteland Scorpion abilities=deathtouch,cycling autohand=__CYCLING__({2}) @@ -101128,6 +101461,17 @@ power=1 toughness=1 [/card] [card] +name=Zephyr Sentinel +abilities=flash,flying +auto=may name(Return other creature) target(other creature|myBattlefield) moveto(ownerhand) and!( if cantargetcard(*[soldier]|*) then all(this) counter(1/1) )! +text=Flash -- Flying -- When Zephyr Sentinel enters the battlefield, return up to one other target creature you control to its owner's hand. If it was a Soldier, put a +1/+1 counter on Zephyr Sentinel. +mana={1}{U} +type=Creature +subtype=Human Soldier +power=2 +toughness=1 +[/card] +[card] name=Zephyr Singer abilities=flying,vigilance other={convoke} name(Convoke) diff --git a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt index 5a5d33128..1d0f7aa60 100644 --- a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt +++ b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt @@ -1,6 +1,6 @@ #Planeswalkers Primitives Pack for Wagic the Homebrew. #Please keep these card alphabetized, and try to have the "name=" line at the top of each card -#We sorted this in alphabetical order - Luruz & Vitty85 23-05-2023 +#We sorted this in alphabetical order - Luruz & Vitty85 28-05-2023 [card] name=Abian, Luvion Usurper auto=counter(0/0,5,loyalty) @@ -3208,6 +3208,19 @@ type=Legendary Planeswalker subtype=Ugin [/card] [card] +name=Urza, Planeswalker +abilities=canloyaltytwice +auto={C(0/0,2,Loyalty)}:name(+2: Artifacts and spells cost 2 less) token(Urza Emblem,Emblem,0/0,indestructible,shroud,notrigger,tnum.2) and!( transforms((,newability[life:2 controller],newability[lord(artifact|mycastingzone) changecost(colorless:-2) forcedalive],newability[lord(instant|mycastingzone) changecost(colorless:-2) forcedalive],newability[lord(sorcery|mycastingzone) changecost(colorless:-2) forcedalive],newability[treason])) forever )! +auto={C(0/0,1,Loyalty)}:name(+1: Draw and discard) draw:2 controller && transforms((,newability[target(*|myhand) reject])) forever +auto={C(0/0,0,Loyalty)}:name(+0: Create 2 soldiers) token(Soldier,Artifact Creature Soldier,1/1)*2 +auto={C(0/0,-3,Loyalty)}:name(-3: Exile nonland permanent) target(*[-land]|battlefield) moveto(ownerexile) +auto={C(0/0,-10,Loyalty)}:name(-10: destroy all nonland permanents) all(*[artifact;planeswalker]|mybattlefield) transforms((,newability[indestructible],newability[all(*[-land]|opponentbattlefield) destroy],newability[all(*[-land&-artifact&-planeswalker]|mybattlefield) destroy])) ueot +text=You may activate the loyalty abilities of Urza, Planeswalker twice each turn rather than only once. -- [+2]: Artifact, instant, and sorcery spells you cast this turn cost {2} less to cast. You gain 2 life. -- [+1]: Draw two cards, then discard a card. -- [0]: Create two 1/1 colorless Soldier artifact creature tokens. -- [−3]: Exile target nonland permanent. -- [−10]: Artifacts and planeswalkers you control gain indestructible until end of turn. Destroy all nonland permanents. +color=blue,white +type=Legendary Planeswalker +subtype=Urza +[/card] +[card] name=Venser, the Sojourner auto=counter(0/0,3,loyalty) auto={C(0/0,2,Loyalty)}:name(+2: Exile target permanent and return) target(*|mybattlefield) (blink)ueot diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index b65dcbbb8..1e9b31f5e 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2782,7 +2782,7 @@ public: int addToGame() { if(!ability) - return 1; //Fix a possible crash on mutate cards + return 1; //Fix a possible crash on mutate cards. ability->forceDestroy = -1; ability->target = target; //Might have changed since initialization ability->addToGame(); @@ -4713,12 +4713,14 @@ public: class AAMeld : public ActivatedAbility { public: + MTGAbility * andAbility; string _MeldedName; AAMeld(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string MeldedName = ""); int resolve(); const string getMenuText(); AAMeld * clone() const; + ~AAMeld(); }; /* doubleside */ diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index e43ebf9f9..754ab6fa2 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -354,7 +354,8 @@ class Constants AFFINITYGRAVECREATURES = 226, AFFINITYATTACKINGCREATURES = 227, AFFINITYGRAVEINSTSORC = 228, - NB_BASIC_ABILITIES = 229, + CANLOYALTYTWICE = 229, + NB_BASIC_ABILITIES = 230, RARITY_S = 'S', //Special Rarity RARITY_M = 'M', //Mythics diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index a5c14b5ae..bacca7dbc 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4735,6 +4735,7 @@ AAMeld::AAMeld(GameObserver* observer, int id, MTGCardInstance * card, MTGCardIn ActivatedAbility(observer, id, card, 0), _MeldedName(MeldedName) { target = _target; + andAbility = NULL; // aType = MTGAbility::Melder; } @@ -4751,6 +4752,8 @@ int AAMeld::resolve() MTGAbility *a = NEW AACastCard(game, game->mLayers->actionLayer()->getMaxId(), source, source, false, false, false, _MeldedName, _MeldedName, false, true); a->oneShot = false; a->canBeInterrupted = false; + if(andAbility) + ((AACastCard*)a)->andAbility = andAbility->clone(); a->addToGame(); return 1; @@ -4765,7 +4768,15 @@ const string AAMeld::getMenuText() AAMeld * AAMeld::clone() const { - return NEW AAMeld(*this); + AAMeld * a = NEW AAMeld(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AAMeld::~AAMeld() +{ + SAFE_DELETE(andAbility); } //Turn side of double faced cards diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 232c0ed7c..3428cdb89 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -5057,6 +5057,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } MTGAbility * a = NEW AAMeld(observer, id, card, target, splitMeldName); a->oneShot = true; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AAMeld*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -7050,8 +7056,12 @@ int ActivatedAbility::isReactingToClick(MTGCardInstance * card, ManaCost * mana) { ActivatedAbility * check = dynamic_cast(card->getObserver()->mLayers->actionLayer()->mObjects[k]); turnSide = card->isFlipped > 0 && !card->isInPlay(card->getObserver()); - if(!turnSide && check && check->source == card && check->counters) - return 0; + if(!turnSide && check && check->source == card){ + if(check->counters && !card->has(Constants::CANLOYALTYTWICE)) + return 0; + else if(check->counters > 1 && card->has(Constants::CANLOYALTYTWICE)) + return 0; + } } if (player != game->currentPlayer) return 0; diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 9c02b4e67..5972acbad 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -259,7 +259,8 @@ const char* Constants::MTGBasicAbilities[] = { "affinitytwobasiclandtypes", //Cost 2 less for each basic land type in your battlefield. "affinitygravecreatures", //Cost 1 less for each creature in your graveyard. "affinityattackingcreatures", //Cost 1 less for each attacking creature in your battlefield. - "affinitygraveinstsorc" //Cost 1 less for each instant or sorcery in your graveyard. + "affinitygraveinstsorc", //Cost 1 less for each instant or sorcery in your graveyard. + "canloyaltytwice" //Planeswalker can activate its loyalty abilities twice in a turn (e.g. "Urza, Planeswalker"). }; map Constants::MTGBasicAbilitiesMap;