From d3379c9c0852e0fbf3f23021d11ea2340df2ec1e Mon Sep 17 00:00:00 2001 From: Vittorio Alfieri Date: Fri, 19 Feb 2021 18:50:25 +0100 Subject: [PATCH] Fixed a crash when AI try to activate a combo (caused by new ANYTYPEOFMANA management), fixed the Visual C++ project file descriptor, fixed ELD set DAT file, improved Andorid downloader, fixed primitives. --- .../src/net/wagic/utils/ImgDownloader.java | 4 ++++ projects/mtg/bin/Res/sets/ELD/_cards.dat | 7 ++++++- .../mtg/bin/Res/sets/primitives/borderline.txt | 15 +++++++++------ projects/mtg/bin/Res/sets/primitives/mtg.txt | 2 +- projects/mtg/src/AIPlayerBaka.cpp | 2 +- projects/mtg/template.vcxproj | 2 +- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java b/projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java index 697b8bb4c..6127d8707 100644 --- a/projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java +++ b/projects/mtg/Android/src/net/wagic/utils/ImgDownloader.java @@ -1742,6 +1742,10 @@ public class ImgDownloader { cardurl = "https://c1.scryfall.com/file/scryfall-cards/large/front/5/4/54a1c6a9-3531-4432-9157-e4400dbc89fd.jpg?1611206522"; else if(id.equals("503841t")) cardurl = "https://c1.scryfall.com/file/scryfall-cards/large/front/d/f/df826c7d-5508-4e21-848c-91bc3e3f447a.jpg?1611206331"; + else if(id.equals("473148")) + cardurl = "https://img.scryfall.com/cards/large/front/5/d/5dca90ef-1c17-4dcc-9fef-dab9ee92f590.jpg?1572490726"; + else if(id.equals("473127t")) + cardurl = "https://img.scryfall.com/cards/large/front/9/4/94057dc6-e589-4a29-9bda-90f5bece96c4.jpg?1572489125"; return cardurl; } diff --git a/projects/mtg/bin/Res/sets/ELD/_cards.dat b/projects/mtg/bin/Res/sets/ELD/_cards.dat index 629fd3b23..e2c76ab67 100644 --- a/projects/mtg/bin/Res/sets/ELD/_cards.dat +++ b/projects/mtg/bin/Res/sets/ELD/_cards.dat @@ -3,7 +3,7 @@ author=Wagic Team name=Throne of Eldraine orderindex=EXP-ZZD.ELD year=2019-10-04 -total=325 +total=326 [/meta] [card] primitive=Warrior @@ -91,6 +91,11 @@ id=-473141 rarity=T [/card] [card] +primitive=Human +id=-473127 +rarity=T +[/card] +[card] primitive=Giant id=-473121 rarity=T diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 9ae4e1ab0..d64c9650c 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -39077,10 +39077,13 @@ type=Land [/card] [card] name=Primal Command -target=player -auto=choice name(Choose 1 and 2) life:7 targetedplayer && target(player) moveTo(ownerlibrary) and!(shuffle)! all(*|targetedpersonsgraveyard) -auto=choice name(Choose 1 and 3) life:7 targetedplayer && Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>creature|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend -auto=choice name(Choose 2 and 3) moveTo(ownerlibrary) and!(shuffle)! all(*|targetedpersonsgraveyard) && Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>creature|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend +auto=choice name(Gain life and return non-creature) transforms((,newability[choice name(You gain life) life:7 controller && name(Return non-creature) target(*[-creature]|battlefield) moveTo(ownerlibrary)],newability[choice name(Opponent gains life) life:7 opponent && name(Return non-creature) target(*[-creature]|battlefield) moveTo(ownerlibrary)])) oneshot +auto=choice name(Gain life and return graveyard) transforms((,newability[choice name(You gain life) life:7 controller && target(player) moveTo(ownerlibrary) and!(shuffle)! all(*|targetedpersonsgraveyard)],newability[choice name(Opponent gains life) life:7 opponent && target(player) moveTo(ownerlibrary) and!(shuffle)! all(*|targetedpersonsgraveyard)])) oneshot +auto=choice name(Gain life and search creature) transforms((,newability[choice name(You gain life) life:7 controller && name(Search creature) target(creature|mylibrary) moveTo(myhand) and!( shuffle )!],newability[choice name(Opponent gains life) life:7 opponent && name(Search creature) target(creature|mylibrary) moveTo(myhand) and!( shuffle )!])) oneshot +auto=choice name(Return non-creature and return graveyard) ability$!name(Player shuffles graveyard) name(Player shuffles graveyard) target(player) moveTo(ownerlibrary) and!(shuffle)! all(*|targetedpersonsgraveyard)!$ controller && ability$!name(Put non-creature on top) name(Put non-creature on top) target(*[-creature]|battlefield) transforms((,newability[moveTo(ownerlibrary)])) oneshot!$ controller +auto=if type(creature|mylibrary)~equalto~0 then choice choice name(Return non-creature and search creature) name(Return non-creature and search creature) target(*[-creature]|battlefield) moveTo(ownerlibrary) +auto=if type(creature|mylibrary)~morethan~0 then choice name(Search creature and return non-creature) name(Search creature and return non-creature) target(creature|mylibrary) moveTo(myhand) and!( transforms((,newability[name(Put non-creature on top) target(*[-creature]|battlefield) moveTo(ownerlibrary)])) oneshot )! +auto=choice name(Return graveyard and search creature) ability$!name(Search creature) name(Search creature) target(creature|mylibrary) moveTo(myhand) and!( shuffle )! !$ controller && ability$!name(Player shuffles graveyard) name(Player shuffles graveyard) target(player) moveTo(ownerlibrary) and!(shuffle)! all(*|targetedpersonsgraveyard)!$ controller text=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. mana={3}{G}{G} type=Sorcery @@ -41434,7 +41437,7 @@ type=Sorcery [card] name=Remorseful Cleric abilities=flying -auto={S}:auto=moveTo(exile) all(*|targetedpersonsgraveyard) target(player) +auto={S}:choice name(Exile cards in graveyard) moveTo(exile) all(*|targetedpersonsgraveyard) target(player) text=Flying -- Sacrifice Remorseful Cleric: Exile all cards from target player's graveyard. mana={1}{W} type=Creature @@ -48847,7 +48850,7 @@ toughness=6 [card] name=Soulherder auto=@movedto(creature|exile) from(battlefield):counter(1/1) all(this) -auto=@each my end:may name(Move to exile) target(creature|mybattlefield) moveto(exile) and!(moveto(mybattlefield))! +auto=@each my end:may name(Move to exile) target(other *[creature]|mybattlefield) moveto(exile) and!(moveto(mybattlefield))! text=Whenever a creature is exiled from the battlefield, put a +1/+1 counter on Soulherder. -- At the beginning of your end step, you may exile another target creature you control, then return that card to the battlefield under its owner's control. mana={1}{W}{U} type=Creature diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index c2510e7c1..8e5860117 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -3648,7 +3648,7 @@ toughness=5 [card] name=Angel of Finality abilities=flying -auto=target(player) moveto(exile) all(*|targetedpersonsgraveyard) +auto=choice name(Exile cards in graveyard) target(player) moveto(exile) all(*|targetedpersonsgraveyard) text=Flying -- When Angel of Finality enters the battlefield, exile all cards from target player's graveyard. mana={3}{W} type=Creature diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index fd65df716..7bbe0e5fb 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -3423,7 +3423,7 @@ MTGCardInstance * AIPlayerBaka::activateCombo() } SAFE_DELETE(hintTc); } - if(payTheManaCost(totalCost,nextCardToPlay->has(Constants::ANYTYPEOFMANA),nextCardToPlay,gotPayments)) + if(payTheManaCost(totalCost,(nextCardToPlay?nextCardToPlay->has(Constants::ANYTYPEOFMANA):0),nextCardToPlay,gotPayments)) //Fix crash when nextCardToPlay is null. { if(comboCards.size()) { diff --git a/projects/mtg/template.vcxproj b/projects/mtg/template.vcxproj index 53311d870..f10c14c84 100644 --- a/projects/mtg/template.vcxproj +++ b/projects/mtg/template.vcxproj @@ -452,7 +452,7 @@ - +