diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 017a69c27..9d8f5a066 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -69,6 +69,16 @@ mana={B} type=Sorcery [/card] [card] +name=Cemetery Puca +text=Whenever a creature is put into a graveyard from the battlefield, you may pay {1}. If you do, Cemetery Puca becomes a copy of that creature and gains this ability. +auto=@movedto(creature|graveyard) from(battlefield):all(trigger[from]) pay[[{1}]] copy +mana={1}{UB}{UB} +type=Creature +subtype=Shapeshifter +power=1 +toughness=2 +[/card] +[card] name=Cinder Seer auto={2}{r}{t}:target(creature,Player) damage:type:*[red]:myhand text={2}{R}, {T}: Reveal any number of red cards in your hand. Cinder Seer deals X damage to target creature or player, where X is the number of cards revealed this way. @@ -89,6 +99,16 @@ mana={1}{B}{G} type=Instant [/card] [card] +name=Cryptoplasm +auto=@each my upkeep:may copy target(other creature|battlefield) +text=At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. +mana={1}{U}{U} +type=Creature +subtype=Shapeshifter +power=2 +toughness=2 +[/card] +[card] name=Dark Withering abilities=madness autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) @@ -99,6 +119,16 @@ mana={4}{B}{B} type=Instant [/card] [card] +name=Dimir Doppelganger +auto={1}{U}{B}:target(creature|graveyard) moveto(exile) and!(copy)! +text={1}{U}{B}: Exile target creature card from a graveyard. Dimir Doppelganger becomes a copy of that card and gains this ability. +mana={1}{U}{B} +type=Creature +subtype=Shapeshifter +power=0 +toughness=2 +[/card] +[card] name=Distortion Strike target=creature auto=1/0 @@ -462,6 +492,23 @@ type=Sorcery text=You gain 2 life. Then if you have more life than an opponent, draw a card. Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.) [/card] [card] +name=Thespian's Stage +auto={T}:Add{1} +auto={2}{T}:copy target(land|battlefield) +text={T}: Add {1} to your mana pool. -- {2}, {T}: Thespian's Stage becomes a copy of target land and gains this ability. +type=Land +[/card] +[card] +name=Unstable Shapeshifter +auto=@movedto(other creature|battlefield):all(trigger[from]) copy +text=Whenever another creature enters the battlefield, Unstable Shapeshifter becomes a copy of that creature and gains this ability. +mana={3}{U} +type=Creature +subtype=Shapeshifter +power=0 +toughness=1 +[/card] +[card] name=Virulent Swipe target=creature auto=2/0 diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 5f633d64b..2cd71814f 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -15219,16 +15219,6 @@ power=0 toughness=5 [/card] [card] -name=Cemetery Puca -text=Whenever a creature is put into a graveyard from the battlefield, you may pay {1}. If you do, Cemetery Puca becomes a copy of that creature and gains this ability. -auto=@movedto(creature|graveyard) from(battlefield):all(trigger[from]) pay[[{1}]] copy -mana={1}{UB}{UB} -type=Creature -subtype=Shapeshifter -power=1 -toughness=2 -[/card] -[card] name=Cemetery Reaper auto=lord(other zombie|myBattlefield) 1/1 auto={2}{B}{T}:moveTo(Exile) target(creature|graveyard) && token(Zombie,Creature Zombie,2/2,black) @@ -16540,6 +16530,7 @@ toughness=2 [/card] [card] name=Cho-Manno's Blessing +alias=0000 abilities=auraward target=creature abilities=flash @@ -18133,6 +18124,7 @@ type=Artifact [/card] [card] name=Coldsteel Heart +alias=0000 auto=tap auto=chooseacolor {T}:add{chosencolor} chooseend text=Coldsteel Heart enters the battlefield tapped. -- As Coldsteel Heart enters the battlefield, choose a color. -- {T}: Add one mana of the chosen color to your mana pool. @@ -20675,16 +20667,6 @@ power=0 toughness=0 [/card] [card] -name=Cryptoplasm -auto=@each my upkeep:may copy target(other creature|battlefield) -text=At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. -mana={1}{U}{U} -type=Creature -subtype=Shapeshifter -power=2 -toughness=2 -[/card] -[card] name=Cryptwailing auto={1}{E(creature|mygraveyard)}{E(creature|mygraveyard)}:target(player) ability$!name(discard) target(*|myhand) reject!$ targetedplayer asSorcery text={1}, Exile two creature cards from your graveyard: Target player discards a card. Activate this ability only any time you could cast a sorcery. @@ -21040,6 +21022,7 @@ subtype=Aura Curse [/card] [card] name=Curse of Wizardry +alias=0000 auto=chooseacolor transforms((,newability[@movedto(*[chosencolor]|mystack):life:-1 controller],newability[@movedto(*[chosencolor]|opponentstack):life:-1 opponent])) chooseend text=As Curse of Wizardry enters the battlefield, choose a color. -- Whenever a player casts a spell of the chosen color, that player loses 1 life. mana={2}{B}{B} @@ -24756,16 +24739,6 @@ power=2 toughness=2 [/card] [card] -name=Dimir Doppelganger -auto={1}{U}{B}:target(creature|graveyard) moveto(exile) and!(copy)! -text={1}{U}{B}: Exile target creature card from a graveyard. Dimir Doppelganger becomes a copy of that card and gains this ability. -mana={1}{U}{B} -type=Creature -subtype=Shapeshifter -power=0 -toughness=2 -[/card] -[card] name=Dimir Guildgate auto=tap auto={T}:add{U} @@ -35093,6 +35066,7 @@ toughness=2 [/card] [card] name=Flickering Ward +alias=0000 abilities=auraward target=creature auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend @@ -35171,6 +35145,7 @@ toughness=2 [/card] [card] name=Floating Shield +alias=0000 abilities=auraward target=creature auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend @@ -43565,6 +43540,7 @@ toughness=3 [/card] [card] name=Hall of Triumph +alias=0000 auto=activatechooseacolor transforms((,newability[lord(creature[chosencolor]|mybattlefield) 1/1])) forever activatechooseend text=As Hall of Triumph enters the battlefield, choose a color. -- Creatures you control of the chosen color get +1/+1. mana={3} @@ -49384,6 +49360,7 @@ type=Sorcery [/card] [card] name=Iona, Shield of Emeria +alias=0000 abilities=flying auto=chooseacolor maxCast(*[chosencolor])0 opponent chooseend text=Flying -- As Iona, Shield of Emeria enters the battlefield, choose a color. -- Your opponents can't cast spells of the chosen color. @@ -50520,6 +50497,7 @@ toughness=3 [/card] [card] name=Jihad +alias=0000 auto=chooseacolor transforms((,newability[aslongas(*[chosencolor]|opponentbattlefield) lord(creature[white]|mybattlefield) 2/1],newability[aslongas(*[chosencolor]|opponentbattlefield) sacrifice <1])) chooseend text=As Jihad enters the battlefield, choose a color and an opponent. -- White creatures get +2/+1 as long as the chosen player controls a nontoken permanent of the chosen color. -- When the chosen player controls no nontoken permanents of the chosen color, sacrifice Jihad. mana={W}{W}{W} @@ -54796,7 +54774,7 @@ toughness=2 [/card] [card] name=Kytheon's Irregulars -auto=auto={W}{W}:tap target(creature) +auto={W}{W}:tap target(creature) auto=this(cantargetcard(*[-renown]) transforms((,newability[@combatdamaged(player) from(this):counter(1/1) && becomes(renown) forever])) text=Renown 1 (When this creature deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.) -- {W}{W}: Tap target creature. mana={2}{W}{W} @@ -58209,6 +58187,7 @@ type=Instant [/card] [card] name=Lurebound Scarecrow +alias=0000 auto=chooseacolor aslongas(*[chosencolor]|myBattlefield) sacrifice <1 chooseend text=As Lurebound Scarecrow enters the battlefield, choose a color. -- When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow. mana={3} @@ -70832,6 +70811,7 @@ subtype=Equipment [/card] [card] name=Paradise Plume +alias=0000 auto=chooseacolor transforms((,newability[{T}:add{chosencolor}],newability[@movedto(*[chosencolor]|stack):life:1 controller])) forever chooseend text=As Paradise Plume enters the battlefield, choose a color. -- Whenever a player casts a spell of the chosen color, you may gain 1 life. -- {T}: Add one mana of the chosen color to your mana pool. mana={4} @@ -71623,6 +71603,7 @@ type=Artifact [/card] [card] name=Pentarch Paladin +alias=0000 abilities=flanking auto=chooseacolor {W}{W}{T}:destroy target(*[chosencolor]) chooseend text=Flanking (Whenever a creature without flanking blocks this creature, the blocking creature gets -1/-1 until end of turn.) -- As Pentarch Paladin enters the battlefield, choose a color. -- {W}{W}, {T}: Destroy target permanent of the chosen color. @@ -71634,6 +71615,7 @@ toughness=3 [/card] [card] name=Pentarch Ward +alias=0000 abilities=auraward target=creature auto=chooseacolor teach(creature) protection from(*[chosencolor]) chooseend @@ -74770,7 +74752,8 @@ toughness=4 [/card] [card] name=Prism Ring -auto=auto=activatechooseacolor transforms((,newability[@movedto(*[chosencolor]|mystack):life:1 controller])) forever activatechooseend +alias=0000 +auto=activatechooseacolor transforms((,newability[@movedto(*[chosencolor]|mystack):life:1 controller])) forever activatechooseend text=As Prism Ring enters the battlefield, choose a color. -- Whenever you cast a spell of the chosen color, you gain 1 life. mana={1} type=Artifact @@ -75240,6 +75223,7 @@ toughness=2 [/card] [card] name=Psychic Allergy +alias=0000 auto=upcost[{S(island|mybattlefield)}{S(island|mybattlefield)}] sacrifice auto=chooseacolor transforms((,newability[@each opponent upkeep:damage:type:*[-token&chosencolor]:opponentbattlefield opponent])) chooseend text=As Psychic Allergy enters the battlefield, choose a color. -- At the beginning of each opponent's upkeep, Psychic Allergy deals X damage to that player, where X is the number of nontoken permanents of the chosen color he or she controls. -- At the beginning of your upkeep, destroy Psychic Allergy unless you sacrifice two Islands. @@ -76335,6 +76319,7 @@ toughness=1 [/card] [card] name=Quirion Elves +alias=0000 auto={T}:Add{G} auto=chooseacolor {T}:add{chosencolor} chooseend text=As Quirion Elves enters the battlefield, choose a color. -- {T}: Add {G} to your mana pool. -- {T}: Add one mana of the chosen color to your mana pool. @@ -87769,6 +87754,7 @@ toughness=2 [/card] [card] name=Shifting Sky +alias=0000 auto=chooseacolor lord(*[-land]) becomes(,chosencolor) chooseend text=As Shifting Sky enters the battlefield, choose a color. -- All nonland permanents are the chosen color. mana={2}{U} @@ -89053,6 +89039,7 @@ toughness=1 [/card] [card] name=Silhana Starfletcher +alias=0000 abilities=reach auto=activatechooseacolor {T}:add{chosencolor} activatechooseend text=Reach (This creature can block creatures with flying.) -- As Silhana Starfletcher enters the battlefield, choose a color. -- {T}: Add one mana of the chosen color to your mana pool. @@ -91990,6 +91977,7 @@ toughness=3 [/card] [card] name=Sol Grail +alias=0000 auto=chooseacolor transforms((,newability[{T}:add{chosencolor}])) forever chooseend text=As Sol Grail enters the battlefield, choose a color. -- {T}: Add one mana of the chosen color to your mana pool. mana={3} @@ -100081,6 +100069,7 @@ type=Legendary Land [/card] [card] name=Teferi's Moat +alias=0000 auto=chooseacolor lord(creature[chosencolor&-flying]|opponentBattlefield) cantattack chooseend text=As Teferi's Moat enters the battlefield, choose a color. -- Creatures of the chosen color without flying can't attack you. mana={3}{W}{U} @@ -101376,13 +101365,6 @@ mana={1}{G}{G} type=Sorcery [/card] [card] -name=Thespian's Stage -auto={T}:Add{1} -auto={2}{T}:copy target(land|battlefield) -text={T}: Add {1} to your mana pool. -- {2}, {T}: Thespian's Stage becomes a copy of target land and gains this ability. -type=Land -[/card] -[card] name=Thicket Basilisk auto=@combat(blocking,blocked) source(this) from(creature[-wall]):all(trigger[from]) phaseaction[combatends once] destroy text=Whenever Thicket Basilisk blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat. @@ -106635,16 +106617,6 @@ type=Enchantment subtype=Aura [/card] [card] -name=Unstable Shapeshifter -auto=@movedto(other creature|battlefield):all(trigger[from]) copy -text=Whenever another creature enters the battlefield, Unstable Shapeshifter becomes a copy of that creature and gains this ability. -mana={3}{U} -type=Creature -subtype=Shapeshifter -power=0 -toughness=1 -[/card] -[card] name=Unstoppable Ash abilities=trample auto=aslongas(other treefolk|mybattlefield) choice notatarget(other treefolk|mybattlefield) (blink)forsrc oneshot @@ -109849,6 +109821,7 @@ toughness=2 [/card] [card] name=Voice of All +alias=0000 abilities=flying auto=chooseacolor transforms((,newability[protection from(*[chosencolor])],newability[0/0])) forever chooseend text=Flying (This creature can't be blocked except by creatures with flying or reach.) -- As Voice of All enters the battlefield, choose a color. -- Voice of All has protection from the chosen color. (It can't be blocked, targeted, dealt damage, or enchanted by anything of the chosen color.) @@ -111655,6 +111628,7 @@ toughness=1 [/card] [card] name=Ward Sliver +alias=0000 auto=chooseacolor transforms((,newability[lord(sliver) protection from(*[chosencolor])])) forever chooseend text=As Ward Sliver enters the battlefield, choose a color. -- All Slivers have protection from the chosen color. mana={4}{W} diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index 3771a3c27..25fcf745b 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -122,8 +122,6 @@ class GameObserver{ void gameStateBasedEffects(); void enchantmentStatus(); void Affinity(); - void ComputeTrinisphere(); - void RemoveTrinisphere(MTGCardInstance * card); void addObserver(MTGAbility * observer); bool removeObserver(ActionElement * observer); void startGame(GameType, Rules * rules); diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index b9ecfa8cf..876bb97e2 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -213,6 +213,7 @@ public: COUNTERS = 30, PUT_INTO_PLAY_WITH_KICKER = 31, STANDARD_FIZZLER = 32, + CASTINGRAVEYARD_COST = 33, }; }; diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 56c887459..9eb7a64da 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -253,9 +253,25 @@ public: int cardistargetted; bool isTargetter(); int cardistargetter; - int tmodifier; - int tmodifierb; int myconvertedcost; + ManaCost * computeNewCost(MTGCardInstance * card,ManaCost * oldCost) + { + if(card->isLand()) + return oldCost; + + if(!card) + return NULL; + //i don't know why this method doesn't affect cards in hand, but is working on other zones....// + //pay zero costs// + //kicker???...// + //morph cost todo// + //trinisphere must be here below// + if(card->has(Constants::TRINISPHERE)) + for(int jj = oldCost->getConvertedCost(); jj < 3; jj++) + oldCost->add(Constants::MTG_COLOR_ARTIFACT, 1); + + return oldCost; + }; void eventattacked(); void eventattackedAlone(); diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index cc45e19b2..a3df629bc 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -236,7 +236,8 @@ class Constants OPPGCREATUREEXILER = 118, PAYZERO = 119, TRINISPHERE = 120, - NB_BASIC_ABILITIES = 121, + CANPLAYFROMEXILE = 121, + NB_BASIC_ABILITIES = 122, RARITY_S = 'S', //Special Rarity diff --git a/projects/mtg/include/MTGRules.h b/projects/mtg/include/MTGRules.h index bd31cfc83..13be1c5b3 100644 --- a/projects/mtg/include/MTGRules.h +++ b/projects/mtg/include/MTGRules.h @@ -76,6 +76,8 @@ public: MTGPutInPlayRule(GameObserver* observer, int _id); const string getMenuText() { + if(game && game->gameType() == GAME_TYPE_MOMIR) + return "Play Land"; return "Cast Card Normally"; } virtual MTGPutInPlayRule * clone() const; diff --git a/projects/mtg/include/ManaCost.h b/projects/mtg/include/ManaCost.h index 9faea5806..bdc3868ab 100644 --- a/projects/mtg/include/ManaCost.h +++ b/projects/mtg/include/ManaCost.h @@ -47,7 +47,8 @@ public: MANA_PAID_WITH_FLASHBACK = 5, MANA_PAID_WITH_RETRACE = 6, MANA_PAID_WITH_MORPH = 7, - MANA_PAID_WITH_SUSPEND = 8 + MANA_PAID_WITH_SUSPEND = 8, + MANA_PAID_WITH_OTHERCOST = 9 }; ExtraCosts * extraCosts; diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 5fd4c6f3c..88de3027b 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -301,7 +301,7 @@ bool Spell::FullfilledAlternateCost(const int &costType) hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_RETRACE); break; case ManaCost::MANA_PAID_WITH_SUSPEND: - hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_RETRACE); + hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_SUSPEND); break; } diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index a9454f183..00fec3c32 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -364,8 +364,20 @@ void CardGui::Render() if(card->isToken && card->isACopier) buff = "CT"; if(!card->isToken && card->isACopier) - buff = "C"; - + buff = "C"; + if(card->alias == 0000) + { + if(card->chooseacolor == 1) + buff += "\n-Green"; + else if(card->chooseacolor == 2) + buff += "\n-Blue"; + else if(card->chooseacolor == 3) + buff += "\n-Red"; + else if(card->chooseacolor == 4) + buff += "\n-Black"; + else if(card->chooseacolor == 5) + buff += "\n-White"; + } if(!alternate && buff != "" && game->gameType() == GAME_TYPE_CLASSIC)//it seems that other game modes makes cards as tokens!!! hmmm... { mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index a84429bd1..03bf15211 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -885,9 +885,6 @@ void GameObserver::gameStateBasedEffects() // plus modify costs // ///////////////////////////// Affinity(); - //trinisphere? buggy... - //ComputeTrinisphere(); - //end trinisphere ///////////////////////////////////// // Check colored statuses on cards // ///////////////////////////////////// @@ -979,10 +976,14 @@ void GameObserver::Affinity() //only do any of the following if a card with the stated ability is in your hand. ManaCost * original = NEW ManaCost(); ManaCost * alternate = NEW ManaCost(); + ManaCost * buyback = NEW ManaCost(); + ManaCost * flashback = NEW ManaCost(); + ManaCost * retrace = NEW ManaCost(); original->copy(card->model->data->getManaCost()); alternate->copy(card->model->data->getManaCost()->getAlternative()); - if (card->has(Constants::PAYZERO)) - original = ManaCost::parseManaCost("{0}",NULL,card);//can't figure out 2 or more alternative... + buyback->copy(card->model->data->getManaCost()->getBuyback()); + flashback->copy(card->model->data->getManaCost()->getFlashback()); + retrace->copy(card->model->data->getManaCost()->getRetrace()); //have to run alter cost before affinity or the 2 cancel each other out. if(card->getIncreasedManaCost()->getConvertedCost()||card->getReducedManaCost()->getConvertedCost()) { @@ -995,10 +996,22 @@ void GameObserver::Affinity() { alternate->add(kc,card->getIncreasedManaCost()->getCost(kc)); } + if (card->getManaCost()->getBuyback()) + { + buyback->add(kc,card->getIncreasedManaCost()->getCost(kc)); + } + if (card->getManaCost()->getFlashback()) + { + flashback->add(kc,card->getIncreasedManaCost()->getCost(kc)); + } + if (card->getManaCost()->getRetrace()) + { + retrace->add(kc,card->getIncreasedManaCost()->getCost(kc)); + } } } if(card->getReducedManaCost()->getConvertedCost()) - { + { original->remove(card->getReducedManaCost()); for(int kc = Constants::MTG_COLOR_ARTIFACT; kc < Constants::NB_Colors;kc++) { @@ -1006,12 +1019,30 @@ void GameObserver::Affinity() { alternate->remove(kc,card->getReducedManaCost()->getCost(kc)); } + if (card->getManaCost()->getBuyback()) + { + buyback->remove(kc,card->getIncreasedManaCost()->getCost(kc)); + } + if (card->getManaCost()->getFlashback()) + { + flashback->remove(kc,card->getIncreasedManaCost()->getCost(kc)); + } + if (card->getManaCost()->getRetrace()) + { + retrace->remove(kc,card->getIncreasedManaCost()->getCost(kc)); + } } } if(card->getManaCost()) card->getManaCost()->copy(original); if(card->getManaCost()->getAlternative()) - card->getManaCost()->setAlternative(alternate); + card->getManaCost()->setAlternative(alternate); + if(card->getManaCost()->getBuyback()) + card->getManaCost()->setBuyback(buyback); + if(card->getManaCost()->getFlashback()) + card->getManaCost()->setFlashback(flashback); + if(card->getManaCost()->getRetrace()) + card->getManaCost()->setRetrace(retrace); if(card->getManaCost()->extraCosts) { for(unsigned int i = 0; i < card->getManaCost()->extraCosts->costs.size();i++) @@ -1068,7 +1099,8 @@ void GameObserver::Affinity() card->has(Constants::AFFINITYISLAND)|| card->has(Constants::AFFINITYMOUNTAIN)|| card->has(Constants::AFFINITYPLAINS)|| - card->has(Constants::AFFINITYSWAMP)){ + card->has(Constants::AFFINITYSWAMP)) + { if (card->has(Constants::AFFINITYARTIFACTS)) { type = "artifact"; @@ -1123,86 +1155,13 @@ void GameObserver::Affinity() if(card->getManaCost()->getCost(color) > 0) card->getManaCost()->remove(color,1); } - - } - SAFE_DELETE(original); + } + //SAFE_DELETE(original); }//end } } } -void GameObserver::ComputeTrinisphere() -{ - for (int td = 0; td < 2; td++) - { - MTGGameZone * dzones[] = { players[td]->game->graveyard, players[td]->game->hand, players[td]->game->library, players[td]->game->exile }; - for (int tk = 0; tk < 4; tk++) - { - MTGGameZone * zone = dzones[tk]; - for (int ct = zone->nb_cards - 1; ct >= 0; ct--) - { - if(zone->cards[ct]->has(Constants::TRINISPHERE)) - { - if(zone->cards[ct]->getManaCost()->getConvertedCost() == 2) - { - zone->cards[ct]->getManaCost()->add(Constants::MTG_COLOR_ARTIFACT, 1); - zone->cards[ct]->tmodifier = 1; - } - else if(zone->cards[ct]->getManaCost()->getConvertedCost() == 1) - { - zone->cards[ct]->getManaCost()->add(Constants::MTG_COLOR_ARTIFACT, 2); - zone->cards[ct]->tmodifier = 2; - } - else if(zone->cards[ct]->getManaCost()->getConvertedCost() < 1) - { - zone->cards[ct]->getManaCost()->add(Constants::MTG_COLOR_ARTIFACT, 3); - zone->cards[ct]->tmodifier = 3; - } - if(zone->cards[ct]->getManaCost()->getAlternative()) - { - ManaCost * currentAlternate = NEW ManaCost(); - currentAlternate->copy(zone->cards[ct]->getManaCost()->getAlternative()); - if(zone->cards[ct]->getManaCost()->getAlternative()->getConvertedCost() == 2) - zone->cards[ct]->tmodifierb = 1; - else if(zone->cards[ct]->getManaCost()->getAlternative()->getConvertedCost() == 1) - zone->cards[ct]->tmodifierb = 2; - else if(zone->cards[ct]->getManaCost()->getAlternative()->getConvertedCost() < 1) - zone->cards[ct]->tmodifierb = 3; - currentAlternate->add(Constants::MTG_COLOR_ARTIFACT, zone->cards[ct]->tmodifierb); - zone->cards[ct]->getManaCost()->setAlternative(currentAlternate); - } - } - else - RemoveTrinisphere(zone->cards[ct]); - if(zone->cards[ct]->getManaCost()->extraCosts) - { - for(unsigned int i = 0; i < zone->cards[ct]->getManaCost()->extraCosts->costs.size();i++) - { - zone->cards[ct]->getManaCost()->extraCosts->costs[i]->setSource(zone->cards[ct]); - } - } - } - } - } -} -void GameObserver::RemoveTrinisphere(MTGCardInstance * card) -{ - if(card->has(Constants::TRINISPHERE)) - return; - if(card->tmodifier) - { - card->getManaCost()->remove(Constants::MTG_COLOR_ARTIFACT, card->tmodifier); - card->tmodifier = 0; - } - if(card->getManaCost()->getAlternative() && card->tmodifierb) - { - ManaCost * newalternate = NEW ManaCost(); - newalternate->copy(card->getManaCost()->getAlternative()); - newalternate->remove(Constants::MTG_COLOR_ARTIFACT, card->tmodifierb); - card->getManaCost()->setAlternative(newalternate); - card->tmodifierb = 0; - } -} void GameObserver::Render() { if(mLayers) diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 02d5086fa..a70ef93b6 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -65,8 +65,6 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to LKItoughness = toughness; cardistargetted = 0; cardistargetter = 0; - tmodifier = 0; - tmodifierb = 0; myconvertedcost = getManaCost()->getConvertedCost(); } diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index a2530cdb4..dbeaca32d 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -149,7 +149,8 @@ const char* Constants::MTGBasicAbilities[] = { "mygcreatureexiler", "oppgcreatureexiler", "payzero", - "trinisphere" + "trinisphere", + "canplayfromexile" }; map Constants::MTGBasicAbilitiesMap; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 458e63789..f1b14a941 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -1132,7 +1132,7 @@ MTGMorphCostRule * MTGMorphCostRule::clone() const MTGPlayFromGraveyardRule::MTGPlayFromGraveyardRule(GameObserver* observer, int _id) : MTGAlternativeCostRule(observer, _id) { - aType = MTGAbility::PUT_INTO_PLAY; + aType = MTGAbility::CASTINGRAVEYARD_COST; } int MTGPlayFromGraveyardRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana) @@ -1155,9 +1155,9 @@ int MTGPlayFromGraveyardRule::reactToClick(MTGCardInstance * card) ManaCost * cost = card->getManaCost(); - card->paymenttype = MTGAbility::PUT_INTO_PLAY; + card->paymenttype = MTGAbility::CASTINGRAVEYARD_COST; - return MTGAlternativeCostRule::reactToClick(card, cost, ManaCost::MANA_PAID); + return MTGAlternativeCostRule::reactToClick(card, cost, ManaCost::MANA_PAID_WITH_OTHERCOST); } ostream& MTGPlayFromGraveyardRule::toString(ostream& out) const