diff --git a/Boost/boost/smart_ptr/shared_ptr.hpp b/Boost/boost/smart_ptr/shared_ptr.hpp index aca83c72f..78d367a69 100644 --- a/Boost/boost/smart_ptr/shared_ptr.hpp +++ b/Boost/boost/smart_ptr/shared_ptr.hpp @@ -182,9 +182,7 @@ public: shared_ptr(): px(0), pn() // never throws in 1.30+ { } - - shared_ptr(const shared_ptr&) = default; - + template explicit shared_ptr( Y * p ): px( p ), pn( p ) // Y must be complete { diff --git a/JGE/src/JGE.cpp b/JGE/src/JGE.cpp index 8b03c16bb..3556bdbda 100644 --- a/JGE/src/JGE.cpp +++ b/JGE/src/JGE.cpp @@ -712,10 +712,10 @@ string JGE::getFileUserFolderPath() jstring systemPath = (jstring) env->CallStaticObjectMethod(jniClass, methodId); // Now convert the Java String to C++ char array - const char* cstr = env->GetStringUTFChars(systemPath, 0); - string retVal (cstr); - env->ReleaseStringUTFChars(systemPath, cstr); - env->DeleteLocalRef(systemPath); + const char* cstr = env->GetStringUTFChars(systemPath, 0); + string retVal (cstr); + env->ReleaseStringUTFChars(systemPath, cstr); + env->DeleteLocalRef(systemPath); return retVal; } diff --git a/projects/mtg/Android/project.properties b/projects/mtg/Android/project.properties index 82181932d..9b84a6b4b 100644 --- a/projects/mtg/Android/project.properties +++ b/projects/mtg/Android/project.properties @@ -11,4 +11,4 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-29 +target=android-16 diff --git a/projects/mtg/bin/Res/sets/primitives/M20.txt b/projects/mtg/bin/Res/sets/primitives/M20.txt index 18068ee7f..1ed85fd2e 100644 --- a/projects/mtg/bin/Res/sets/primitives/M20.txt +++ b/projects/mtg/bin/Res/sets/primitives/M20.txt @@ -1306,7 +1306,6 @@ mana={1}{G}{G}{G} type=Legendary Planeswalker subtype=Vivien [/card] - [card] name=Sorin's Guide auto=may moveto(myhand) target(Sorin, Vampire Lord|mylibrary) diff --git a/projects/mtg/bin/Res/sets/primitives/MH1.txt b/projects/mtg/bin/Res/sets/primitives/MH1.txt index 17c9b736c..3dac6067a 100644 --- a/projects/mtg/bin/Res/sets/primitives/MH1.txt +++ b/projects/mtg/bin/Res/sets/primitives/MH1.txt @@ -20,6 +20,7 @@ subtype=Sliver power=2 toughness=2 [/card] +[card] name=Goblin Champion abilities=haste,exalted text=Haste -- Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) @@ -1783,3 +1784,84 @@ mana={1}{W} type=Enchantment subtype=Aura [/card] +[card] +name=Frostwalk Bastion +auto={T}:add{1} +auto={1}{i}:becomes(Creature Construct,2/3) ueot +text={T}: Add {1}. -- {1} {Snow}: Until end of turn, Frostwalk Bastion becomes a 2/3 Construct artifact creature. It's still a land. ( Snow can be paid with one mana from a snow permanent.) -- Whenever Frostwalk Bastion deals combat damage to a creature, tap that creature and it doesn't untap during its controller's next untap step. +type=Snow Land +[/card] +[card] +name=Echo of Eons +flashback={2}{U} +auto=ability$! moveto(mylibrary) all(*|myhand,mygraveyard) !$ controller +auto=ability$! moveto(mylibrary) all(*|myhand,mygraveyard) !$ opponent +auto=shuffle all(player) +auto=ability$! if type(*|mylibrary)~morethan~6 then may draw:7 _ if type(*|mylibrary)~morethan~5 then may draw:6 _ if type(*|mylibrary)~morethan~4 then may draw:5 _ if type(*|mylibrary)~morethan~3 then may draw:4 _ if type(*|mylibrary)~morethan~2 then may draw:3 _ if type(*|mylibrary)~morethan~1 then may draw:2 _ if type(*|mylibrary)~morethan~0 then may draw:1 !$ opponent +auto=ability$! if type(*|mylibrary)~morethan~6 then may draw:7 _ if type(*|mylibrary)~morethan~5 then may draw:6 _ if type(*|mylibrary)~morethan~4 then may draw:5 _ if type(*|mylibrary)~morethan~3 then may draw:4 _ if type(*|mylibrary)~morethan~2 then may draw:3 _ if type(*|mylibrary)~morethan~1 then may draw:2 _ if type(*|mylibrary)~morethan~0 then may draw:1 !$ controller +text=Each player shuffles their hand and graveyard into their library, then draws seven cards. -- Flashback {2}{U} (You may cast this card from your graveyard for its flashback cost. Then exile it.) +mana={4}{U}{U} +type=Sorcery +[/card] +[card] +name=Chillerpillar +auto=this(cantargetcard(*[-monstrous]) {4}{i}{i}:becomes(monstrous) forever && counter(1/1,2) && transforms((,newability[flying])) forever +text={4}{S{i}{S{i}: Monstrosity 2. (If this creature isn't monstrous, put two +1/+1 counters on it and it becomes monstrous. Snow can be paid with one mana from a snow permanent.) -- As long as Chillerpillar is monstrous, it has flying. +mana={3}{U} +type=Snow Creature +subtype=Insect +power=3 +toughness=3 +[/card] +[card] +name=Arcum's Astrolabe +other={i} +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} +text=(Snow can be paid with one mana from a snow permanent.) -- When Arcum's Astrolabe enters the battlefield, draw a card. -- {1}, {T}: Add one mana of any color. +mana={9999} +type=Snow Artifact +[/card] +[card] +name=Icehide Golem +other={i} +text=(Snow can be paid with one mana from a snow permanent.) +mana={9999} +type=Snow Artifact Creature +subtype=Golem +power=2 +toughness=2 +[/card] +[card] +name=Marit Lage's Slumber +auto=scry:1 scrycore delayed dontshow donothing scrycoreend scryend +auto=@movedTo(*[snow]|mybattlefield):scry:1 scrycore delayed dontshow donothing scrycoreend scryend +@each my upkeep restriction{type(*[snow]|myBattlefield)~morethan~9}:may sacrifice all(this) && token(Avatar,creature Avatar,20/20,black,flying,indestructible) controller +text=Whenever Marit Lage's Slumber or another snow permanent enters the battlefield under your control, scry 1. -- At the beginning of your upkeep, if you control ten or more snow permanents, sacrifice Marit Lage's Slumber. If you do, create Marit Lage, a legendary 20/20 black Avatar creature token with flying and indestructible. +mana={1}{U} +type=Legendary Snow Enchantment +[/card] +[card] +name=Frostwalla +auto={i}:2/2 ueot limit:1 +text={S{i}: Frostwalla gets +2/+2 until end of turn. Activate this ability only once each turn. ( Snow can be paid with one mana from a snow permanent.) +mana={2}{G} +type=Snow Creature +subtype=Lizard +power=2 +toughness=2 +[/card] +[card] +name=Seasoned Pyromancer +auto=draw:2 &&2ability$! reject notatarget(<2>*|myhand) and!( if cantargetcard(*[-land]|*) then token(Elemental,creature Elemental,1/1,red) all(abilitycontroller) oneshot )! !$ targetedplayer +auto={3}{R}{R}{E(this|mygraveyard)}:token(Elemental,creature Elemental,1/1,red)*2 +text=When Seasoned Pyromancer enters the battlefield, discard two cards, then draw two cards. For each nonland card discarded this way, create a 1/1 red Elemental creature token. -- {3}{R}{R}, Exile Seasoned Pyromancer from your graveyard: Create two 1/1 red Elemental creature tokens. +mana={1}{R}{R} +type=Creature +subtype=Human Shaman +power=2 +toughness=2 +[/card] \ No newline at end of file diff --git a/projects/mtg/bin/Res/sets/primitives/MH1_unsupported.txt b/projects/mtg/bin/Res/sets/primitives/MH1_unsupported.txt index a2df0d593..2a01c9ba7 100644 --- a/projects/mtg/bin/Res/sets/primitives/MH1_unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/MH1_unsupported.txt @@ -1,12 +1,5 @@ grade=unsupported [card] -name=Frostwalk Bastion -auto={T}:add{1} -text={T}: Add {1}. -- {1} {Snow}: Until end of turn, Frostwalk Bastion becomes a 2/3 Construct artifact creature. It's still a land. ( Snow can be paid with one mana from a snow permanent.) -- Whenever Frostwalk Bastion deals combat damage to a creature, tap that creature and it doesn't untap during its controller's next untap step. -type=Snow Land -[/card] -[card] -[card] name=Force of Rage text=If it's not your turn, you may exile a red card from your hand rather than pay this spell's mana cost. -- Create two 3/1 red Elemental creature tokens with trample and haste. Sacrifice those tokens at the beginning of your next upkeep. mana={1}{R}{R} @@ -19,12 +12,6 @@ mana={1}{U} type=Instant [/card] [card] -name=Echo of Eons -text=Each player shuffles their hand and graveyard into their library, then draws seven cards. -- Flashback {2}{U} (You may cast this card from your graveyard for its flashback cost. Then exile it.) -mana={4}{U}{U} -type=Sorcery -[/card] -[card] name=Eyekite abilities=flying text=Flying -- Eyekite gets +2/+0 as long as you've drawn two or more cards this turn. @@ -35,30 +22,6 @@ power=1 toughness=2 [/card] [card] -name=Chillerpillar -text={4}{Snow}{Snow}: Monstrosity 2. (If this creature isn't monstrous, put two +1/+1 counters on it and it becomes monstrous. Snow can be paid with one mana from a snow permanent.) -- As long as Chillerpillar is monstrous, it has flying. -mana={3}{U} -type=Snow Creature -subtype=Insect -power=3 -toughness=3 -[/card] -[card] -name=Arcum's Astrolabe -text=(Snow can be paid with one mana from a snow permanent.) -- When Arcum's Astrolabe enters the battlefield, draw a card. -- {1}, {T}: Add one mana of any color. -mana={Snow} -type=Snow Artifact -[/card] -[card] -name=Icehide Golem -text=(Snow can be paid with one mana from a snow permanent.) -mana={Snow} -type=Snow Artifact Creature -subtype=Golem -power=2 -toughness=2 -[/card] -[card] name=Throatseeker text=Unblocked attacking Ninjas you control have lifelink. mana={2}{B} @@ -112,7 +75,7 @@ toughness=1 [/card] [card] name=Urza, Lord High Artificer -text=When Urza, Lord High Artificer enters the battlefield, create a 0/0 colorless Construct artifact creature token with "This creature gets +1/+1 for each artifact you control." -- Tap an untapped artifact you control: Add -- {U} -- . -- 5 : Shuffle your library, then exile the top card. Until end of turn, you may play that card without paying its mana cost. +text=When Urza, Lord High Artificer enters the battlefield, create a 0/0 colorless Construct artifact creature token with "This creature gets +1/+1 for each artifact you control." -- Tap an untapped artifact you control: Add {U}. -- {5}: Shuffle your library, then exile the top card. Until end of turn, you may play that card without paying its mana cost. mana={2}{U}{U} type=Legendary Creature subtype=Human Artificer @@ -177,7 +140,7 @@ subtype=Wrenn [card] name=Unsettled Mariner abilities=changeling -aauto=@targeted(*|mybattlefield) from(*|opponentbattlefield,opponenthand,opponentstack,opponentgraveyard,opponentexile,opponentlibrary):transforms((,newability[pay[[{1}]] name(pay 1 mana) donothing?fizzle])) forever +auto=@targeted(*|mybattlefield) from(*|opponentbattlefield,opponenthand,opponentstack,opponentgraveyard,opponentexile,opponentlibrary):transforms((,newability[pay[[{1}]] name(pay 1 mana) donothing?fizzle])) forever text=Changeling (This card is every creature type.) -- Whenever you or a permanent you control becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays {1}. mana={W}{U} type=Creature @@ -206,12 +169,6 @@ mana={2}{U} type=Enchantment [/card] [card] -name=Marit Lage's Slumber -text=Whenever Marit Lage's Slumber or another snow permanent enters the battlefield under your control, scry 1. -- At the beginning of your upkeep, if you control ten or more snow permanents, sacrifice Marit Lage's Slumber. If you do, create Marit Lage, a legendary 20/20 black Avatar creature token with flying and indestructible. -mana={1}{U} -type=Legendary Snow Enchantment -[/card] -[card] name=On Thin Ice text=Enchant snow land you control -- When On Thin Ice enters the battlefield, exile target creature an opponent controls until On Thin Ice leaves the battlefield. mana={W} @@ -241,28 +198,8 @@ mana={U} type=Sorcery [/card] [card] -name=Frostwalla -text={Snow}: Frostwalla gets +2/+2 until end of turn. Activate this ability only once each turn. ( Snow can be paid with one mana from a snow permanent.) -mana={2}{G} -type=Snow Creature -subtype=Lizard -power=2 -toughness=2 -[/card] -[card] name=Tectonic Reformation text=Each land card in your hand has cycling {R}. -- Cycling {2} ({2}, Discard this card: Draw a card.) mana={1}{R} type=Enchantment -[/card] -[card] -name=Seasoned Pyromancer -auto=draw:2 -auto=reject target(<2>*|myhand) -text=When Seasoned Pyromancer enters the battlefield, discard two cards, then draw two cards. For each nonland card discarded this way, create a 1/1 red Elemental creature token. -- [3}{R}{R}, Exile Seasoned Pyromancer from your graveyard: Create two 1/1 red Elemental creature tokens. -mana={1}{R}{R} -type=Creature -subtype=Human Shaman -power=2 -toughness=2 [/card] \ No newline at end of file diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 51166763e..8e2b7da75 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -3341,7 +3341,7 @@ type=Sorcery [/card] [card] name=Cover of Winter -text=Cumulative upkeep {S} (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. {S} can be paid with one mana from a snow permanent.) -- If a creature would deal combat damage to you and/or one or more creatures you control, prevent X of that damage, where X is the number of age counters on Cover of Winter. -- {S}: Put an age counter on Cover of Winter. +text=Cumulative upkeep {S{i} (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. {S{i} can be paid with one mana from a snow permanent.) -- If a creature would deal combat damage to you and/or one or more creatures you control, prevent X of that damage, where X is the number of age counters on Cover of Winter. -- {S{i}: Put an age counter on Cover of Winter. mana={2}{W} type=Snow Enchantment [/card] @@ -6656,7 +6656,7 @@ type=Instant [/card] [card] name=Glacial Plating -text=Enchant creature -- Cumulative upkeep {S} (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. {S} can be paid with one mana from a snow permanent.) -- Enchanted creature gets +3/+3 for each age counter on Glacial Plating. +text=Enchant creature -- Cumulative upkeep {S{i} (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. {S{i} can be paid with one mana from a snow permanent.) -- Enchanted creature gets +3/+3 for each age counter on Glacial Plating. mana={2}{W}{W} type=Snow Enchantment subtype=Aura @@ -14574,7 +14574,7 @@ type=Sorcery [card] name=Rimehorn Aurochs abilities=trample -text=Trample -- Whenever Rimehorn Aurochs attacks, it gets +1/+0 until end of turn for each other attacking Aurochs. -- {2}{S}: Target creature blocks target creature this turn if able. ({S} can be paid with one mana from a snow permanent.) +text=Trample -- Whenever Rimehorn Aurochs attacks, it gets +1/+0 until end of turn for each other attacking Aurochs. -- {2}{S{i}: Target creature blocks target creature this turn if able. ({S{i} can be paid with one mana from a snow permanent.) mana={4}{G} type=Snow Creature subtype=Aurochs diff --git a/projects/mtg/include/Wagic_Version.h b/projects/mtg/include/Wagic_Version.h index 103413ecd..62e70ff91 100644 --- a/projects/mtg/include/Wagic_Version.h +++ b/projects/mtg/include/Wagic_Version.h @@ -31,3 +31,5 @@ Author: Michael Nguyen #define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME #endif + + diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp index 589d69358..26c781988 100644 --- a/projects/mtg/src/ExtraCost.cpp +++ b/projects/mtg/src/ExtraCost.cpp @@ -189,39 +189,40 @@ int SnowCost::doPay() result += source->controller()->snowManaC; if (result) { + // Avoided double payments for Snow Mana cost if (source->controller()->snowManaC && source->controller()->getManaPool()->canAfford(ManaCost::parseManaCost("{1}",NULL,source))) { - source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{1}",NULL,source)); + //source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{1}",NULL,source)); source->controller()->snowManaC -= 1; } else if (source->controller()->snowManaG && source->controller()->getManaPool()->canAfford(ManaCost::parseManaCost("{g}",NULL,source))) { - source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{g}",NULL,source)); + //source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{g}",NULL,source)); source->controller()->snowManaG -= 1; } else if (source->controller()->snowManaU && source->controller()->getManaPool()->canAfford(ManaCost::parseManaCost("{u}",NULL,source))) { - source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{u}",NULL,source)); + //source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{u}",NULL,source)); source->controller()->snowManaU -= 1; } else if (source->controller()->snowManaR && source->controller()->getManaPool()->canAfford(ManaCost::parseManaCost("{r}",NULL,source))) { - source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{r}",NULL,source)); + //source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{r}",NULL,source)); source->controller()->snowManaR -= 1; } else if (source->controller()->snowManaB && source->controller()->getManaPool()->canAfford(ManaCost::parseManaCost("{b}",NULL,source))) { - source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{b}",NULL,source)); + //source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{b}",NULL,source)); source->controller()->snowManaB -= 1; } else if (source->controller()->snowManaW && source->controller()->getManaPool()->canAfford(ManaCost::parseManaCost("{w}",NULL,source))) { - source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{w}",NULL,source)); + //source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{w}",NULL,source)); source->controller()->snowManaW -= 1; } else if (source->controller()->snowManaC && source->controller()->getManaPool()->canAfford(ManaCost::parseManaCost("{c}",NULL,source))) { - source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{c}",NULL,source)); + //source->controller()->getManaPool()->pay(ManaCost::parseManaCost("{c}",NULL,source)); source->controller()->snowManaC -= 1; } else diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index fac5555ba..74b2c0b69 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -1406,6 +1406,9 @@ bool GameObserver::WaitForExtraPayment(MTGCardInstance * card) mExtraPayment = NULL; } result = true; + // Avoid game stucks on current phase till snow mana cost will be paid + if(mExtraPayment && mExtraPayment->costs.size() == 1 && !strcmp(mExtraPayment->costs[0]->mCostRenderString.c_str(), "Snow Mana")) + result = false; } return result;