Most Common Color
This commit is contained in:
@@ -41250,6 +41250,17 @@ mana={1}{B}
|
|||||||
type=Instant
|
type=Instant
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
name=Gold Myr
|
||||||
auto={T}:Add{W}
|
auto={T}:Add{W}
|
||||||
text={T}: Add {W} to your mana pool.
|
text={T}: Add {W} to your mana pool.
|
||||||
@@ -43936,6 +43947,17 @@ mana={6}
|
|||||||
type=Artifact
|
type=Artifact
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
name=Halberdier
|
||||||
abilities=first strike
|
abilities=first strike
|
||||||
text=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
|
type=Land
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
name=Ruhan of the Fomori
|
||||||
abilities=mustattack
|
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.
|
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
|
type=Enchantment
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
name=Suleiman's Legacy
|
||||||
auto=lord(djinn) sacrifice
|
auto=lord(djinn) sacrifice
|
||||||
auto=lord(efreet) sacrifice
|
auto=lord(efreet) sacrifice
|
||||||
@@ -116490,6 +116534,17 @@ power=5
|
|||||||
toughness=5
|
toughness=5
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
name=Zanikev Locust
|
||||||
autograveyard={2}{B}{B}{E}:name(scavenge) counter(1/1,storedpower) target(creature) asSorcery
|
autograveyard={2}{B}{B}{E}:name(scavenge) counter(1/1,storedpower) target(creature) asSorcery
|
||||||
abilities=flying
|
abilities=flying
|
||||||
|
|||||||
@@ -8873,15 +8873,6 @@ type=Legendary Artifact
|
|||||||
subtype=Equipment
|
subtype=Equipment
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
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.
|
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}
|
mana={3}{W}{W}
|
||||||
@@ -9458,15 +9449,6 @@ power=2
|
|||||||
toughness=4
|
toughness=4
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
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.
|
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}
|
mana={1}{W}{U}{B}
|
||||||
@@ -19004,15 +18986,6 @@ power=2
|
|||||||
toughness=3
|
toughness=3
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
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.
|
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}
|
mana={7}
|
||||||
@@ -22539,15 +22512,6 @@ mana={1}{U}
|
|||||||
type=Instant
|
type=Instant
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
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.
|
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}
|
mana={3}{R}
|
||||||
@@ -26498,15 +26462,6 @@ power=2
|
|||||||
toughness=2
|
toughness=2
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
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.
|
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}
|
mana={2}{W}
|
||||||
|
|||||||
@@ -425,6 +425,26 @@ private:
|
|||||||
{
|
{
|
||||||
intValue = card->imprintW;
|
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")
|
else if (s == "targetedcurses")
|
||||||
{
|
{
|
||||||
if(card->playerTarget)
|
if(card->playerTarget)
|
||||||
@@ -775,6 +795,36 @@ public:
|
|||||||
return count;
|
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<int> 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 countCardTypeinZone(string type, MTGGameZone * zone)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user