diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 82dc987c7..fc838d55b 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -1908,7 +1908,7 @@ toughness=3 [/card] [card] name=Alabaster Leech -auto=lord(*[white]|myhand) altercost(white, +1) +auto=lord(*[white]|myhand,mylibrary,mygraveyard,myexile) altercost(white, +1) text=White spells you cast cost {W} more to cast. mana={W} type=Creature @@ -2989,7 +2989,7 @@ type=Land [/card] [card] name=Andradite Leech -auto=lord(*[black]|myhand) altercost(black,+1) +auto=lord(*[black]|myhand,mylibrary,mygraveyard,myexile) altercost(black,+1) auto={B}:1/1 text=Black spells you cast cost {B} more to cast. -- {B}: Andradite Leech gets +1/+1 until end of turn. mana={2}{B} @@ -3367,7 +3367,7 @@ subtype=Aura name=Animar, Soul of Elements abilities=protection from white,protection from black auto=@movedTo(creature|mystack):counter(1/1,1) -auto=thisforeach(counter{1/1,1}) lord(creature|myhand) altercost(colorless, -1) +auto=thisforeach(counter{1/1,1}) lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) text=Protection from white and from black -- Whenever you cast a creature spell, put a +1/+1 counter on Animar, Soul of Elements. -- Creature spells you cast cost 1 less to cast for each +1/+1 counter on Animar. mana={U}{R}{G} type=Legendary Creature @@ -4030,8 +4030,8 @@ type=Enchantment [/card] [card] name=Arcane Melee -auto=lord(instant|hand) altercost(colorless,-2) -auto=lord(sorcery|hand) altercost(colorless,-2) +auto=lord(instant|hand,library,graveyard,exile) altercost(colorless,-2) +auto=lord(sorcery|hand,library,graveyard,exile) altercost(colorless,-2) text=Instant and sorcery spells cost {2} less to cast. mana={4}{U} type=Enchantment @@ -5809,8 +5809,8 @@ subtype=Aura [/card] [card] name=Aura of Silence -auto=lord(artifact|opponenthand) altercost(colorless, +2) -auto=lord(enchantment|opponenthand) altercost(colorless, +2) +auto=lord(artifact|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +2) +auto=lord(enchantment|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +2) auto={S}:destroy target(artifact,enchantment) text=Artifact and enchantment spells your opponents cast cost {2} more to cast. -- Sacrifice Aura of Silence: Destroy target artifact or enchantment. mana={1}{W}{W} @@ -7153,7 +7153,7 @@ toughness=2 [/card] [card] name=Ballyrush Banneret -auto=lord(*[soldier;kithkin]|myhand) altercost(colorless, -1) +auto=lord(*[soldier;kithkin]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) text=Kithkin spells and Soldier spells you cast cost {1} less to cast. mana={1}{W} type=Creature @@ -11869,7 +11869,7 @@ toughness=7 [/card] [card] name=Bosk Banneret -auto=lord(*[treefolk;shaman]|myhand) altercost(colorless, -1) +auto=lord(*[treefolk;shaman]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) text=Treefolk spells and Shaman spells you cast cost {1} less to cast. mana={1}{G} type=Creature @@ -12583,7 +12583,7 @@ type=Enchantment [/card] [card] name=Brighthearth Banneret -auto=lord(*[elemental;warrior]|myhand) altercost(colorless, -1) +auto=lord(*[elemental;warrior]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) autohand={1}{R}{discard}:counter(1/1,1) target(creature) text=Elemental spells and Warrior spells you cast cost {1} less to cast. -- Reinforce 1 - {1}{R} ({1}{R}, Discard this card: Put a +1/+1 counter on target creature.) mana={1}{R} @@ -15323,7 +15323,7 @@ toughness=3 [/card] [card] name=Centaur Omenreader -auto=this(tapped) lord(*|myhand) altercost(colorless, -2) ueot +auto=this(tapped) lord(*|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -2) ueot auto=@untapped(this):all(*|myhand) moveto(myhand) text=As long as Centaur Omenreader is tapped, creature spells you cast cost {2} less to cast. mana={3}{G} @@ -16360,8 +16360,8 @@ toughness=1 [/card] [card] name=Chill -auto=lord(*[red]|myhand) altercost(colorless, +2) -auto=lord(*[red]|opponenthand) altercost(colorless, +2) +auto=lord(*[red]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, +2) +auto=lord(*[red]|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +2) text=Red spells cost {2} more to cast. mana={1}{U} type=Enchantment @@ -17636,11 +17636,11 @@ auto=choice name(Creature) counter(0/0,1,CloudKeyC) all(this) auto=choice name(Enchantment) counter(0/0,1,CloudKeyE) all(this) auto=choice name(Instant) counter(0/0,1,CloudKeyI) all(this) auto=choice name(Sorcery) counter(0/0,1,CloudKeyS) all(this) -auto=this(counter{0/0.1.CloudKeyA}) lord(Artifact|myhand) altercost(colorless,-1) -auto=this(counter{0/0.1.CloudKeyC}) lord(Creature|myhand) altercost(colorless,-1) -auto=this(counter{0/0.1.CloudKeyE}) lord(Enchantment|myhand) altercost(colorless,-1) -auto=this(counter{0/0.1.CloudKeyI}) lord(Instant|myhand) altercost(colorless,-1) -auto=this(counter{0/0.1.CloudKeyS}) lord(Sorcery|myhand) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyA}) lord(Artifact|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyC}) lord(Creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyE}) lord(Enchantment|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyI}) lord(Instant|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyS}) lord(Sorcery|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=As Cloud Key enters the battlefield, choose artifact, creature, enchantment, instant, or sorcery. -- Spells you cast of the chosen type cost {1} less to cast. mana={3} type=Artifact @@ -22109,7 +22109,7 @@ toughness=1 [/card] [card] name=Daru Warchief -auto=lord(soldier|myhand) altercost(colorless, -1) +auto=lord(soldier|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) auto=lord(soldier|myBattlefield) 1/2 text=Soldier spells you cast cost {1} less to cast. -- Soldier creatures you control get +1/+2. mana={2}{W}{W} @@ -24106,7 +24106,7 @@ toughness=1 [/card] [card] name=Derelor -auto=lord(*[black]|myhand) altercost(black, +1) +auto=lord(*[black]|myhand,mylibrary,mygraveyard,myexile) altercost(black, +1) text=Black spells you cast cost {B} more to cast. mana={3}{B} type=Creature @@ -26364,7 +26364,7 @@ toughness=5 [/card] [card] name=Dragonlord's Servant -auto=lord(dragon|myhand) altercost(colorless, -1) +auto=lord(dragon|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) text=Dragon spells you cast cost {1} less to cast. mana={1}{R} type=Creature @@ -26431,7 +26431,7 @@ toughness=2 [/card] [card] name=Dragonspeaker Shaman -auto=lord(dragon|myhand) altercost(colorless,-2) +auto=lord(dragon|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) text=Dragon spells you cast cost {2} less to cast. mana={1}{R}{R} type=Creature @@ -28662,8 +28662,8 @@ type=Instant [/card] [card] name=Edgewalker -auto=lord(cleric|myhand) altercost(white,-1) -auto=lord(cleric|myhand) altercost(black, -1) +auto=lord(cleric|myhand,mylibrary,mygraveyard,myexile) altercost(white,-1) +auto=lord(cleric|myhand,mylibrary,mygraveyard,myexile) altercost(black, -1) text=Cleric spells you cast cost {W}{B} less to cast. This effect reduces only the amount of colored mana you pay. (For example, if you cast a Cleric spell with mana cost {1}{W}, it costs {1} to cast.) mana={1}{W}{B} type=Creature @@ -29895,7 +29895,7 @@ toughness=1 [/card] [card] name=Emerald Medallion -auto=lord(*[green]|myhand) altercost(colorless,-1) +auto=lord(*[green]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Green spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -31394,7 +31394,7 @@ type=Artifact [/card] [card] name=Etherium Sculptor -auto=lord(artifact|myhand) altercost(colorless,-1) +auto=lord(artifact|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Artifact spells you cast cost {1} less to cast. mana={1}{U} type=Artifact Creature @@ -32043,7 +32043,7 @@ mana={3}{W} [/card] [card] name=Eye of Ugin -auto=lord(eldrazi[iscolorless]|myhand) altercost(colorless,-2) +auto=lord(eldrazi[iscolorless]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) auto={7}{T}:moveTo(myhand) target(creature[iscolorless]|myLibrary) text=Colorless Eldrazi spells you cast cost {2} less to cast. -- {7}, {T}: Search your library for a colorless creature card, reveal it, and put it into your hand. Then shuffle your library. type=Legendary Land @@ -33457,7 +33457,7 @@ subtype=Aura [/card] [card] name=Feroz's Ban -auto=lord(creature|hand) altercost(colorless,+2) +auto=lord(creature|hand,library,graveyard,exile) altercost(colorless,+2) text=Creature spells cost {2} more to cast. mana={6} type=Artifact @@ -36592,7 +36592,7 @@ toughness=2 [card] name=Frogtosser Banneret abilities=haste -auto=lord(*[goblin;rogue]|myhand) altercost(colorless, -1) +auto=lord(*[goblin;rogue]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) text=Haste -- Goblin spells and Rogue spells you cast cost {1} less to cast. mana={1}{B} type=Creature @@ -39588,8 +39588,8 @@ toughness=3 [/card] [card] name=Glowrider -auto=lord(*[-creature]|myhand) altercost(colorless,+1) -auto=lord(*[-creature]|opponenthand) altercost(colorless, +1) +auto=lord(*[-creature]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,+1) +auto=lord(*[-creature]|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +1) text=Noncreature spells cost {1} more to cast. mana={2}{W} type=Creature @@ -39665,6 +39665,16 @@ power=3 toughness=1 [/card] [card] +name=Gnat Miser +auto=hmodifer:-1 opponent +text=Each opponent's maximum hand size is reduced by one. +mana={B} +type=Creature +subtype=Rat Shaman +power=1 +toughness=1 +[/card] +[card] name=Gnathosaur auto={S(artifact|mybattlefield)}:trample text=Sacrifice an artifact: Gnathosaur gains trample until end of turn. @@ -40023,7 +40033,7 @@ toughness=4 [/card] [card] name=Goblin Electromancer -auto=lord(*[instant;sorcery]|myhand) altercost(colorless,-1) +auto=lord(*[instant;sorcery]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Instant and sorcery spells you cast cost {1} less to cast. mana={U}{R} type=Creature @@ -40694,7 +40704,7 @@ toughness=3 [/card] [card] name=Goblin Warchief -auto=lord(goblin|myhand) altercost(colorless,-1) +auto=lord(goblin|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) auto=lord(goblin|myBattlefield) haste text=Goblin spells you cast cost {1} less to cast. -- Goblin creatures you control have haste. mana={1}{R}{R} @@ -41381,9 +41391,9 @@ toughness=2 [/card] [card] name=Grand Arbiter Augustin IV -auto=lord(*[white]|myhand) altercost(colorless,-1) -auto=lord(*[blue]|myhand) altercost(colorless,-1) -auto=lord(*|opponenthand) altercost( colorless,+1) +auto=lord(*[white]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[blue]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost( colorless,+1) text=White spells you cast cost {1} less to cast. -- Blue spells you cast cost {1} less to cast. -- Spells your opponents cast cost {1} more to cast. mana={2}{W}{U} type=Legendary Creature @@ -44707,7 +44717,7 @@ toughness=3 [card] name=Heartless Summoning auto=lord(creature|myBattlefield) -1/-1 -auto=lord(creature|myhand) altercost( colorless,-2) +auto=lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost( colorless,-2) text=Creature spells you cast cost {2} less to cast. -- Creatures you control get -1/-1 mana={1}{B} type=Enchantment @@ -45272,7 +45282,7 @@ toughness=1 [/card] [card] name=Helm of Awakening -auto=lord(*|hand) altercost(colorless,-1) +auto=lord(*|hand,library,graveyard,exile) altercost(colorless,-1) text=Spells cost {1} less to cast. mana={2} type=Artifact @@ -45385,7 +45395,7 @@ toughness=4 name=Herald of War abilities=flying auto=@combat(attacking) source(this):counter(1/1,1) -auto=thisforeach(counter{1/1,1}) lord(*[angel;human]|myhand) altercost(colorless, -1) +auto=thisforeach(counter{1/1,1}) lord(*[angel;human]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) text=Flying -- Whenever Herald of War attacks, put a +1/+1 counter on it. -- Angel spells and Human spells you cast cost {1} less to cast for each +1/+1 counter on Herald of War. mana={3}{W}{W} type=Creature @@ -45423,7 +45433,7 @@ toughness=2 [/card] [card] name=Herald of the Pantheon -auto=lord(enchantment|myhand) altercost(colorless, -1) +auto=lord(enchantment|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) auto=@movedto(enchantment|mystack):choice life:1 controller text=Enchantment spells you cast cost {1} less to cast. -- Whenever you cast an enchantment spell, you gain 1 life. mana={1}{G} @@ -45478,7 +45488,7 @@ toughness=4 [/card] [card] name=Hero of Iroas -auto=lord(aura|myhand) altercost(colorless,-1) +auto=lord(aura|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) auto=@targeted(this) from(*[instant;sorcery;enchantment]|myhand,mygraveyard):counter(1/1,1) text=Aura spells you cast cost 1 less to cast. -- Heroic -- Whenever you cast a spell that targets Hero of Iroas, put a +1/+1 counter on Hero of Iroas. mana={1}{W} @@ -45744,7 +45754,7 @@ toughness=1 [/card] [card] name=High Seas -auto=lord(creature[red;green]|hand) altercost(colorless,+1) +auto=lord(creature[red;green]|hand,library,graveyard,exile) altercost(colorless,+1) text=Red creature spells and green creature spells cost {1} more to cast. mana={2}{U} type=Enchantment @@ -49462,7 +49472,7 @@ toughness=2 [/card] [card] name=Irini Sengir -auto=lord(enchantment[white;green]|hand) altercost(colorless,+1) +auto=lord(enchantment[white;green]|hand,library,graveyard,exile) altercost(colorless,+1) text=White enchantment spells and green enchantment spells cost {2} more to cast. mana={2}{B}{B} type=Legendary Creature @@ -50063,7 +50073,7 @@ toughness=8 [/card] [card] name=Jade Leech -auto=lord(*[green]|myhand) altercost(green,+1) +auto=lord(*[green]|myhand,mylibrary,mygraveyard,myexile) altercost(green,+1) text=Green spells you cast cost {G} more to cast. mana={2}{G}{G} type=Creature @@ -50418,7 +50428,7 @@ type=Artifact [/card] [card] name=Jet Medallion -auto=lord(*[black]|myhand) altercost(colorless,-1) +auto=lord(*[black]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Black spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -50552,7 +50562,7 @@ type=Instant name=Jin-Gitaxias, Core Augur abilities=flash auto=@each my end:draw:7 -auto=@each opponent cleanup:name(check handsize) ability$!choice name(reduce handsize) reject notatarget(<7>*|myhand)!$ opponent +auto=hmodifer:-7 opponent mana={8}{U}{U} type=Legendary Creature subtype=Praetor @@ -54377,7 +54387,7 @@ toughness=2 [/card] [card] name=Krosan Drover -auto=lord(creature[manacost>=6]|myhand) altercost(colorless,-2) +auto=lord(creature[manacost>=6]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) text=Creature spells you cast with converted mana cost 6 or more cost {2} less to cast. mana={3}{G} type=Creature @@ -54437,7 +54447,7 @@ toughness=5 [card] name=Krosan Warchief auto={1}{G}:regenerate target(beast) -auto=lord(beast|myhand) altercost(colorless,-1) +auto=lord(beast|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Beast spells you cast cost {1} less to cast. -- {1}{G}: Regenerate target Beast. mana={2}{G} type=Creature @@ -57324,7 +57334,7 @@ toughness=2 [/card] [card] name=Locust Miser -auto=@each opponent cleanup:name(check handsize) ability$!choice name(reduce handsize) reject notatarget(<2>*|myhand)!$ opponent +auto=hmodifer:-2 opponent text=Each opponent's maximum hand size is reduced by two. mana={2}{B}{B} type=Creature @@ -57354,7 +57364,7 @@ type=Artifact [/card] [card] name=Lodestone Golem -auto=lord(*[-artifact]|hand) altercost(colorless,+1) +auto=lord(*[-artifact]|hand,library,graveyard,exile) altercost(colorless,+1) text=Nonartifact spells cost {1} more to cast. mana={4} type=Artifact Creature @@ -57413,7 +57423,7 @@ toughness=2 [/card] [card] name=Long-Forgotten Gohei -auto=lord(arcane|myhand) altercost(colorless,-1) +auto=lord(arcane|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) auto=lord(spirit|myBattlefield) 1/1 text=Arcane spells you cast cost {1} less to cast. -- Spirit creatures you control get +1/+1. mana={3} @@ -59285,8 +59295,8 @@ type=Instant [/card] [card] name=Mana Matrix -auto=lord(instant|myhand) altercost(colorless,-2) -auto=lord(enchantment|myhand) altercost(colorless,-2) +auto=lord(instant|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=lord(enchantment|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) text=Instant and enchantment spells you cast cost up to {2} less to cast. mana={6} type=Artifact @@ -62150,6 +62160,17 @@ mana={2}{G} type=Sorcery [/card] [card] +name=Minamo Scrollkeeper +abilities=defender +auto=hmodifer:1 controller +text=Defender (This creature can't attack.) -- Your maximum hand size is increased by one. +mana={1}{U} +type=Creature +subtype=Human Wizard +power=2 +toughness=3 +[/card] +[card] name=Minamo Sightbender auto={X}{T}:target(creature[power <=X]) unblockable text={X}, {T}: Target creature with power X or less is unblockable this turn. @@ -63277,7 +63298,7 @@ toughness=4 [/card] [card] name=Mistform Warchief -auto=lord(creature[share!types!]|myhand) altercost(colorless,-1) chooseend +auto=lord(creature[share!types!]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) chooseend auto={T}:activatechooseatype all(this) becomes(removecreaturesubtypes) && becomes(chosentype) ueot activatechooseend text=Creature spells you cast that share a creature type with Mistform Warchief cost {1} less to cast. -- {T}: Mistform Warchief becomes the creature type of your choice until end of turn. mana={2}{U} @@ -67326,7 +67347,7 @@ toughness=1 [/card] [card] name=Nightscape Familiar -auto=lord(*[blue;red]|myhand) altercost(colorless,-1) +auto=lord(*[blue;red]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) auto={1}{B}:regenerate text=Blue spells and red spells you cast cost {1} less to cast. -- {1}{B}: Regenerate Nightscape Familiar. mana={1}{B} @@ -71453,7 +71474,7 @@ toughness=7 [/card] [card] name=Pearl Medallion -auto=lord(*[white]|myhand) altercost(colorless,-1) +auto=lord(*[white]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=White spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -73586,7 +73607,7 @@ type=Sorcery [/card] [card] name=Planar Gate -auto=lord(creature|myhand) altercost(colorless,-2) +auto=lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) text=Creature spells you cast cost up to {2} less to cast. mana={6} type=Artifact @@ -76774,8 +76795,8 @@ toughness=3 [/card] [card] name=Ragemonger -auto=lord(minotaur|myhand) altercost(black,-1) -auto=lord(minotaur|myhand) altercost(red,-1) +auto=lord(minotaur|myhand,mylibrary,mygraveyard,myexile) altercost(black,-1) +auto=lord(minotaur|myhand,mylibrary,mygraveyard,myexile) altercost(red,-1) text=Minotaur spells you cast cost BlackRed less to cast. This effect reduces only the amount of colored mana you pay. (For example, if you cast a Minotaur spell with mana cost 2Red, it costs 2 to cast.) mana={1}{B}{R} type=Creature @@ -81893,7 +81914,7 @@ toughness=* [card] name=Ruby Leech abilities=first strike -auto=lord(*[red]|myhand) altercost(red,+1) +auto=lord(*[red]|myhand,mylibrary,mygraveyard,myexile) altercost(red,+1) text=First strike -- Red spells you cast cost {R} more to cast. mana={1}{R} type=Creature @@ -81903,7 +81924,7 @@ toughness=2 [/card] [card] name=Ruby Medallion -auto=lord(*[red]|myhand) altercost(colorless,-1) +auto=lord(*[red]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Red spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -83470,7 +83491,7 @@ toughness=4 [card] name=Sapphire Leech abilities=flying -auto=lord(*[blue]|myhand) altercost(blue,+1) +auto=lord(*[blue]|myhand,mylibrary,mygraveyard,myexile) altercost(blue,+1) text=Flying -- Blue spells you cast cost {U} more to cast. mana={1}{U} type=Creature @@ -83480,7 +83501,7 @@ toughness=2 [/card] [card] name=Sapphire Medallion -auto=lord(*[blue]|myhand) altercost(colorless,-1) +auto=lord(*[blue]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Blue spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -86257,20 +86278,20 @@ auto=choice name(Sorcery) moveTo(myexile) notatarget(sorcery|myhand) && counter( auto=choice name(Tribal Instant) moveTo(myexile) notatarget(instant[tribal]|myhand) && counter(0/0,1,TribalInstant) all(this) auto=choice name(Tribal Sorcery) moveTo(myexile) notatarget(sorcery[tribal]|myhand) && counter(0/0,1,TribalSorcery) all(this) auto=choice name(cancel) donothing -auto=this(counter{0/0.1.Artifact}) lord(artifact|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.ArtifactCreature}) lord(artifact[-creature]|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.ArtifactCreature}) lord(creature[-artifact]|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.ArtifactCreature}) lord(creature[artifact]|myhand) altercost(colorless,-2 ) -auto=this(counter{0/0.1.Creature}) lord(creature|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.Enchantment}) lord(enchantment|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.Instant}) lord(instant|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.Sorcery}) lord(sorcery|myhand) altercost( colorless, -2 ) -auto=this(counter{0/0.1.TribalInstant}) lord(tribal[-instant]|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.TribalInstant}) lord(instant[-tribal]|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.TribalInstant}) lord(instant[tribal]|myhand) altercost(colorless,-2 ) -auto=this(counter{0/0.1.TribalSorcery}) lord(tribal[-sorcery]|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.TribalSorcery}) lord(sorcery[-tribal]|myhand) altercost(colorless,-2) -auto=this(counter{0/0.1.TribalSorcery}) lord(sorcery[tribal]|myhand) altercost(colorless,-2) +auto=this(counter{0/0.1.Artifact}) lord(artifact|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.ArtifactCreature}) lord(artifact[-creature]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.ArtifactCreature}) lord(creature[-artifact]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.ArtifactCreature}) lord(creature[artifact]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2 ) +auto=this(counter{0/0.1.Creature}) lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.Enchantment}) lord(enchantment|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.Instant}) lord(instant|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.Sorcery}) lord(sorcery|myhand,mylibrary,mygraveyard,myexile) altercost( colorless, -2 ) +auto=this(counter{0/0.1.TribalInstant}) lord(tribal[-instant]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.TribalInstant}) lord(instant[-tribal]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.TribalInstant}) lord(instant[tribal]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2 ) +auto=this(counter{0/0.1.TribalSorcery}) lord(tribal[-sorcery]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.TribalSorcery}) lord(sorcery[-tribal]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.TribalSorcery}) lord(sorcery[tribal]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) text=Imprint - When Semblance Anvil enters the battlefield, you may exile a nonland card from your hand. -- Spells you cast that share a card type with the exiled card cost {2} less to cast. mana={3} type=Artifact @@ -93716,7 +93737,7 @@ toughness=3 [/card] [card] name=Sphere of Resistance -auto=lord(*|hand) altercost(colorless,+1) +auto=lord(*|hand,library,graveyard,exile) altercost(colorless,+1) text=Spells cost {1} more to cast. mana={2} type=Artifact @@ -95069,7 +95090,7 @@ type=Artifact [card] name=Squeeze text=Sorcery spells cost {3} more to cast. -auto=lord(sorcery|hand) altercost(colorless,+3) +auto=lord(sorcery|hand,library,graveyard,exile) altercost(colorless,+3) mana={3}{U} type=Enchantment [/card] @@ -96065,7 +96086,7 @@ toughness=1 [/card] [card] name=Stinkdrinker Daredevil -auto=lord(giant|myhand) altercost(colorless,-2) +auto=lord(giant|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) text=Giant spells you cast cost {2} less to cast. mana={2}{R} type=Creature @@ -96206,7 +96227,7 @@ subtype=Mountain Forest [/card] [card] name=Stone Calendar -auto=lord(*|myhand) altercost(colorless,-1) +auto=lord(*|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Spells you cast cost up to {1} less to cast. mana={5} type=Artifact @@ -96477,7 +96498,7 @@ toughness=2 [card] name=Stonybrook Banneret abilities=islandwalk -auto=lord(*[merfolk;wizard]|myhand) altercost(colorless, -1) +auto=lord(*[merfolk;wizard]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) text=Islandwalk -- Merfolk spells and Wizard spells you cast cost {1} less to cast. mana={1}{U} type=Creature @@ -96664,7 +96685,7 @@ toughness=1 [card] name=Stormscape Familiar abilities=flying -auto=lord(*[white;black]|myhand) altercost(colorless,-1) +auto=lord(*[white;black]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Flying -- White spells and black spells you cast cost {1} less to cast. mana={1}{U} type=Creature @@ -97918,7 +97939,7 @@ toughness=1 [card] name=Sunscape Familiar abilities=defender -auto=lord(*[green;blue]|myhand) altercost(colorless,-1) +auto=lord(*[green;blue]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Defender (This creature can't attack.) -- Green spells and blue spells you cast cost {1} less to cast. mana={1}{W} type=Creature @@ -101111,8 +101132,8 @@ toughness=2 [card] name=Thalia, Guardian of Thraben abilities=first strike -auto=lord(*[-creature]|myhand) altercost(colorless,+1) -auto=lord(*[-creature]|opponenthand) altercost(colorless, +1) +auto=lord(*[-creature]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,+1) +auto=lord(*[-creature]|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +1) text=First Strike -- Noncreature spells cost {1} more to cast. mana={1}{W} type=Legendary Creature @@ -101583,7 +101604,7 @@ toughness=7 [/card] [card] name=Thorn of Amethyst -auto=lord(*[-creature]|hand) altercost(colorless,+1) +auto=lord(*[-creature]|hand,library,graveyard,exile) altercost(colorless,+1) text=Noncreature spells cost {1} more to cast. mana={2} type=Artifact @@ -101657,7 +101678,7 @@ toughness=1 [/card] [card] name=Thornscape Familiar -auto=lord(*[red;white]|myhand) altercost(colorless,-1) +auto=lord(*[red;white]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=Red spells and white spells you cast cost {1} less to cast. mana={1}{G} type=Creature @@ -101753,6 +101774,28 @@ power=1 toughness=1 [/card] [card] +name=Thought Devourer +abilities=flying +auto=hmodifer:-4 controller +text=Flying -- Your maximum hand size is reduced by four. +mana={2}{U}{U} +type=Creature +subtype=Beast +power=4 +toughness=4 +[/card] +[card] +name=Thought Eater +abilities=flying +auto=hmodifer:-3 controller +text=Flying -- Your maximum hand size is reduced by three. +mana={1}{U} +type=Creature +subtype=Beast +power=2 +toughness=2 +[/card] +[card] name=Thought Gorger abilities=trample auto=foreach(*|myhand) counter(1/1,1) && reject all(*|myhand) @@ -101773,6 +101816,17 @@ mana={2}{U}{U} type=Enchantment [/card] [card] +name=Thought Nibbler +abilities=flying +auto=hmodifer:-2 controller +text=Flying -- Your maximum hand size is reduced by two. +mana={U} +type=Creature +subtype=Beast +power=1 +toughness=1 +[/card] +[card] name=Thought Reflection auto=replacedraw draw:2 noreplace text=If you would draw a card, draw two cards instead. @@ -102504,7 +102558,7 @@ toughness=1 [card] name=Thunderscape Familiar abilities=first strike -auto=lord(*[black;green]|myhand) altercost(colorless,-1) +auto=lord(*[black;green]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) text=First strike -- Black spells and green spells you cast cost {1} less to cast. mana={1}{R} type=Creature @@ -105301,6 +105355,17 @@ mana={2}{R} type=Instant [/card] [card] +name=Trusted Advisor +auto=hmodifer:2 controller +auto=@each my upkeep:moveTo(ownerhand) notatarget(creature[blue]|myBattlefield) +text=Your maximum hand size is increased by two. -- At the beginning of your upkeep, return a blue creature you control to its owner's hand. +mana={U} +type=Creature +subtype=Human Advisor +power=1 +toughness=2 +[/card] +[card] name=Trusted Forcemage auto=soulbond 1/1 abilities=soulbond @@ -106196,7 +106261,7 @@ toughness=2 [card] name=Undead Warchief auto=lord(zombie|myBattlefield) 2/1 -auto=lord(zombie|myhand) altercost( colorless,-1) +auto=lord(zombie|myhand,mylibrary,mygraveyard,myexile) altercost( colorless,-1) text=Zombie spells you cast cost {1} less to cast. -- Zombie creatures you control get +2/+1. mana={2}{B}{B} type=Creature @@ -107088,7 +107153,7 @@ subtype=Urza's [/card] [card] name=Urza's Filter -auto=lord(*[multicolor]|hand) altercost(colorless,-2) +auto=lord(*[multicolor]|hand,library,graveyard,exile) altercost(colorless,-2) text=Multicolored spells cost up to {2} less to cast. mana={4} type=Artifact @@ -107102,7 +107167,7 @@ type=Sorcery [/card] [card] name=Urza's Incubator -auto=chooseatype lord(creature[chosentype]|myhand) altercost(colorless,-2) chooseend +auto=chooseatype lord(creature[chosentype]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) chooseend text=As Urza's Incubator enters the battlefield, choose a creature type. -- Creature spells of the chosen type cost {2} less to cast. mana={3} type=Artifact @@ -110468,8 +110533,7 @@ color=black [card] name=Vryn Wingmare abilities=flying -auto=lord(*[-creature]|myhand) altercost(colorless,+1) -auto=lord(*[-creature]|opponenthand) altercost(colorless, +1) +auto=lord(*[-creature]|hand,library,graveyard,exile) altercost(colorless, +1) text=Flying -- Noncreature spells cost {1} more to cast. mana={2}{W} type=Creature diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 1432ba3ff..77ec526d5 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -6120,15 +6120,6 @@ mana={G} type=Instant [/card] [card] -name=Gnat Miser -text=Each opponent's maximum hand size is reduced by one. -mana={B} -type=Creature -subtype=Rat Shaman -power=1 -toughness=1 -[/card] -[card] name=Goblin Artisans text={T}: Flip a coin. If you win the flip, draw a card. If you lose the flip, counter target artifact spell you control that isn't the target of an ability from another creature named Goblin Artisans. mana={R} @@ -9837,15 +9828,6 @@ type=Artifact text=Imprint — Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with Mimic Vat to its owner's graveyard. {3}, {T}: Put a token onto the battlefield that's a copy of the exiled card. It gains haste. Exile it at the beginning of the next end step. [/card] [card] -name=Minamo Scrollkeeper -text=Defender (This creature can't attack.) -- Your maximum hand size is increased by one. -mana={1}{U} -type=Creature -subtype=Human Wizard -power=2 -toughness=3 -[/card] -[card] name=Minamo's Meddling text=Counter target spell. That spell's controller reveals his or her hand, then discards each card with the same name as a card spliced onto that spell. mana={2}{U}{U} @@ -16641,45 +16623,18 @@ power=2 toughness=2 [/card] [card] -name=Thought Devourer -text=Flying -- Your maximum hand size is reduced by four. -mana={2}{U}{U} -type=Creature -subtype=Beast -power=4 -toughness=4 -[/card] -[card] name=Thought Dissector text={X}, {T}: Target opponent reveals cards from the top of his or her library until an artifact card or X cards are revealed, whichever comes first. If an artifact card is revealed this way, put it onto the battlefield under your control and sacrifice Thought Dissector. Put the rest of the revealed cards into that player's graveyard. mana={4} type=Artifact [/card] [card] -name=Thought Eater -text=Flying -- Your maximum hand size is reduced by three. -mana={1}{U} -type=Creature -subtype=Beast -power=2 -toughness=2 -[/card] -[card] name=Thought Hemorrhage text=Name a nonland card. Target player reveals his or her hand. Thought Hemorrhage deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library. mana={2}{B}{R} type=Sorcery [/card] [card] -name=Thought Nibbler -text=Flying -- Your maximum hand size is reduced by two. -mana={U} -type=Creature -subtype=Beast -power=1 -toughness=1 -[/card] -[card] name=Thought Prison text=Imprint - When Thought Prison enters the battlefield, you may have target player reveal his or her hand. If you do, choose a nonland card from it and exile that card. -- Whenever a player casts a spell that shares a color or converted mana cost with the exiled card, Thought Prison deals 2 damage to that player. mana={5} @@ -17174,15 +17129,6 @@ power=3 toughness=3 [/card] [card] -name=Trusted Advisor -text=Your maximum hand size is increased by two. -- At the beginning of your upkeep, return a blue creature you control to its owner's hand. -mana={U} -type=Creature -subtype=Human Advisor -power=1 -toughness=2 -[/card] -[card] name=Truth or Tale text=Reveal the top five cards of your library and separate them into two piles. An opponent chooses one of those piles. Put a card from the chosen pile into your hand, then put all other cards revealed this way on the bottom of your library in any order. mana={1}{U} diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 88b6a4d78..dbf7edf41 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -195,11 +195,10 @@ private: } else if (s == "manacost") { - int convertedvalue = card->currentZone == card->controller()->game->battlefield ? card->getManaCost()->getConvertedCost():card->model->data->getManaCost()->getConvertedCost(); if (target->currentZone == target->controller()->game->stack)//X is 0 except if it's on the stack - intValue = target->getManaCost()->getConvertedCost() + target->castX; + intValue = target->myconvertedcost + target->castX; else - intValue = convertedvalue; + intValue = target->myconvertedcost; } else if (s == "azorius")//devotion blue white { @@ -4087,6 +4086,20 @@ public: } }; +//Modify Hand +class AModifyHand: public AbilityTP +{ +public: + string hand; + AModifyHand(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, string hand, int who = TargetChooser::UNSET); + int addToGame(); + int destroy(); + const string getMenuText(); + AModifyHand * clone() const; + //~AModifyHand(); + +}; + //set a players hand size class AASetHand: public ActivatedAbilityTP { diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index 25fcf745b..3771a3c27 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -122,6 +122,8 @@ 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/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 6600e7a1e..56c887459 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -255,6 +255,7 @@ public: int cardistargetter; int tmodifier; int tmodifierb; + int myconvertedcost; void eventattacked(); void eventattackedAlone(); diff --git a/projects/mtg/include/Player.h b/projects/mtg/include/Player.h index eac30a20e..2d356e24f 100644 --- a/projects/mtg/include/Player.h +++ b/projects/mtg/include/Player.h @@ -45,6 +45,7 @@ public: int epic; int initLife; int raidcount; + int handmodifier; vector prowledTypes; vectorcurses; Player(GameObserver *observer, string deckFile, string deckFileSmall, MTGDeck * deck = NULL); diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index ccf0e714d..81f7d33d8 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -2501,6 +2501,49 @@ AALifer * AALifer::clone() const return NEW AALifer(*this); } +//players modify hand size +AModifyHand::AModifyHand(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, string hand, int who) : + AbilityTP(observer, _id, _source, _target, who), hand(hand) +{ +} + +int AModifyHand::addToGame() +{ + Damageable * _target = (Damageable *) getTarget(); + Player * p = getPlayerFromDamageable(_target); + + if (!p) + return 0; + + WParsedInt handmodifier(hand, NULL, source); + p->handmodifier += handmodifier.getValue(); + + return MTGAbility::addToGame(); +} + +int AModifyHand::destroy() +{ + Damageable * _target = (Damageable *) getTarget(); + Player * p = getPlayerFromDamageable(_target); + + if (!p) + return 0; + + WParsedInt handmodifier(hand, NULL, source); + p->handmodifier -= handmodifier.getValue(); + + return 1; +} + +const string AModifyHand::getMenuText() +{ + return "Modify Hand Size"; +} + +AModifyHand * AModifyHand::clone() const +{ + return NEW AModifyHand(*this); +} //players max hand size AASetHand::AASetHand(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int hand, ManaCost * _cost, diff --git a/projects/mtg/src/CardDescriptor.cpp b/projects/mtg/src/CardDescriptor.cpp index a3bc1c773..64951c818 100644 --- a/projects/mtg/src/CardDescriptor.cpp +++ b/projects/mtg/src/CardDescriptor.cpp @@ -125,12 +125,11 @@ MTGCardInstance * CardDescriptor::match_or(MTGCardInstance * card) } // Quantified restrictions are always AND-ed: - int convertedvalue = card->currentZone == card->controller()->game->battlefield ? card->getManaCost()->getConvertedCost():card->model->data->getManaCost()->getConvertedCost(); if (powerComparisonMode && !valueInRange(powerComparisonMode, card->getPower(), power)) return NULL; if (toughnessComparisonMode && !valueInRange(toughnessComparisonMode, card->getToughness(), toughness)) return NULL; - if (manacostComparisonMode && !valueInRange(manacostComparisonMode, convertedvalue, convertedManacost)) + if (manacostComparisonMode && !valueInRange(manacostComparisonMode, card->myconvertedcost, convertedManacost)) return NULL; if (nameComparisonMode && compareName != card->name) return NULL; @@ -166,12 +165,12 @@ MTGCardInstance * CardDescriptor::match_and(MTGCardInstance * card) if ((mColorExclusions & card->colors) != 0) match = NULL; } - int convertedvalue = card->currentZone == card->controller()->game->battlefield ? card->getManaCost()->getConvertedCost():card->model->data->getManaCost()->getConvertedCost(); + if (powerComparisonMode && !valueInRange(powerComparisonMode, card->getPower(), power)) match = NULL; if (toughnessComparisonMode && !valueInRange(toughnessComparisonMode, card->getToughness(), toughness)) match = NULL; - if (manacostComparisonMode && !valueInRange(manacostComparisonMode, convertedvalue, convertedManacost)) + if (manacostComparisonMode && !valueInRange(manacostComparisonMode, card->myconvertedcost, convertedManacost)) match = NULL; if(nameComparisonMode && compareName != card->name) match = NULL; diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 01a1fc1ab..a84429bd1 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -225,8 +225,12 @@ void GameObserver::nextGamePhase() if (mCurrentGamePhase == MTG_PHASE_AFTER_EOT) { + int handmodified = 0; + handmodified = currentPlayer->handsize+currentPlayer->handmodifier; //Auto Hand cleaning, in case the player didn't do it himself - while (currentPlayer->game->hand->nb_cards > currentPlayer->handsize && currentPlayer->nomaxhandsize == false) + if(handmodified < 0) + handmodified = 0; + while (currentPlayer->game->hand->nb_cards > handmodified && currentPlayer->nomaxhandsize == false) { WEvent * e = NEW WEventCardDiscard(currentPlayer->game->hand->cards[0]); receiveEvent(e); @@ -881,86 +885,8 @@ void GameObserver::gameStateBasedEffects() // plus modify costs // ///////////////////////////// Affinity(); - //trinisphere? - /*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; - } - //alternate - if(zone->cards[ct]->getManaCost()->getAlternative() && zone->cards[ct]->getManaCost()->getAlternative()->getConvertedCost() == 2) - { - zone->cards[ct]->getManaCost()->getAlternative()->add(Constants::MTG_COLOR_ARTIFACT, 1); - zone->cards[ct]->tmodifierb = 1; - } - else if(zone->cards[ct]->getManaCost()->getAlternative() && zone->cards[ct]->getManaCost()->getAlternative()->getConvertedCost() == 1) - { - zone->cards[ct]->getManaCost()->getAlternative()->add(Constants::MTG_COLOR_ARTIFACT, 2); - zone->cards[ct]->tmodifierb = 2; - } - else if(zone->cards[ct]->getManaCost()->getAlternative() && zone->cards[ct]->getManaCost()->getAlternative()->getConvertedCost() < 1) - { - zone->cards[ct]->getManaCost()->getAlternative()->add(Constants::MTG_COLOR_ARTIFACT, 3); - zone->cards[ct]->tmodifierb = 3; - } - } - else - { - if(zone->cards[ct]->tmodifier == 1) - { - zone->cards[ct]->getManaCost()->remove(Constants::MTG_COLOR_ARTIFACT, 1); - zone->cards[ct]->tmodifier = 0; - } - else if(zone->cards[ct]->tmodifier == 2) - { - zone->cards[ct]->getManaCost()->remove(Constants::MTG_COLOR_ARTIFACT, 2); - zone->cards[ct]->tmodifier = 0; - } - else if(zone->cards[ct]->tmodifier == 3) - { - zone->cards[ct]->getManaCost()->remove(Constants::MTG_COLOR_ARTIFACT, 3); - zone->cards[ct]->tmodifier = 0; - } - //alternate - if(zone->cards[ct]->tmodifierb == 1) - { - zone->cards[ct]->getManaCost()->getAlternative()->remove(Constants::MTG_COLOR_ARTIFACT, 1); - zone->cards[ct]->tmodifierb = 0; - } - else if(zone->cards[ct]->tmodifierb == 2) - { - zone->cards[ct]->getManaCost()->getAlternative()->remove(Constants::MTG_COLOR_ARTIFACT, 2); - zone->cards[ct]->tmodifierb = 0; - } - else if(zone->cards[ct]->tmodifierb == 3) - { - zone->cards[ct]->getManaCost()->getAlternative()->remove(Constants::MTG_COLOR_ARTIFACT, 3); - zone->cards[ct]->tmodifierb = 0; - } - } - } - } - }*/ + //trinisphere? buggy... + //ComputeTrinisphere(); //end trinisphere ///////////////////////////////////// // Check colored statuses on cards // @@ -1082,8 +1008,10 @@ void GameObserver::Affinity() } } } - card->getManaCost()->copy(original); - card->getManaCost()->setAlternative(alternate); + if(card->getManaCost()) + card->getManaCost()->copy(original); + if(card->getManaCost()->getAlternative()) + card->getManaCost()->setAlternative(alternate); if(card->getManaCost()->extraCosts) { for(unsigned int i = 0; i < card->getManaCost()->extraCosts->costs.size();i++) @@ -1202,6 +1130,79 @@ void GameObserver::Affinity() } } } + +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) @@ -1367,6 +1368,7 @@ int GameObserver::cardClick(MTGCardInstance * card, Targetable * object, bool lo { Player * clickedPlayer = NULL; int toReturn = 0; + int handmodified = 0; MTGGameZone* zone = NULL; size_t index = 0; MTGCardInstance* backup = NULL; @@ -1484,8 +1486,11 @@ int GameObserver::cardClick(MTGCardInstance * card, Targetable * object, bool lo } //Current player's hand + handmodified = currentPlayer->handsize+currentPlayer->handmodifier; + if(handmodified < 0) + handmodified = 0; if (currentPlayer->game->hand->hasCard(card) && mCurrentGamePhase == MTG_PHASE_CLEANUP - && currentPlayer->game->hand->nb_cards > currentPlayer->handsize && currentPlayer->nomaxhandsize == false) + && currentPlayer->game->hand->nb_cards > handmodified && currentPlayer->nomaxhandsize == false) { WEvent * e = NEW WEventCardDiscard(currentPlayer->game->hand->cards[0]); receiveEvent(e); diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 870927178..475d8e68f 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2583,6 +2583,15 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return a; } + //modify hand size - reduce maximum or increase + vector splitHandMod = parseBetween(s, "hmodifer:", " ", false); + if (splitHandMod.size()) + { + Damageable * t = spell ? spell->getNextDamageableTarget() : NULL; + MTGAbility * a = NEW AModifyHand(observer, id, card, t, splitHandMod[1], who); + return a; + } + //set hand size vector splitSetHand = parseBetween(s, "sethand:", " ", false); if (splitSetHand.size()) diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 287acfdb7..02d5086fa 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -67,6 +67,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to cardistargetter = 0; tmodifier = 0; tmodifierb = 0; + myconvertedcost = getManaCost()->getConvertedCost(); } MTGCardInstance * MTGCardInstance::createSnapShot() diff --git a/projects/mtg/src/Player.cpp b/projects/mtg/src/Player.cpp index cd1a2c77a..fe5c07931 100644 --- a/projects/mtg/src/Player.cpp +++ b/projects/mtg/src/Player.cpp @@ -35,6 +35,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck * drawCounter = 0; epic = 0; raidcount = 0; + handmodifier = 0; prowledTypes.clear(); doesntEmpty = NEW ManaCost(); poolDoesntEmpty = NEW ManaCost();