diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index e4e187b9c..c2c2b4154 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -41250,6 +41250,17 @@ mana={1}{B} type=Instant [/card] [card] +name=Goham Djinn +auto={1}{B}:regenerate +auto=this(variable{commonblack}>0) -2/-2 +text={1}{B}: Regenerate Goham Djinn. -- Goham Djinn gets -2/-2 as long as black is the most common color among all permanents or is tied for most common. +mana={5}{B} +type=Creature +subtype=Djinn +power=5 +toughness=5 +[/card] +[card] name=Gold Myr auto={T}:Add{W} text={T}: Add {W} to your mana pool. @@ -43936,6 +43947,17 @@ mana={6} type=Artifact [/card] [card] +name=Halam Djinn +abilities=haste +auto=this(variable{commonred}>0) -2/-2 +text=Haste -- Halam Djinn gets -2/-2 as long as red is the most common color among all permanents or is tied for most common. +mana={5}{R} +type=Creature +subtype=Djinn +power=6 +toughness=5 +[/card] +[card] name=Halberdier abilities=first strike text=First strike @@ -82616,6 +82638,17 @@ text=Ruins of Trokair enters the battlefield tapped. -- {T}: Add {W} to your man type=Land [/card] [card] +name=Ruham Djinn +abilities=first strike +auto=this(variable{commonwhite}>0) -2/-2 +text=First strike -- -- Ruham Djinn gets -2/-2 as long as white is the most common color among all permanents or is tied for most common. +mana={5}{W} +type=Creature +subtype=Djinn +power=5 +toughness=5 +[/card] +[card] name=Ruhan of the Fomori abilities=mustattack text=At the beginning of combat on your turn, choose an opponent at random. Ruhan of the Fomori attacks that player this combat if able. @@ -98158,6 +98191,17 @@ mana={3}{B}{R} type=Enchantment [/card] [card] +name=Sulam Djinn +abilities=trample +auto=this(variable{commongreen}>0) -2/-2 +text=Trample -- Sulam Djinn gets -2/-2 as long as green is the most common color among all permanents or is tied for most common. +mana={5}{G} +type=Creature +subtype=Djinn +power=6 +toughness=6 +[/card] +[card] name=Suleiman's Legacy auto=lord(djinn) sacrifice auto=lord(efreet) sacrifice @@ -116490,6 +116534,17 @@ power=5 toughness=5 [/card] [card] +name=Zanam Djinn +abilities=flying +auto=this(variable{commonblue}>0) -2/-2 +text=Flying -- Zanam Djinn gets -2/-2 as long as blue is the most common color among all permanents or is tied for most common. +mana={5}{U} +type=Creature +subtype=Djinn +power=5 +toughness=6 +[/card] +[card] name=Zanikev Locust autograveyard={2}{B}{B}{E}:name(scavenge) counter(1/1,storedpower) target(creature) asSorcery abilities=flying diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 6b9e24599..5fe85e79f 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -8873,15 +8873,6 @@ type=Legendary Artifact subtype=Equipment [/card] [card] -name=Goham Djinn -text={1}{B}: Regenerate Goham Djinn. -- Goham Djinn gets -2/-2 as long as black is the most common color among all permanents or is tied for most common. -mana={5}{B} -type=Creature -subtype=Djinn -power=5 -toughness=5 -[/card] -[card] name=Golden Wish text=You may choose an artifact or enchantment card you own from outside the game, reveal that card, and put it into your hand. Exile Golden Wish. mana={3}{W}{W} @@ -9458,15 +9449,6 @@ power=2 toughness=4 [/card] [card] -name=Halam Djinn -text=Haste -- Halam Djinn gets -2/-2 as long as red is the most common color among all permanents or is tied for most common. -mana={5}{R} -type=Creature -subtype=Djinn -power=6 -toughness=5 -[/card] -[card] name=Halfdane text=At the beginning of your upkeep, Halfdane's power and toughness become equal to the power and toughness of target creature other than Halfdane until the end of your next upkeep. mana={1}{W}{U}{B} @@ -19004,15 +18986,6 @@ power=2 toughness=3 [/card] [card] -name=Ruham Djinn -text=First strike -- -- Ruham Djinn gets -2/-2 as long as white is the most common color among all permanents or is tied for most common. -mana={5}{W} -type=Creature -subtype=Djinn -power=5 -toughness=5 -[/card] -[card] name=Ruin Processor text=When you cast Ruin Processor, you may put a card an opponent owns from exile into that player's graveyard. If you do, you gain 5 life. mana={7} @@ -22539,15 +22512,6 @@ mana={1}{U} type=Instant [/card] [card] -name=Sulam Djinn -text=Trample -- Sulam Djinn gets -2/-2 as long as green is the most common color among all permanents or is tied for most common. -mana={5}{G} -type=Creature -subtype=Djinn -power=6 -toughness=6 -[/card] -[card] name=Sulfuric Vapors text=If a red spell would deal damage to a permanent or player, it deals that much damage plus 1 to that permanent or player instead. mana={3}{R} @@ -26498,15 +26462,6 @@ power=2 toughness=2 [/card] [card] -name=Zanam Djinn -text=Flying -- Zanam Djinn gets -2/-2 as long as blue is the most common color among all permanents or is tied for most common. -mana={5}{U} -type=Creature -subtype=Djinn -power=5 -toughness=6 -[/card] -[card] name=Zealous Inquisitor text={1}{W}: The next 1 damage that would be dealt to Zealous Inquisitor this turn is dealt to target creature instead. mana={2}{W} diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 0f03c63d6..79f3dc0ba 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -425,6 +425,26 @@ private: { intValue = card->imprintW; } + else if (s == "commongreen") + { + intValue = mostCommonColor(Constants::MTG_COLOR_GREEN, card); + } + else if (s == "commonblue") + { + intValue = mostCommonColor(Constants::MTG_COLOR_BLUE, card); + } + else if (s == "commonred") + { + intValue = mostCommonColor(Constants::MTG_COLOR_RED, card); + } + else if (s == "commonblack") + { + intValue = mostCommonColor(Constants::MTG_COLOR_BLACK, card); + } + else if (s == "commonwhite") + { + intValue = mostCommonColor(Constants::MTG_COLOR_WHITE, card); + } else if (s == "targetedcurses") { if(card->playerTarget) @@ -775,6 +795,36 @@ public: return count; } + int countCardsInPlaybyColor(int color, GameObserver * observer) + { + int count = 0; + for (int i = 0; i < 2; i++) + { + for( int j= 0; j < observer->players[i]->inPlay()->nb_cards; j++) + if(observer->players[i]->inPlay()->cards[j]->hasColor(color)) + count += 1; + } + return count; + } + + int mostCommonColor(int color, MTGCardInstance * card) + { + int maxColor = 0; + vector colors; + + for(int i = 1; i < 6; i++) + colors.push_back( countCardsInPlaybyColor(i, card->getObserver()) ); + + for(int j = 0; j < 5; j++) + if ( colors[j] > maxColor ) + maxColor = colors[j]; + + if (countCardsInPlaybyColor(color, card->getObserver()) >= maxColor && maxColor > 0) + return 1; + + return 0; + } + int countCardTypeinZone(string type, MTGGameZone * zone) { int count = 0;