From afb98a374c9287feec5c61dca5950ad51375d8a3 Mon Sep 17 00:00:00 2001 From: zethfoxster Date: Wed, 27 Jul 2016 19:58:32 -0400 Subject: [PATCH 1/2] updated codes for changes --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 34 +++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 6d950a954..72aeee3d2 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -7356,6 +7356,7 @@ toughness=2 [/card] [card] name=Azamuki, Treachery Incarnate +doublefaced=kamiflip auto={C(0/0,-1,Ki)}:target(creature) transforms((,newability[moveTo(opponentbattlefield)],newability[phaseaction[endofturn sourceinplay] moveTo(ownerbattlefield)])) ueot text=Remove a ki counter from Azamuki, Treachery Incarnate: Gain control of target creature until end of turn. color=red @@ -14349,6 +14350,7 @@ type=Artifact [/card] [card] name=Budoka Gardener +doublefaced=kamiflip auto={T}:all(this) transforms((,newability[if type(land|mybattlefield)~morethan~9 then flip(Dokai, Weaver of Life)],newability[may moveto(mybattlefield) notatarget(land|myhand)],newability[@movedto(land|mybattlefield) restriction{type:land:mybattlefield~morethan~9}:flip(Dokai, Weaver of Life)])) text={T}: You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip Budoka Gardener. mana={1}{G} @@ -14359,6 +14361,7 @@ toughness=1 [/card] [card] name=Budoka Pupil +doublefaced=kamiflip auto=@movedTo(spirit,arcane|mystack):may counter(0/0,1,Ki) auto=@each endofturn:this(counter{0/0.2.Ki}) flip(Ichiga, Who Topples Oaks) text=Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Budoka Pupil. -- At the beginning of the end step, if there are two or more ki counters on Budoka Pupil, you may flip it. -- ---- -- Ichiga, Who Topples Oaks -- Legendary Creature - Spirit -- 4/3 -- Trample -- Remove a ki counter from Ichiga, Who Topples Oaks: Target creature gets +2/+2 until end of turn. @@ -14743,6 +14746,7 @@ type=Instant [/card] [card] name=Bushi Tenderfoot +doublefaced=kamiflip auto=@vampired(creature) from(this):all(trigger[from]) flip(Kenzo the Hardhearted) text=When a creature dealt damage by Bushi Tenderfoot this turn is put into a graveyard, flip Bushi Tenderfoot. mana={W} @@ -15304,6 +15308,7 @@ toughness=3 [/card] [card] name=Callow Jushi +doublefaced=kamiflip auto=@movedTo(spirit,arcane|mystack):may counter(0/0,1,Ki) auto=@each endofturn:this(counter{0/0.2.Ki}) may flip(Jaraku the Interloper) text=Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Callow Jushi. -- At the beginning of the end step, if there are two or more ki counters on Callow Jushi, you may flip it. @@ -22914,6 +22919,7 @@ toughness=1 [/card] [card] name=Cunning Bandit +doublefaced=kamiflip auto=@movedTo(spirit,arcane|mystack):may counter(0/0,1,Ki) auto=@each endofturn:this(counter{0/0.2.Ki}) flip(Azamuki, Treachery Incarnate) text=Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Cunning Bandit. -- At the beginning of the end step, if there are two or more ki counters on Cunning Bandit, you may flip it. -- ---- -- Azamuki, Treachery Incarnate -- Legendary Creature - Spirit -- 5/2 -- Remove a ki counter from Azamuki, Treachery Incarnate: Gain control of target creature until end of turn. @@ -28101,6 +28107,7 @@ type=Instant [/card] [card] name=Dokai, Weaver of Life +doublefaced=kamiflip auto={4}{G}{G}{T}:token(Elemental,Creature Elemental,type:land:mybattlefield/type:land:mybattlefield,green) controller text={4}{G}{G}, {T}: Put an X/X green Elemental creature token onto the battlefield, where X is the number of lands you control. mana={1}{G} @@ -33816,6 +33823,7 @@ type=Instant [/card] [card] name=Erayo, Soratami Ascendant +doublefaced=kamiflip abilities=flying auto=@movedto(*|stack) restriction{thisturn(*|stack)~equalto~3}:flip(Erayo's Essence) text=Flying -- Whenever the fourth spell of a turn is cast, flip Erayo, Soratami Ascendant. @@ -33827,6 +33835,7 @@ toughness=1 [/card] [card] name=Erayo's Essence +doublefaced=kamiflip auto=@movedto(*[-land]|opponentstack) restriction{thisturn(*[-land]|opponentstack)~equalto~0}:all(trigger[to]) transforms((,newability[fizzle])) forever text=Whenever an opponent casts a spell for the first time in a turn, counter that spell. mana={1}{U} @@ -35567,6 +35576,7 @@ toughness=1 [/card] [card] name=Faithful Squire +doublefaced=kamiflip auto=@movedTo(spirit,arcane|mystack):may counter(0/0,1,Ki) auto=@each endofturn:this(counter{0/0.2.Ki}) flip(Kaiso, Memory of Loyalty) text=Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Faithful Squire. -- At the beginning of the end step, if there are two or more ki counters on Faithful Squire, you may flip it. @@ -50401,6 +50411,7 @@ toughness=4 name=Hired Muscle auto=@movedTo(spirit,arcane|mystack):may counter(0/0,1,Ki) auto=@each endofturn:this(counter{0/0.2.Ki}) flip(Scarmaker) +doublefaced=kamiflip text=Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Hired Muscle. -- At the beginning of the end step, if there are two or more ki counters on Hired Muscle, you may flip it. -- ---- -- Scarmaker -- Legendary Creature - Spirit -- 4/4 -- Remove a ki counter from Scarmaker: Target creature gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.) mana={1}{B}{B} type=Creature @@ -50806,6 +50817,7 @@ type=Instant [/card] [card] name=Homura, Human Ascendant +doublefaced=kamiflip abilities=cantblock auto=@movedTo(this|graveyard) from(battlefield):all(trigger[to]) transforms((,newability[moveTo(mybattlefield)],newability[flip(Homura's Essence)])) text=Homura, Human Ascendant can't block. -- When Homura is put into a graveyard from the battlefield, return it to the battlefield flipped. @@ -50817,6 +50829,7 @@ toughness=4 [/card] [card] name=Homura's Essence +doublefaced=kamiflip auto=lord(creature|mybattlefield) 2/2 auto=lord(creature|mybattlefield) flying auto=lord(creature|mybattlefield) {R}:1/0 @@ -52448,6 +52461,7 @@ type=Sorcery [/card] [card] name=Ichiga, Who Topples Oaks +doublefaced=kamiflip abilities=trample auto={C(0/0,-1,Ki)}:2/2 target(creature) ueot text=Trample -- Remove a ki counter from Ichiga, Who Topples Oaks: Target creature gets +2/+2 until end of turn. @@ -55204,6 +55218,7 @@ type=Sorcery [/card] [card] name=Jaraku the Interloper +doublefaced=kamiflip auto={C(0/0,-1,Ki)}:name(counter spell) target(*|stack) transforms((,newability[pay[[{2}]] name(pay 2 mana) donothing?fizzle])) forever text=Remove a ki counter from Jaraku the Interloper: Counter target spell unless its controller pays {2}. color=blue @@ -56233,6 +56248,7 @@ toughness=3 [/card] [card] name=Jushi Apprentice +doublefaced=kamiflip auto={2}{U}{T}:draw:1 controller restriction{type(*|myhand)~lessthan~8} auto={2}{U}{T}:draw:1 controller && flip(Tomoya the Revealer) restriction{type(*|myhand)~morethan~7} text={2}{U}, {T}: Draw a card. If you have nine or more cards in hand, flip Jushi Apprentice. @@ -56460,6 +56476,7 @@ abilities=defender [/card] [card] name=Kaiso, Memory of Loyalty +doublefaced=kamiflip abilities=flying auto={C(0/0,-1,Ki)}:prevent:999 target(creature) text=Flying -- Remove a ki counter from Kaiso, Memory of Loyalty: Prevent all damage that would be dealt to target creature this turn. @@ -57700,6 +57717,7 @@ toughness=3 [/card] [card] name=Kenzo the Hardhearted +doublefaced=kamiflip abilities=double strike auto=bushido(2/2) text=Double strike; bushido 2 (When this blocks or becomes blocked, it gets +2/+2 until end of turn.) @@ -60081,6 +60099,7 @@ toughness=3 [/card] [card] name=Kuon, Ogre Ascendant +doublefaced=kamiflip auto=@each my endofturn restriction{type(creature[fresh]|graveyard)~morethan~2}:flip(Kuon's Essence) text=At the beginning of the end step, if three or more creatures were put into graveyards from the battlefield this turn, flip Kuon, Ogre Ascendant. mana={B}{B}{B} @@ -60091,6 +60110,7 @@ toughness=4 [/card] [card] name=Kuon's Essence +doublefaced=kamiflip auto=@each opponent upkeep:ability$!choice notatarget(creature|mybattlefield) sacrifice !$ opponent auto=@each my upkeep:notatarget(creature|mybattlefield) sacrifice text=At the beginning of each player's upkeep, that player sacrifices a creature. @@ -68962,7 +68982,7 @@ toughness=1 [/card] [card] name=Mirror Gallery -auto=lord(*|battlefield) nolegend +auto=lord(*|battlefield) legendruleremove text=The "legend rule" doesn't apply. mana={5} type=Artifact @@ -73479,6 +73499,7 @@ toughness=1 [/card] [card] name=Nezumi Graverobber +doublefaced=kamiflip auto={1}{B}:target(*|opponentgraveyard) moveTo(exile) restriction{type(*|opponentgraveyard)~morethan~1} auto={1}{B}:target(*|opponentgraveyard) moveTo(exile) && all(this) flip(Nighteyes the Desecrator) restriction{type(*|opponentgraveyard)~lessthan~2} text={1}{B}: Exile target card from an opponent's graveyard. If no cards are in that graveyard, flip Nezumi Graverobber. @@ -73510,6 +73531,7 @@ toughness=1 [/card] [card] name=Nezumi Shortfang +doublefaced=kamiflip auto={1}{B}{T}:name(target opponent discard) target(opponent) deplete:0 && all(this) transforms((,newability[if type(*|opponenthand)~lessthan~1 then flip(Stabwhisker the Odious)],newability[ability$!reject notatarget(*|myhand)!$ targetedplayer],newability[@discarded(*|opponenthand) restriction{compare(ohandcount)~equalto~1} once:flip(Stabwhisker the Odious)])) text={1}{B}, {T}: Target opponent discards a card. Then if that player has no cards in hand, flip Nezumi Shortfang. mana={1}{B} @@ -73676,6 +73698,7 @@ type=Instant [/card] [card] name=Nighteyes the Desecrator +doublefaced=kamiflip auto={4}{B}:moveTo(myBattlefield) target(creature|graveyard) text={4}{B}: Put target creature card in a graveyard onto the battlefield under your control. color=black @@ -77023,6 +77046,7 @@ toughness=2 [/card] [card] name=Orochi Eggwatcher +doublefaced=kamiflip auto={2}{G}{T}:token(Snake,Creature Snake,1/1,green) restriction{type(creature|mybattlefield)~lessthan~9} auto={2}{G}{T}:token(Snake,Creature Snake,1/1,green) && flip(Shidako, Broodmistress) restriction{type(creature|mybattlefield)~morethan~8} text={2}{G}, {T}: Put a 1/1 green Snake creature token onto the battlefield. If you control ten or more creatures, flip Orochi Eggwatcher. @@ -90190,6 +90214,7 @@ toughness=6 [/card] [card] name=Rune-Tail, Kitsune Ascendant +doublefaced=kamiflip auto=this(controllerlife > 29) transforms((,newability[flip(Rune-Tail's Essence)])) text=When you have 30 or more life, flip Rune-Tail, Kitsune Ascendant. mana={2}{W} @@ -90200,6 +90225,7 @@ toughness=2 [/card] [card] name=Rune-Tail's Essence +doublefaced=kamiflip auto=preventalldamage to(creature|mybattlefield) text=Prevent all damage that would be dealt to creatures you control. mana={2}{W} @@ -92413,6 +92439,7 @@ toughness=2 [/card] [card] name=Scarmaker +doublefaced=kamiflip auto={C(0/0,-1,Ki)}:fear target(creature) text=Remove a ki counter from Scarmaker: Target creature gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.) color=black @@ -96147,6 +96174,7 @@ toughness=3 [/card] [card] name=Shidako, Broodmistress +doublefaced=kamiflip auto={G}{S(creature|myBattlefield)}:3/3 target(creature) text={G}, Sacrifice a creature: Target creature gets +3/+3 until end of turn. color=green @@ -104309,6 +104337,7 @@ type=Instant [/card] [card] name=Stabwhisker the Odious +doublefaced=kamiflip auto=@each opponent upkeep restriction{type(*|opponenthand)~lessthan~1}:life:-3 opponent auto=@each opponent upkeep restriction{type(*|opponenthand)~equalto~1}:life:-2 opponent auto=@each opponent upkeep restriction{type(*|opponenthand)~equalto~2}:life:-1 opponent @@ -106670,6 +106699,7 @@ type=Instant [/card] [card] name=Student of Elements +doublefaced=kamiflip auto=this( cantargetcard(*[flying]) ) flip(Tobita, Master of Winds) text=When Student of Elements has flying, flip it. mana={1}{U} @@ -113326,6 +113356,7 @@ toughness=4 [/card] [card] name=Tobita, Master of Winds +doublefaced=kamiflip auto=lord(creature|myBattlefield) flying text=Creatures you control have flying. mana={1}{U} @@ -113492,6 +113523,7 @@ toughness=5 [/card] [card] name=Tomoya the Revealer +doublefaced=kamiflip auto={3}{U}{U}{T}:foreach(*|myhand) draw:1 target(player) text={3}{U}{U}, {T}: Target player draws X cards, where X is the number of cards in your hand. color=blue From eea240d7f2994444d10e29ddf0f0fe43ab009b6f Mon Sep 17 00:00:00 2001 From: zethfoxster Date: Wed, 27 Jul 2016 20:03:25 -0400 Subject: [PATCH 2/2] changing some of the logic to the previous fixes, we want to avoid using code that looks for specific card names. currently we have kamiflip as the only defined flip type as it is treated differently from the others. but we have room for more if needed now doublefaced=kamiflip sets the flip type of a card to the kamiflip style cards. since this is defined on cardprimitive level now, we might be able to do something different from the flipping animation. who knows. commented out the forcing token triggers, it bypass targetchooser check. still working on a fix for this coming soon. --- projects/mtg/include/AllAbilities.h | 4 ++-- projects/mtg/include/CardPrimitive.h | 3 +++ projects/mtg/include/GameObserver.h | 1 + projects/mtg/include/MTGDefinitions.h | 3 ++- projects/mtg/src/AllAbilities.cpp | 18 ++++++++++++++---- projects/mtg/src/CardPrimitive.cpp | 13 +++++++++++++ projects/mtg/src/ExtraCost.cpp | 6 ++---- projects/mtg/src/GameObserver.cpp | 14 ++++++++++---- projects/mtg/src/MTGAbility.cpp | 21 +-------------------- projects/mtg/src/MTGDeck.cpp | 12 ++++++++++-- projects/mtg/src/MTGDefinitions.cpp | 3 ++- projects/mtg/src/MTGRules.cpp | 6 ++++-- 12 files changed, 64 insertions(+), 40 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 0b7af43fa..d2f325e5d 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1370,8 +1370,8 @@ public: { WEventCardSacrifice * e = dynamic_cast (event); if (!e) return 0; - if (e->istoken) - return 1; + //if (e->istoken) + // return 1; MTGCardInstance * check = e->cardAfter; MTGGameZone * oldZone = e->cardAfter->currentZone; check->currentZone = check->previousZone; diff --git a/projects/mtg/include/CardPrimitive.h b/projects/mtg/include/CardPrimitive.h index 8f6041baf..afcfb9604 100644 --- a/projects/mtg/include/CardPrimitive.h +++ b/projects/mtg/include/CardPrimitive.h @@ -69,6 +69,9 @@ public: int toughness; int suspendedTime; int dredgeAmount; + string doubleFaced; + void setdoubleFaced(const string& value); + const string& getdoubleFaced() const; vectortypes; CardPrimitive(); diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index 6d451a392..c8a3b8550 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -125,6 +125,7 @@ class GameObserver{ void enchantmentStatus(); void Affinity(); bool AffinityNeedsUpdate; + bool legendNeedUpdate; void addObserver(MTGAbility * observer); void checkLegendary(MTGCardInstance * card); map cards; diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index c7db25290..cd3137f39 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -256,7 +256,8 @@ class Constants SHACKLER = 134, FLYERSONLY = 135,//can attack only if it has flying TEMPFLASHBACK = 136, - NB_BASIC_ABILITIES = 137, + NOLEGENDRULE =137, + NB_BASIC_ABILITIES = 138, RARITY_S = 'S', //Special Rarity RARITY_M = 'M', //Mythics diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 63de1d89f..f7b052513 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -416,6 +416,12 @@ bool MTGRevealingCards::CheckUserInput(JButton key) { if (this->source->controller() != game->isInterrupting) game->mLayers->stackLayer()->cancelInterruptOffer(ActionStack::DONT_INTERRUPT, false); + //if (game->currentActionPlayer->isAI() && key != JGE_BTN_OK) + //{ + // key = JGE_BTN_NEXT; + // game->Update(0); + //} + } if (JGE_BTN_SEC == key || JGE_BTN_PREV == key || JGE_BTN_NEXT == key || JGE_BTN_MENU == key)//android back button { @@ -432,6 +438,7 @@ bool MTGRevealingCards::CheckUserInput(JButton key) { abilityFirst->removeFromGame(); game->mLayers->stackLayer()->Remove(abilityFirst); + abilityFirst = NULL; } game->Update(0); //remove it from the game, update, and remove it from stack if needed. @@ -723,6 +730,11 @@ bool MTGScryCards::CheckUserInput(JButton key) //in the future we will need a way to find out if the human is pressing the keys and which player. if (this->source->controller() != game->isInterrupting) game->mLayers->stackLayer()->cancelInterruptOffer(ActionStack::DONT_INTERRUPT, false); + //if (game->currentActionPlayer->isAI() && key != JGE_BTN_OK) + //{ + // key = JGE_BTN_NEXT; + // game->Update(0); + //} } if (JGE_BTN_SEC == key || JGE_BTN_PREV == key || JGE_BTN_NEXT == key || JGE_BTN_MENU == key) { @@ -2718,13 +2730,11 @@ int AASacrificeCard::resolve() Player * p = _target->controller(); MTGCardInstance * beforeCard = _target; WEvent * e; - if(!_target->isToken) - e = NEW WEventCardSacrifice(beforeCard,_target); - else - e = NEW WEventCardSacrifice(beforeCard,_target,true); p->game->putInGraveyard(_target); while(_target->next) _target = _target->next; + bool cardIsToken = _target->isToken ? true : false; + e = NEW WEventCardSacrifice(beforeCard, _target, cardIsToken); game->receiveEvent(e); if(andAbility) { diff --git a/projects/mtg/src/CardPrimitive.cpp b/projects/mtg/src/CardPrimitive.cpp index bddc43ed4..30c5c2e5f 100644 --- a/projects/mtg/src/CardPrimitive.cpp +++ b/projects/mtg/src/CardPrimitive.cpp @@ -57,6 +57,7 @@ CardPrimitive::CardPrimitive(CardPrimitive * source) formattedText = source->formattedText; setName(source->name); + setdoubleFaced(source->doubleFaced); power = source->power; toughness = source->toughness; restrictions = source->restrictions ? source->restrictions->clone() : NULL; @@ -319,6 +320,18 @@ void CardPrimitive::addMagicText(string value, string key) magicTexts[key].append(value); } +void CardPrimitive::setdoubleFaced(const string& value) +{ + std::transform(doubleFaced.begin(), doubleFaced.end(), doubleFaced.begin(), ::tolower); + doubleFaced = value; +} + +const string& CardPrimitive::getdoubleFaced() const +{ + return doubleFaced; +} + + void CardPrimitive::setName(const string& value) { name = value; diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp index 1e2f54874..d1344768b 100644 --- a/projects/mtg/src/ExtraCost.cpp +++ b/projects/mtg/src/ExtraCost.cpp @@ -1289,12 +1289,10 @@ int SacrificeCost::doPay() MTGCardInstance * beforeCard = target; source->storedCard = target->createSnapShot(); WEvent * e; - if(!target->isToken) - e = NEW WEventCardSacrifice(beforeCard,target); - else - e = NEW WEventCardSacrifice(beforeCard,target,true); target->controller()->game->putInGraveyard(target); GameObserver * game = target->owner->getObserver(); + bool cardIsToken = target->isToken ? true : false; + e = NEW WEventCardSacrifice(beforeCard, target, cardIsToken); game->receiveEvent(e); target = NULL; if (tc) diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 9892a118d..b1d451d77 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -54,6 +54,7 @@ void GameObserver::cleanup() gameTurn.clear(); OpenedDisplay = NULL; AffinityNeedsUpdate = false; + legendNeedUpdate = false; } GameObserver::~GameObserver() @@ -898,11 +899,15 @@ void GameObserver::gameStateBasedEffects() //------------------------------ p->nomaxhandsize = (z->hasAbility(Constants::NOMAXHAND)); //legendary - for (int cl = 0; cl < nbcards; cl++) + if (legendNeedUpdate) { - MTGCardInstance * c = z->cards[cl]; - if(!c->isPhased && c->hasType(Subtypes::TYPE_LEGENDARY) && !c->has(Constants::NOLEGEND)) - checkLegendary(c); + for (int cl = 0; cl < nbcards; cl++) + { + MTGCardInstance * c = z->cards[cl]; + if (!c->isPhased && c->hasType(Subtypes::TYPE_LEGENDARY) && !c->has(Constants::NOLEGEND)) + checkLegendary(c); + } + legendNeedUpdate = false; } ///////////////////////////////////////////////// //handle end of turn effects while we're at it.// @@ -1126,6 +1131,7 @@ void GameObserver::Affinity() } } ///we handle trisnisphere seperately because its a desaster. + if(card->getManaCost())//make sure we check, abiliy$!/token dont have a mancost object. if (card->has(Constants::TRINISPHERE)) { for (int jj = card->getManaCost()->getConvertedCost(); jj < 3; jj++) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index ad0510f6e..99fa8f123 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -3334,26 +3334,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG /*vectorFlipStats = split(splitFlipStat[1],'%');*/ flipStats = splitFlipStat[1]; } - if(flipStats == "Tomoya the Revealer" || - flipStats == "Tok-Tok, Volcano Born" || - flipStats == "Tobita, Master of Winds" || - flipStats == "Stabwhisker the Odious" || - flipStats == "Shidako, Broodmistress" || - flipStats == "Sasaya's Essence" || - flipStats == "Rune-Tail's Essence" || - flipStats == "Nighteyes the Desecrator" || - flipStats == "Kuon's Essence" || - flipStats == "Kenzo the Hardhearted" || - flipStats == "Kaiso, Memory of Loyalty" || - flipStats == "Ichiga, Who Topples Oaks" || - flipStats == "Homura's Essence" || - flipStats == "Scarmaker" || - flipStats == "Goka the Unjust" || - flipStats == "Erayo's Essence" || - flipStats == "Jaraku the Interloper" || - flipStats == "Azamuki, Treachery Incarnate" || - flipStats == "Autumn-Tail, Kitsune Sage" || - flipStats == "Dokai, Weaver of Life" ) + if(card->getdoubleFaced() == "kamiflip") {//old flip cards kamigawa MTGAbility * a = NEW AAFlip(observer, id, card, target,flipStats,true); return a; diff --git a/projects/mtg/src/MTGDeck.cpp b/projects/mtg/src/MTGDeck.cpp index 86fb175a2..45d71c69d 100644 --- a/projects/mtg/src/MTGDeck.cpp +++ b/projects/mtg/src/MTGDeck.cpp @@ -140,8 +140,16 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi } } break; - case 'd'://dredge - if (!primitive) primitive = NEW CardPrimitive(); + case 'd'://double faced card /dredge + if (key == "doublefaced") + { + if (!primitive) primitive = NEW CardPrimitive(); + { + primitive->setdoubleFaced(val); + break; + } + } + else if (!primitive) primitive = NEW CardPrimitive(); { string value = val; std::transform(value.begin(), value.end(), value.begin(), ::tolower); diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 2d73f2708..9a3e29f1d 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -167,7 +167,8 @@ const char* Constants::MTGBasicAbilities[] = { "overload", "shackler", "flyersonly", - "tempflashback" + "tempflashback", + "legendruleremove" }; map Constants::MTGBasicAbilitiesMap; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 4a210d44a..04cc78dbf 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -3187,7 +3187,7 @@ int MTGLegendRule::canBeInList(MTGCardInstance * card) return 0; if (card->hasType(Subtypes::TYPE_LEGENDARY) && card->controller()->game->inPlay->hasCard(card)) { - if(card->has(Constants::NOLEGEND)||card->controller()->opponent()->inPlay()->hasName("Mirror Gallery")||card->controller()->inPlay()->hasName("Mirror Gallery")) + if(card->has(Constants::NOLEGEND)||card->controller()->opponent()->inPlay()->hasAbility(Constants::NOLEGENDRULE)||card->controller()->inPlay()->hasAbility(Constants::NOLEGENDRULE)) return 0; else return 1; @@ -3233,8 +3233,10 @@ int MTGLegendRule::added(MTGCardInstance * card) return 1; } -int MTGLegendRule::removed(MTGCardInstance *) +int MTGLegendRule::removed(MTGCardInstance * card) { + if (card->has(Constants::NOLEGENDRULE)) + game->legendNeedUpdate = true; return 0; }