diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index e869f05b4..690b05673 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 21-05-2023 +#I sorted this programmatically - Thanks to Vitty85 22-05-2023 [card] name=+2 Mace auto={3}:equip @@ -10920,7 +10920,7 @@ type=Sorcery name=Brimaz, Blight of Oreskos auto=@movedTo(creature[artifact]|mystack):name(Incubate X) name(Incubate X) all(trigger[to]) transforms((,newability[name(Incubate X) name(Incubate X) activate castcard(noevent costx!:manacost:! named!:Incubator:!)])) oneshot auto=@movedTo(creature[-artifact&phyrexian]|mystack):name(Incubate X) name(Incubate X) all(trigger[to]) transforms((,newability[name(Incubate X) name(Incubate X) activate castcard(noevent costx!:manacost:! named!:Incubator:!)])) oneshot -auto=@movedTo(phyrexian|graveyard) from(mybattlefield):name(Proliferate) _PROLIFERATE_ +auto=@movedTo(phyrexian|graveyard) from(mybattlefield):name(Phyrexian died) transforms((,newability[@each endofturn:name(Proliferate) _PROLIFERATE_])) ueot text=Whenever you cast a Phyrexian creature or artifact creature spell, incubate X, where X is that spell's mana value. (Create an Incubator token with X +1/+1 counters on it and "{2}: Transform this artifact." It transforms into a 0/0 Phyrexian artifact creature.) -- At the beginning of each end step, if a Phyrexian died under your control this turn, proliferate. mana={2}{W}{B} type=Legendary Creature @@ -75762,7 +75762,7 @@ auto=if type(*|opponentgraveyard)~morethan~7 then if type(other *[instant;sorcer auto=if type(*|opponentgraveyard)~lessthan~8 then if type(*[-instant;-sorcery]|stack)~morethan~0 then choice name(Copy permanent spell) name(Copy permanent spell) name(Copy permanent spell) ability$!name(Copy permanent spell) name(Copy permanent spell) name(Copy permanent spell) target(*[-instant;-sorcery]|stack) clone!$ controller auto=if type(*|opponentgraveyard)~lessthan~8 then if type(other *[instant;sorcery]|stack)~morethan~0 then choice name(Copy non-permanent spell) name(Copy non-permanent spell) name(Copy non-permanent spell) ability$!name(Copy non-permanent spell) name(Copy non-permanent spell) name(Copy non-permanent spell) target(other *[instant;sorcery]|stack) activate castcard(copied noevent)!$ controller auto=if type(*|opponentgraveyard)~lessthan~8 then if type(creature|battlefield)~morethan~0 then choice name(Copy creature) name(Copy creature) name(Copy creature) ability$!name(Copy creature) name(Copy creature) name(Copy creature) target(creature|battlefield) clone!$ controller -text=This spell can't be copied. -- Choose one. If an opponent has eight or more cards in their graveyard, you may choose both. -- - Copy target spell. You may choose new targets for the copy. (A copy of a permanent spell becomes a token.) -- - Create a token that's a copy of target creature. +text=This spell can't be copied. -- Choose one. If an opponent has eight or more cards in their graveyard, you may choose both. -- Copy target spell. You may choose new targets for the copy. (A copy of a permanent spell becomes a token.) -- Create a token that's a copy of target creature. mana={2}{U}{U} type=Instant [/card] @@ -85145,7 +85145,7 @@ name=Sunder the Gateway auto=if type(artifact[-token]|opponentbattlefield)~morethan~0 then choice name(Destroy artifact and incubate 2) name(Destroy artifact and incubate 2) target(artifact[-token]|opponentbattlefield) destroy and!( activate castcard(noevent costx!:2:! named!:Incubator:!) )! auto=if type(enchantment|opponentbattlefield)~morethan~0 then choice name(Destroy enchantment and incubate 2) name(Destroy enchantment and incubate 2) target(enchantment|opponentbattlefield) destroy and!( activate castcard(noevent costx!:2:! named!:Incubator:!) )! auto=choice name(Incubate 2 and transform) name(Incubate 2 and transform) emblem transforms((,newability[name(Incubate 2) name(Incubate 2) activate castcard(noevent costx!:2:! named!:Incubator:!)],newability[@movedto(incubator|mybattlefield) turnlimited:name(Choose incubator) name(Choose incubator) target(incubator|mybattlefield) flip(backside)])) ueot -text=Choose one -- Destroy target nontoken artifact or enchantment an opponent controls. Incubate 2. (Create an Incubator token with two +1/+1 counters on it and "{2}: Transform this artifact." It transforms into a 0/0 Phyrexian artifact creature.) ---Incubate 2, then transform an Incubator token you control. +text=Choose one -- Destroy target nontoken artifact or enchantment an opponent controls. Incubate 2. (Create an Incubator token with two +1/+1 counters on it and "{2}: Transform this artifact." It transforms into a 0/0 Phyrexian artifact creature.) -- Incubate 2, then transform an Incubator token you control. mana={1}{W} type=Sorcery [/card] diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 47f951d79..92d2c7f7e 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -2,7 +2,7 @@ grade=unsupported #The cards in this file are not implemented/incomplete yet. #Updated Card lists not in primitives (Borderline, Crappy, Unsupported and Missing Cards) #Please keep these card alphabetized, and try to have the "name=" line at the top of each card -#I sorted this programatically - Vitty85 20-05-2023 +#I sorted this programatically - Vitty85 22-05-2023 [card] name="Ach! Hans, Run!" text=At the beginning of your upkeep, you may say "Ach Hans, run It's the . . ." and name a creature card. If you do, search your library for the named card, put it into play, then shuffle your library. That creature has haste. Remove it from the game at end of turn. @@ -2318,6 +2318,12 @@ mana={3}{U} type=Instant [/card] [card] +name=Deification +text=As Deification enters the battlefield, choose a planeswalker type. -- Planeswalkers you control of the chosen type have hexproof. -- As long as you control a creature, if damage dealt to a planeswalker you control of the chosen type would result in all loyalty counters on it being removed, instead all but one of those counters are removed. +mana={1}{W} +type=Enchantment +[/card] +[card] name=Delay text=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.) mana={1}{U} diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index e7433cd99..961e16ecc 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -468,7 +468,7 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe check = restriction[i].find("deadpermanent"); if(check != string::npos) { - bool isMorbid = false; + bool deadpermanent = false; for(int cp = 0;cp < 2;cp++) { Player * checkCurrent = observer->players[cp]; @@ -481,20 +481,20 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe (checkCard->previousZone == checkCurrent->opponent()->game->battlefield))//died from battlefield ) { - isMorbid = true; + deadpermanent = true; break; } } - if(isMorbid) + if(deadpermanent) break; } - if(!isMorbid) + if(!deadpermanent) return 0; } check = restriction[i].find("deadcreart"); if(check != string::npos) { - bool isMorbid = false; + bool deadcreart = false; for(int cp = 0;cp < 2;cp++) { Player * checkCurrent = observer->players[cp]; @@ -507,14 +507,41 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe (checkCard->previousZone == checkCurrent->opponent()->game->battlefield))//died from battlefield ) { - isMorbid = true; + deadcreart = true; break; } } - if(isMorbid) + if(deadcreart) break; } - if(!isMorbid) + if(!deadcreart) + return 0; + } + check = restriction[i].find("hasdead"); + if(check != string::npos) + { + bool hasdeadtype = false; + string checktype = restriction[i].substr(7); + for(int cp = 0;cp < 2;cp++) + { + Player * checkCurrent = observer->players[cp]; + MTGGameZone * grave = checkCurrent->game->graveyard; + for(unsigned int gy = 0;gy < grave->cardsSeenThisTurn.size();gy++) + { + MTGCardInstance * checkCard = grave->cardsSeenThisTurn[gy]; + if(checkCard->hasType(checktype) && + ((checkCard->previousZone == checkCurrent->game->battlefield)|| + (checkCard->previousZone == checkCurrent->opponent()->game->battlefield))//died from battlefield + ) + { + hasdeadtype = true; + break; + } + } + if(hasdeadtype) + break; + } + if(!hasdeadtype) return 0; } check = restriction[i].find("zerodead"); diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index a2d071a26..90531ba01 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -577,21 +577,14 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone if(card->name == copy->name && !card->hasType(Subtypes::TYPE_LEGENDARY) && copy->hasType(Subtypes::TYPE_LEGENDARY)) // This fix issue when cloning a card with nolegend option (e.g. Double Major) copy->removeType(Subtypes::TYPE_LEGENDARY); - // This fix issue types problem when card change zone with different card types than its original version (e.g. double face cards). + // This fix issue types problem when card change zone with different card types than its original version (e.g. double face cards or cards that gained new types before to change zone). std::vector realTypes; string originame = copy->name; - if(doCopy && !asCopy && !inplaytoinplay){ - for (int i = ((int)copy->types.size())-1; i >= 0; --i){ - realTypes.push_back(copy->types[i]); - copy->removeType(copy->types[i]); - } - copy->name = originame; - for (int i = 0; i < ((int)card->types.size()); i++) - copy->addType(card->types[i]); - if(copy->types[0] == 1 && copy->types[1] == 7){ // Fix order for Legendary Creatures - copy->types[0] = 7; - copy->types[1] = 1; - } + if(doCopy && !asCopy && !inplaytoinplay && !equal(copy->types.begin(), copy->types.end(), card->types.begin()) ){ + realTypes = copy->types; + copy->types = card->types; + if(copy->name == "") + copy->name = originame; copy->mPropertiesChangedSinceLastUpdate = false; } @@ -808,16 +801,11 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone // Reset original types when card change zone with different card types than its original version (e.g. double face cards). if(doCopy && !inplaytoinplay && realTypes.size()){ - copy->types.clear(); - for (int i = ((int)realTypes.size())-1; i >= 0; i--) - copy->addType(realTypes[i]); - if(copy->types[0] == 1 && copy->types[1] == 7){ // Fix order for Legendary Creatures - copy->types[0] = 7; - copy->types[1] = 1; - } - copy->name = originame; - copy->mPropertiesChangedSinceLastUpdate = false; + copy->types = realTypes; realTypes.clear(); + if(copy->name == "") + copy->name = originame; + copy->mPropertiesChangedSinceLastUpdate = false; } // Erasing counters from copy after the event has been triggered (no counter can survive to a zone changing except the perpetual ones)