diff --git a/.travis.yml b/.travis.yml index 1e9ec26b7..350076d22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,9 +30,7 @@ before_install: export ANDROID="android-sdk-linux/tools/android" && if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi && wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv && - wget http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz -nv && - tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 && - tar -zxf android-sdk_r24.3.4-linux.tgz; + wget http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz -nv; fi # Building for Qt here - if [ "$BUILD_Qt" == "YES" ]; then @@ -53,6 +51,8 @@ install: tar -x --xz -f sdk.lzma; fi - if [ "$BUILD_ANDROID" == "YES" ]; then + tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 && + tar -zxf android-sdk_r24.3.4-linux.tgz && $ANDROID list sdk --extended -a && echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-23.0.1,android-10 --no-ui --force --no-https; fi diff --git a/projects/mtg/bin/Res/graphics/backdrop.jpg b/projects/mtg/bin/Res/graphics/backdrop.jpg index c421d570d..ac5fbf9c3 100644 Binary files a/projects/mtg/bin/Res/graphics/backdrop.jpg and b/projects/mtg/bin/Res/graphics/backdrop.jpg differ diff --git a/projects/mtg/bin/Res/graphics/miconslarge.png b/projects/mtg/bin/Res/graphics/miconslarge.png new file mode 100644 index 000000000..0bc690c76 Binary files /dev/null and b/projects/mtg/bin/Res/graphics/miconslarge.png differ diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 37f37ddf5..a9f5903f0 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -1,5 +1,16 @@ grade=borderline [card] +name=Arrogant Wurm +abilities=trample,madness +autoexile=restriction{discarded} pay({2}{G}) name(pay 2G to cast) activate name(pay 2G to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +text=Trample -- Madness {2}{G} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={3}{G}{G} +type=Creature +subtype=Wurm +power=4 +toughness=4 +[/card] +[card] name=Autumn Willow abilities=opponentshroud,shroud auto={G}:-shroud @@ -24,6 +35,40 @@ power=2 toughness=2 [/card] [card] +name=Basking Rootwalla +abilities=madness +autoexile=restriction{discarded} pay({0}) name(pay 0 to cast) activate name(pay 0 to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto={1}{G}:2/2 limit:1 +text={1}{G}: Basking Rootwalla gets +2/+2 until end of turn. Activate this ability only once each turn. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={G} +type=Creature +subtype=Lizard +power=1 +toughness=1 +[/card] +[card] +name=Big Game Hunter +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) +auto=bury target(creature[power>=4]) +text=When Big Game Hunter enters the battlefield, destroy target creature with power 4 or greater. It can't be regenerated. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={1}{B}{B} +type=Creature +subtype=Human Rebel Assassin +power=1 +toughness=1 +[/card] +[card] +name=Call to the Netherworld +abilities=madness +autoexile=restriction{discarded} pay({0}) name(pay 0 to cast) activate name(pay 0 to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature[black]|myGraveyard +auto=moveTo(myHand) +text=Return target black creature card from your graveyard to your hand. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={B} +type=Sorcery +[/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. @@ -44,6 +89,16 @@ mana={1}{B}{G} type=Instant [/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) +target=creature[-black] +auto=destroy +text=Destroy target nonblack creature. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={4}{B}{B} +type=Instant +[/card] +[card] name=Feral Hydra type=Creature subtype=Hydra Beast @@ -56,6 +111,26 @@ auto={3}:counter(1/1) #Not all player can use ability [/card] [card] +name=Fiery Temper +abilities=madness +autoexile=restriction{discarded} pay({R}) name(pay R to cast) activate name(pay R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature,player +auto=damage:3 +text=Fiery Temper deals 3 damage to target creature or player. -- Madness {R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={1}{R}{R} +type=Instant +[/card] +[card] +name=Frantic Purification +abilities=madness +autoexile=restriction{discarded} pay({W}) name(pay W to cast) activate name(pay W to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=enchantment +auto=destroy +text=Destroy target enchantment. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={2}{W} +type=Instant +[/card] +[card] name=Ghastly Remains auto=foreach(zombie|myhand) counter(1/1,1) autograveyard={B}{B}{B}:moveTo(myhand) myUpkeepOnly @@ -77,6 +152,18 @@ power=4 toughness=4 [/card] [card] +name=Gorgon Recluse +abilities=madness +autoexile=restriction{discarded} pay({B}{B}) name(pay BB to cast) activate name(pay BB to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto=@combat(blocked,blocking) source(this) from(creature):all(trigger[from]) phaseaction[combatends once] destroy +text=Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. -- Madness {B}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={3}{B}{B} +type=Creature +subtype=Gorgon +power=2 +toughness=4 +[/card] +[card] name=Govern the Guildless target=creature[-multicolor] auto=moveto(mybattlefield) @@ -86,6 +173,17 @@ mana={5}{U} type=Sorcery [/card] [card] +name=Ichor Slick +abilities=madness +autoexile=restriction{discarded} pay({3}{B}) name(pay 3B to cast) activate name(pay 3B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature +auto=-3/-3 +autohand=__CYCLING__({2}) +text=Target creature gets -3/-3 until end of turn. -- Cycling {2} ({2}, Discard this card: Draw a card.) -- Madness {3}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={2}{B} +type=Sorcery +[/card] +[card] name=Ivy Seer auto={2}{G}{T}:foreach(*[green]|myhand) 1/1 target(creature) text={2}{G}, {T}: Reveal any number of green cards in your hand. Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way. @@ -149,6 +247,15 @@ power=1 toughness=1 [/card] [card] +name=Obsessive Search +abilities=madness +autoexile=restriction{discarded} pay({U}) name(pay U to cast) activate name(pay U to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto=draw:1 controller +text=Draw a card. -- Madness {U} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={U} +type=Instant +[/card] +[card] name=Ogre Marauder text=Whenever Ogre Marauder attacks, it gains "Ogre Marauder can't be blocked" until end of turn unless defending player sacrifices a creature. auto=@combat(attacking) source(this):ability$!name(choose one) if type(creature|mybattlefield)~morethan~0 then choice sacrifice notatarget(creature|mybattlefield) _ choice all(mystored) unblockable ueot!$ opponent @@ -159,6 +266,15 @@ power=3 toughness=1 [/card] [card] +name=Psychotic Haze +abilities=madness +autoexile=restriction{discarded} pay({1}{B}) name(pay 1B to cast) activate name(pay 1B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto=damage:1 all(creature,player) +text=Psychotic Haze deals 1 damage to each creature and each player. -- Madness {1}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={2}{B}{B} +type=Instant +[/card] +[card] name=Rakdos Augermage abilities=first strike auto={T}:name(target opponent) target(opponent) donothing && all(this) transforms((,newability[ability$!name(discard) reject notatarget(*|opponenthand)!$ targetedplayer && ability$!name(discard) reject notatarget(*|opponenthand)!$ controller])) assorcery @@ -178,6 +294,17 @@ mana={X}{X}{U} type=Sorcery [/card] [card] +name=Reckless Wurm +abilities=trample,madness +autoexile=restriction{discarded} pay({2}{R}) name(pay 2R to cast) activate name(pay 2R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +text=Trample -- Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={3}{R}{R} +type=Creature +subtype=Wurm +power=4 +toughness=4 +[/card] +[card] name=Sacellum Godspeaker auto={T}:foreach(creaure[power>4]|myhand) add{G} text={T}: Reveal any number of creature cards with power 5 or greater from your hand. Add {G} to your mana pool for each card revealed this way. @@ -236,6 +363,30 @@ mana={G}{W} type=Instant [/card] [card] +name=Strength of Isolation +abilities=madness +autoexile=restriction{discarded} pay({W}) name(pay W to cast) activate name(pay W to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +target=creature +auto=1/2 +auto=protection from black +text=Enchant creature -- Enchanted creature gets +1/+2 and has protection from black. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={1}{W} +type=Enchantment +subtype=Aura +[/card] +[card] +name=Strength of Lunacy +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) +target=creature +auto=2/1 +auto=protection from white +text=Enchant creature -- Enchanted creature gets +2/+1 and has protection from white. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) +mana={1}{B} +type=Enchantment +subtype=Aura +[/card] +[card] name=Zombie Brute abilities=trample auto=foreach(zombie|myhand) counter(1/1,1) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 04a60659b..9ab640264 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -500,8 +500,8 @@ toughness=6 [card] name=Abyssal Specter abilities=flying -auto=@damaged(controller) from(this):ability$!name(discard) target(*|myhand) reject!$ controller -auto=@damaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@damageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller +auto=@damagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent text=Flying -- Whenever Abyssal Specter deals damage to a player, that player discards a card. mana={2}{B}{B} type=Creature @@ -1189,7 +1189,7 @@ toughness=2 [/card] [card] name=Ageless Entity -auto=@lifed(controller):all(trigger[to]) dynamicability +auto=@lifeof(player):all(trigger[to]) dynamicability text=Whenever you gain life, put that many +1/+1 counters on Ageless Entity. mana={3}{G}{G} type=Creature @@ -1493,7 +1493,7 @@ subtype=Ajani [/card] [card] name=Avatar Token -auto=controllerlife/controllerlife cdaactive +auto=lifetotal/lifetotal cdaactive type=Creature subtype=Avatar power=* @@ -1531,7 +1531,7 @@ type=Enchantment [/card] [card] name=Ajani's Pridemate -auto=@lifed(controller):may counter(1/1,1) +auto=@lifeof(player):may counter(1/1,1) text=Whenever you gain life, you may put a +1/+1 counter on Ajani's Pridemate. mana={1}{W} type=Creature @@ -1624,7 +1624,8 @@ toughness=1 [/card] [card] name=Akki Underminer -auto=@combatdamaged(player) from(this):choice name(player sacrifices) ability$!name(sacrifice) notatarget(*|mybattlefield) sacrifice!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(sacrifice) notatarget(*|mybattlefield) sacrifice!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(sacrifice) notatarget(*|mybattlefield) sacrifice!$ controller text=Whenever Akki Underminer deals combat damage to a player, that player sacrifices a permanent. mana={3}{R} type=Creature @@ -2003,13 +2004,6 @@ power=1 toughness=1 [/card] [card] -name=Aladdin's Lamp -alias=1092 -text={X}, {T}: The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0. -mana={10} -type=Artifact -[/card] -[card] name=Aladdin's Ring auto={8}{T}:damage:4 target(creature,player) text={8}, {T}: Aladdin's Ring deals 4 damage to target creature or player. @@ -2168,7 +2162,7 @@ toughness=1 [/card] [card] name=Ali from Cairo -auto=@damaged(controller) restriction{compare(lifetotal)~lessthan~1}:this(controllerlife < 1) lifeset:1 controller +auto=this(controllerlife >= 1) transforms((,newability[reduceto:1])) text=Damage that would reduce your life total to less than 1 reduces it to 1 instead. mana={2}{R}{R} type=Creature @@ -2744,8 +2738,8 @@ toughness=2 [/card] [card] name=Anafenza, the Foremost +abilities=oppgcreatureexiler auto=@combat(attacking) source(this):counter(1/1,1) target(other creature[tapped]|mybattlefield) -auto=@movedTo(creature|opponentGraveyard):all(trigger[to]) moveTo(exile) text=When Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control. -- If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. mana={W}{B}{G} type=Legendary Creature @@ -3133,7 +3127,7 @@ toughness=3 [/card] [card] name=Angelheart Vial -auto=@damaged(controller):may counter(0/0,thatmuch,Charge) +auto=@damageof(player):may counter(0/0,thatmuch,Charge) auto={2}{T}{C(0/0,-4,Charge)}:life:2 && draw:1 controller text=Whenever you're dealt damage, you may put that many charge counters on Angelheart Vial. -- {2}, {T}, Remove four charge counters from Angelheart Vial: You gain 2 life and draw a card. mana={5} @@ -4176,7 +4170,7 @@ toughness=0 [card] name=Arcbound Slith auto=counter(1/1,1) -auto=@combatdamaged(opponent) from(this):counter(1/1,1) +auto=@combatdamaged(player) from(this):counter(1/1,1) auto=@movedTo(this|mygraveyard) from(myBattlefield):may thisforeach(counter{1/1.1}) counter(1/1,1) target(creature[artifact]) text=Whenever Arcbound Slith deals combat damage to a player, put a +1/+1 counter on it. -- Modular 1 (This enters the battlefield with a +1/+1 counter on it. When it's put into a graveyard, you may put its +1/+1 counters on target artifact creature.) mana={2} @@ -4254,7 +4248,7 @@ toughness=5 [card] name=Archangel of Thune abilities=flying,lifelink -auto=@lifed(controller):all(creature|mybattlefield) counter(1/1,1) +auto=@lifeof(player):all(creature|mybattlefield) counter(1/1,1) text=Flying. -- Lifelink. -- Whenever you gain life, put a +1/+1 counter on each creature you control. mana={3}{W}{W} type=Creature @@ -4741,7 +4735,7 @@ type=Artifact [card] name=Arm with AEther text=Until end of turn, creatures you control gain "Whenever this creature deals damage to an opponent, you may return target creature that player controls to its owner's hand." -auto=all(creature|mybattlefield) transforms((,newability[@damaged(opponent) from(this) once:may moveto(ownerhand) target(creature|opponentbattlefield)])) ueot +auto=all(creature|mybattlefield) transforms((,newability[@damagefoeof(player) from(this) once:may moveto(ownerhand) target(creature|opponentbattlefield)])) ueot mana={2}{U} type=Sorcery [/card] @@ -5360,7 +5354,8 @@ toughness=3 [/card] [card] name=Ashling, the Extinguisher -auto=@combatdamaged(opponent) from(this):target(creature|opponentbattlefield) sacrifice +auto=@combatdamagefoeof(player) from(this):target(creature|opponentbattlefield) sacrifice +auto=@combatdamageof(player) from(this):target(creature|mybattlefield) sacrifice text=Whenever Ashling, the Extinguisher deals combat damage to a player, choose target creature that player controls. He or she sacrifices that creature. mana={2}{B}{B} type=Legendary Creature @@ -5882,7 +5877,7 @@ toughness=4 [/card] [card] name=Aurification -auto=@damaged(controller) from(creature):all(trigger[from]) counter(0/0,1,Gold) +auto=@damageof(player) from(creature):all(trigger[from]) counter(0/0,1,Gold) auto=lord(creature[counter{0/0.1.Gold}]) defender auto=@movedTo(this|nonbattlezone) from(myBattlefield):all(creature) removeallcounters(0/0,1,Gold) text=Whenever a creature deals damage to you, put a gold counter on it. -- Each creature with a gold counter on it is a Wall in addition to its other creature types and has defender. (Those creatures can't attack.) -- When Aurification leaves the battlefield, remove all gold counters from all creatures. @@ -5964,7 +5959,7 @@ toughness=1 [/card] [card] name=Auriok Survivors -auto=may name(move and attach) moveto(mybattlefield) target(equipment|mygraveyard) && newtarget +auto=may name(move and attach) moveto(mybattlefield) target(equipment|mygraveyard) and!(newhook)! text=When Auriok Survivors enters the battlefield, you may return target Equipment card from your graveyard to the battlefield. If you do, you may attach it to Auriok Survivors. mana={5}{W} type=Creature @@ -5985,7 +5980,7 @@ toughness=1 [card] name=Auriok Windwalker abilities=flying -auto={T}:target(equipment|mybattlefield) transforms((,newability[retarget target(creature|mybattlefield)])) forever +auto={T}:target(equipment|mybattlefield) transforms((,newability[rehook target(creature|mybattlefield)])) forever text=Flying -- {T}: Attach target Equipment you control to target creature you control. mana={3}{W} type=Creature @@ -6840,7 +6835,7 @@ type=Artifact [card] name=Azor's Elocutors auto=@each my upkeep:counter(0/0,1,Filibuster) all(this) && this(counter{0/0.5.Filibuster})>=wingame -auto=@damaged(controller):counter(0/0,-1,Filibuster) +auto=@damageof(player):counter(0/0,-1,Filibuster) text=At the beginning of your upkeep, put a filibuster counter on Azor's Elocutors. Then if Azor's Elocutors has five or more filibuster counters on it, you win the game. -- Whenever a source deals damage to you, remove a filibuster counter from Azor's Elocutors. mana={3}{WU}{WU} type=Creature @@ -6895,7 +6890,7 @@ type=Instant [card] name=Backfire target=creature -auto=@damaged(controller) from(mytgt):damage:thatmuch targetcontroller +auto=@damageof(player) from(mytgt):damage:thatmuch targetcontroller text=Enchant creature -- Whenever enchanted creature deals damage to you, Backfire deals that much damage to that creature's controller. mana={U} type=Enchantment @@ -7061,7 +7056,8 @@ toughness=3 [card] name=Balefire Dragon abilities=flying -auto=@combatdamaged(opponent) from(this):all(creature|opponentbattlefield) damage:thatmuch +auto=@combatdamagefoeof(player) from(this):all(creature|opponentbattlefield) damage:thatmuch +auto=@combatdamageof(player) from(this):all(creature|mybattlefield) damage:thatmuch text=Flying -- Whenever Balefire Dragon deals combat damage to a player, it deals that much damage to each creature that player controls. mana={5}{R}{R} type=Creature @@ -7536,8 +7532,8 @@ type=Artifact [card] name=Barbed Shocker abilities=trample,haste -auto=@damaged(opponent) from(this):all(*|opponenthand) transforms((,newability[reject],newability[draw:1])) ueot -auto=@damaged(controller) from(this):all(*|myhand) transforms((,newability[reject],newability[draw:1])) ueot +auto=@damagefoeof(player) from(this):all(*|opponenthand) transforms((,newability[reject],newability[draw:1])) ueot +auto=@damageof(player) from(this):all(*|myhand) transforms((,newability[reject],newability[draw:1])) ueot text=Trample, haste -- Whenever Barbed Shocker deals damage to a player, that player discards all the cards in his or her hand, then draws that many cards. mana={3}{R} type=Creature @@ -8140,7 +8136,7 @@ toughness=2 [/card] [card] name=Battleflight Eagle -auto=target(creature|battlefield) 2/2 ueot && flying ueot +auto=target(creature|battlefield) transforms((,newability[2/2],newability[flying])) ueot abilities=flying text=Flying -- When Battleflight Eagle enters the battlefield, target creature gets +2/+2 and gains flying until end of turn. mana={4}{W} @@ -8586,7 +8582,7 @@ toughness=3 [/card] [card] name=Bellowing Saddlebrute -auto=ifnot thisturn(creature[attacking]|mybattlefield)~morethan~0 then life:-4 controller +auto=ifnot raid then life:-4 controller text=Raid — When Bellowing Saddlebrute enters the battlefield, you lose 4 life unless you attacked with a creature this turn. mana={3}{B} type=Creature @@ -9562,7 +9558,8 @@ subtype=Arcane [card] name=Blazing Specter abilities=flying,haste -auto=@combatdamaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller text=Flying, haste -- Whenever Blazing Specter deals combat damage to a player, that player discards a card. mana={2}{B}{R} type=Creature @@ -9849,7 +9846,8 @@ toughness=3 [card] name=Blinding Angel abilities=flying -auto=@combatdamaged(opponent) from(this):nextphasealter(remove,combatbegins,opponent) && nextphasealter(remove,combatattackers,opponent) && nextphasealter(remove,combatblockers,opponent) && nextphasealter(remove,combatdamage,opponent) && nextphasealter(remove,combatends,opponent) +auto=@combatdamagefoeof(player) from(this):nextphasealter(remove,combatbegins,opponent) && nextphasealter(remove,combatattackers,opponent) && nextphasealter(remove,combatblockers,opponent) && nextphasealter(remove,combatdamage,opponent) && nextphasealter(remove,combatends,opponent) +auto=@combatdamageof(player) from(this):nextphasealter(remove,combatbegins,controller) && nextphasealter(remove,combatattackers,controller) && nextphasealter(remove,combatblockers,controller) && nextphasealter(remove,combatdamage,controller) && nextphasealter(remove,combatends,controller) text=Flying (This creature can't be blocked except by creatures with flying or reach.) -- Whenever Blinding Angel deals combat damage to a player, that player skips his or her next combat phase. mana={3}{W}{W} type=Creature @@ -10050,7 +10048,8 @@ toughness=5 [card] name=Blizzard Specter abilities=flying -auto=@combatdamaged(player) from(this):all(this) transforms((,newability[choice name(bounce) ability$! target(*|mybattlefield) moveTo(ownerhand) !$opponent],newability[choice name(discard) ability$! target(*|myhand) reject !$opponent])) ueot +auto=@combatdamagefoeof(player) from(this):all(this) transforms((,newability[choice name(bounce) ability$! target(*|mybattlefield) moveTo(ownerhand) !$opponent],newability[choice name(discard) ability$! target(*|myhand) reject !$opponent])) ueot +auto=@combatdamageof(player) from(this):all(this) transforms((,newability[choice name(bounce) ability$! target(*|mybattlefield) moveTo(ownerhand) !$controller],newability[choice name(discard) ability$! target(*|myhand) reject !$controller])) ueot text=Flying -- Whenever Blizzard Specter deals combat damage to a player, choose one - That player returns a permanent he or she controls to its owner's hand; or that player discards a card. mana={2}{U}{B} type=Snow Creature @@ -10182,7 +10181,7 @@ toughness=3 [/card] [card] name=Blood Hound -auto=@damaged(controller):may counter(1/1,thatmuch) +auto=@damageof(player):may counter(1/1,thatmuch) auto=@each my endofturn:removeallcounters(1/1) text=Whenever you're dealt damage, you may put that many +1/+1 counters on Blood Hound. -- At the beginning of your end step, remove all +1/+1 counters from Blood Hound. mana={2}{R} @@ -10685,7 +10684,7 @@ toughness=3 [card] name=Bloodsoaked Champion abilities=cantblock -autograveyard={1}{B}:moveTo(mybattlefield) restriction{thisturn(creature[attacking]|mybattlefield)~morethan~0} +autograveyard={1}{B}:moveTo(mybattlefield) restriction{raid} text=Bloodsoaked Champion can't block. -- Raid — {1}{B}: Return Bloodsoaked Champion from your graveyard to the battlefield. Activate this ability only if you attacked with a creature this turn. mana={B} type=Creature @@ -12284,7 +12283,7 @@ toughness=1 [/card] [card] name=Brass Squire -auto={T}:target(equipment|mybattlefield) transforms((,newability[retarget target(creature|mybattlefield)])) forever +auto={T}:target(equipment|mybattlefield) transforms((,newability[rehook target(creature|mybattlefield)])) forever text={T}: Attach target Equipment you control to target creature you control. mana={3} type=Artifact Creature @@ -12881,8 +12880,8 @@ toughness=1 [/card] [card] name=Brood Sliver -auto=@combatdamaged(opponent) from(sliver):may token(Sliver,Creature Sliver,1/1) -auto=@combatdamaged(controller) from(sliver):may token(Sliver,Creature Sliver,1/1) +auto=@combatdamagefoeof(player) from(sliver|mybattlefield):token(Sliver,Creature Sliver,1/1) controller +auto=@combatdamageof(player) from(sliver|opponentbattlefield):token(Sliver,Creature Sliver,1/1) opponent text=Whenever a Sliver deals combat damage to a player, its controller may put a 1/1 colorless Sliver creature token onto the battlefield. mana={4}{G} type=Creature @@ -13556,7 +13555,8 @@ type=Land [/card] [card] name=Cabal Executioner -auto=@combatdamaged(player) from(this):ability$!name(sacrifice) notatarget(creature|mybattlefield) sacrifice!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(sacrifice) notatarget(creature|mybattlefield) sacrifice!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(sacrifice) notatarget(creature|mybattlefield) sacrifice!$ controller facedown={3} autofacedown={3}{B}{B}:morph text=Whenever Cabal Executioner deals combat damage to a player, that player sacrifices a creature. -- Morph {3}{B}{B} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) @@ -13604,7 +13604,8 @@ type=Instant [/card] [card] name=Cabal Slaver -auto=@combatdamaged(opponent) from(goblin|mybattlefield):ability$!name(discard) target(*|mybattefield) sacrifice !$ opponent +auto=@combatdamagefoeof(player) from(goblin|mybattlefield):ability$!name(discard) notatarget(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(goblin|opponentbattlefield):ability$!name(discard) notatarget(*|myhand) reject!$ controller text=Whenever a Goblin deals combat damage to a player, that player discards a card. mana={2}{B} type=Creature @@ -14967,7 +14968,8 @@ subtype=Aura [card] name=Caustic Wasps abilities=flying -auto=@combatdamaged(player) from(this):may destroy target(artifact|opponentbattlefield) +auto=@combatdamagefoeof(player) from(this):may destroy target(artifact|opponentbattlefield) +auto=@combatdamageof(player) from(this):may destroy target(artifact|mybattlefield) text=Flying -- Whenever Caustic Wasps deals combat damage to a player, you may destroy target artifact that player controls. mana={2}{G} type=Creature @@ -15174,7 +15176,7 @@ toughness=3 name=Celestial Mantle target=creature auto=3/3 -auto=@combatdamaged(player) from(mytgt):life:lifetotal owner +auto=teach(creature) transforms((,newability[@combatdamaged(player) from(this):life:lifetotal controller])) text=Enchant creature -- Enchanted creature gets +3/+3. -- Whenever enchanted creature deals combat damage to a player, double its controller's life total. mana={3}{W}{W}{W} type=Enchantment @@ -15400,7 +15402,8 @@ type=Land [/card] [card] name=Cephalid Constable -auto=@combatdamaged(opponent) from(this):name(bounce) ability$!name(bounce) target(*|opponentbattlefield) moveto(ownerhand) !$ controller +auto=@combatdamagefoeof(player) from(this):name(bounce) ability$!name(bounce) target(*|opponentbattlefield) moveto(ownerhand) !$ controller +auto=@combatdamageof(player) from(this):name(bounce) ability$!name(bounce) target(*|mybattlefield) moveto(ownerhand) !$ controller text=Whenever Cephalid Constable deals combat damage to a player, return up to that many target permanents that player controls to their owners' hands. mana={1}{U}{U} type=Creature @@ -15881,8 +15884,9 @@ type=Instant [card] name=Chandra's Phoenix abilities=flying,haste -autograveyard=@damaged(opponent) from(instant[red]|mystack):moveTo(ownerhand) -autograveyard=@damaged(opponent) from(sorcery[red]|mystack):moveTo(ownerhand) +autograveyard=@damagefoeof(player) from(instant[red]|mystack):moveTo(ownerhand) +autograveyard=@damagefoeof(player) from(sorcery[red]|mystack):moveTo(ownerhand) +autograveyard=@damagefoeof(player) from(planeswalker[red]|mybattlefield):moveTo(ownerhand) text=Flying -- Haste -- Whenever an opponent is dealt damage by a red instant or sorcery spell you control or by a red planeswalker you control, return Chandra's Phoenix from your graveyard to your hand. mana={1}{R}{R} type=Creature @@ -15893,7 +15897,7 @@ toughness=2 [card] name=Chandra's Spitfire abilities=flying -auto=@noncombatdamaged(opponent):3/0 ueot +auto=@noncombatdamagefoeof(player):3/0 ueot text=Flying -- Whenever an opponent is dealt noncombat damage, Chandra's Spitfire gets +3/+0 until end of turn. mana={2}{R} type=Creature @@ -16191,7 +16195,7 @@ toughness=4 [card] name=Charnelhoard Wurm abilities=trample -auto=@damaged(opponent) from(this):may moveTo(myhand) target(*|mygraveyard) +auto=@damagefoeof(player) from(this):may moveTo(myhand) target(*|mygraveyard) text=Trample -- Whenever Charnelhoard Wurm deals damage to an opponent, you may return target card from your graveyard to your hand. mana={4}{B}{R}{G} type=Creature @@ -16223,7 +16227,7 @@ toughness=3 [/card] [card] name=Chasm Skulker -auto=@drawn(controller):counter(1/1,1) +auto=@drawof(player):counter(1/1,1) auto=@movedTo(this|Graveyard) from(myBattlefield):thisforeach(counter{1/1.1}):token(Squid,Creature Squid,1/1,islandwalk,blue) text=Whenever you draw a card, put a +1/+1 counter on Chasm Skulker. -- When Chasm Skulker dies, put X 1/1 blue Squid creature tokens with islandwalk onto the battlefield, where X is the number of +1/+1 counters on Chasm Skulker. mana={2}{U} @@ -16382,7 +16386,8 @@ type=Instant [card] name=Chilling Apparition auto={B}:regenerate -auto=@combatdamaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller text={B}: Regenerate Chilling Apparition. -- Whenever Chilling Apparition deals combat damage to a player, that player discards a card. mana={2}{B} type=Creature @@ -17306,7 +17311,7 @@ name=Cloak and Dagger auto={3}:equip auto=2/0 auto=shroud -auto=@movedto(creature[rogue]|battlefield):may all(trigger[to]) retarget +auto=@movedto(creature[rogue]|battlefield):may all(trigger[to]) rehook text=Equipped creature gets +2/+0 and has shroud. (It can't be the target of spells or abilities.) -- Whenever a Rogue creature enters the battlefield, you may attach Cloak and Dagger to it. -- Equip {3} mana={2} type=Tribal Artifact @@ -17954,7 +17959,7 @@ toughness=3 [/card] [card] name=Coastal Piracy -auto=@combatdamaged(opponent) from(creature|myBattlefield):may draw:1 controller +auto=@combatdamagefoeof(player) from(creature|myBattlefield):may draw:1 controller text=Whenever a creature you control deals combat damage to an opponent, you may draw a card. mana={2}{U}{U} type=Enchantment @@ -18315,7 +18320,7 @@ color=white [card] name=Commando Raid target=creature|mybattlefield -auto=transforms((,newability[@combatdamaged(opponent) from(this):may dynamicability target(creature|opponentbattlefield)])) ueot +auto=transforms((,newability[@combatdamageof(player) from(this):may dynamicability target(creature|mybattlefield)],newability[@combatdamagefoeof(player) from(this):may dynamicability target(creature|opponentbattlefield)])) ueot text=Until end of turn, target creature you control gains "When this creature deals combat damage to a player, you may have it deal damage equal to its power to target creature that player controls." mana={2}{R} type=Instant @@ -18524,7 +18529,7 @@ subtype=Aura [card] name=Conquering Manticore abilities=flying -auto=target(creature|opponentbattlefield) transforms((,newability[moveTo(opponentbattlefield)],newability[phaseaction[endofturn sourceinplay] moveTo(ownerbattlefield)],newability[untap],haste)) ueot once +auto=name(gain control) target(creature|opponentbattlefield) transforms((,newability[moveTo(opponentbattlefield)],newability[phaseaction[endofturn sourceinplay] moveTo(ownerbattlefield)],newability[untap],haste)) ueot once text=Flying -- When Conquering Manticore enters the battlefield, gain control of target creature an opponent controls until end of turn. Untap that creature. It gains haste until end of turn. mana={4}{R}{R} type=Creature @@ -18565,7 +18570,7 @@ subtype=Aura [card] name=Consecrated Sphinx abilities=flying -auto=@drawn(opponent):may draw:2 controller +auto=@drawfoeof(player):may draw:2 controller text=Flying -- Whenever an opponent draws a card, you may draw two cards. mana={4}{U}{U} type=Creature @@ -19571,7 +19576,7 @@ toughness=4 [/card] [card] name=Cradle of Vitality -auto=@lifed(controller):pay({1}{W}) counter(1/1,thatmuch) target(creature) +auto=@lifeof(player):pay({1}{W}) counter(1/1,thatmuch) target(creature) text=Whenever you gain life, you may pay {1}{W}. If you do, put a +1/+1 counter on target creature for each 1 life you gained. mana={3}{W} type=Enchantment @@ -19625,7 +19630,7 @@ type=Artifact [card] name=Cranial Plating auto=foreach(artifact|mybattlefield) 1/0 -auto={B}{B}:name(attach) retarget target(creature|mybattlefield) +auto={B}{B}:name(attach) rehook target(creature|mybattlefield) auto={1}:equip text=Equipped creature gets +1/+0 for each artifact you control. -- {B}{B}: Attach Cranial Plating to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) mana={2} @@ -20101,7 +20106,8 @@ type=Instant [card] name=Crosis, the Purger abilities=flying -auto=@combatdamaged(player) from(this):pay({2}{B}) activatechooseacolor all(*[chosencolor]|opponenthand) reject activatechooseend +auto=@combatdamagefoeof(player) from(this):pay({2}{B}) activatechooseacolor all(*[chosencolor]|opponenthand) reject activatechooseend +auto=@combatdamageof(player) from(this):pay({2}{B}) activatechooseacolor all(*[chosencolor]|myhand) reject activatechooseend text=Flying -- Whenever Crosis, the Purger deals combat damage to a player, you may pay {2}{B}. If you do, choose a color, then that player reveals his or her hand and discards all cards of that color. mana={3}{U}{B}{R} type=Legendary Creature @@ -20158,7 +20164,8 @@ toughness=1 [/card] [card] name=Crosstown Courier -auto=@combatdamaged(player) from(this):deplete:thatmuch opponent +auto=@combatdamagefoeof(player) from(this):deplete:thatmuch opponent +auto=@combatdamageof(player) from(this):deplete:thatmuch controller text=Whenever Crosstown Courier deals combat damage to a player, that player puts that many cards from the top of his or her library into his or her graveyard. mana={1}{U} type=Creature @@ -20600,7 +20607,7 @@ toughness=1 [card] name=Crypt Ghast auto=@movedto(*|mystack):pay({WB}) life:-1 opponent && life:1 controller -auto=@tappedformana(swamp|mybattlefield):Add{B} +auto=lord(swamp|mybattlefield) transforms((,newability[produceextra:{B}])) text=Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.) -- Whenever you tap a Swamp for mana, add {B} to your mana pool (in addition to the mana the land produces). mana={3}{B} type=Creature @@ -20919,7 +20926,7 @@ type=Instant [card] name=Curiosity target=creature -auto=@damaged(player) from(mytgt):may draw:1 controller +auto=@damagefoeof(player) from(mytgt):may draw:1 controller text=Enchant creature -- Whenever enchanted creature deals damage to an opponent, you may draw a card. mana={U} type=Enchantment @@ -21543,7 +21550,7 @@ toughness=4 [/card] [card] name=Darien, King of Kjeldor -auto=@damaged(controller):may token(Soldier,Creature Soldier,1/1,white)*thatmuch +auto=@damageof(player):may token(Soldier,Creature Soldier,1/1,white)*thatmuch text=Whenever you're dealt damage, you may put that many 1/1 white Soldier creature tokens onto the battlefield. mana={4}{W}{W} type=Legendary Creature @@ -22294,6 +22301,7 @@ text=At the beginning of your upkeep, you lose 1 life. -- At the beginning of yo mana={2}{B}{B}{B} type=Enchantment [/card] +#tappedformana stack...produceextra:selectmana don't support combination of mana at the moment since it a mayability not a menuability [card] name=Dawn's Reflection target=land @@ -22351,7 +22359,8 @@ type=Sorcery name=Dawning Purist facedown={3} autofacedown={1}{W}:morph -auto=@combatdamaged(opponent) from(this):may destroy target(enchantment|opponentbattlefield) +auto=@combatdamagefoeof(player) from(this):may destroy target(enchantment|opponentbattlefield) +auto=@combatdamageof(player) from(this):may destroy target(enchantment|mybattlefield) text=Whenever Dawning Purist deals combat damage to a player, you may destroy target enchantment that player controls. -- Morph {1}{W} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) mana={2}{W} type=Creature @@ -23075,7 +23084,7 @@ toughness=5 [card] name=Deathrender auto=+2/+2 -auto=@movedto(mytgt|graveyard):may moveto(mybattlefield) target(creature|myhand) && all(this) retarget +auto=@movedto(mytgt|graveyard):may moveto(mybattlefield) target(creature|myhand) and!(rehook)! auto={2}:equip text=Equipped creature gets +2/+2. -- Whenever equipped creature is put into a graveyard, you may put a creature card from your hand onto the battlefield and attach Deathrender to it. -- Equip {2} mana={4} @@ -23124,7 +23133,7 @@ subtype=Aura [/card] [card] name=Debt to the Deathless -auto=@lifeloss(opponent):life:thatmuch controller +auto=@lifelostfoeof(player):life:thatmuch controller auto=life:-twiceX opponent text=Each opponent loses two times X life. You gain life equal to the life lost this way. mana={X}{W}{W}{B}{B} @@ -24392,7 +24401,7 @@ toughness=* [card] name=Deus of Calamity abilities=trample -auto=@damaged(opponent) from(this) restriction{compare(thatmuch)~morethan~5}:destroy target(land|opponent) +auto=@damagefoeof(player) from(this) restriction{compare(thatmuch)~morethan~5}:destroy target(land|opponent) text=Trample -- Whenever Deus of Calamity deals 6 or more damage to an opponent, destroy target land that player controls. mana={RG}{RG}{RG}{RG}{RG} type=Creature @@ -24737,7 +24746,8 @@ type=Artifact [/card] [card] name=Dimir Cutpurse -auto=@combatdamaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent && draw:1 controller +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent && draw:1 controller +auto=@combatdamageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller && draw:1 controller text=Whenever Dimir Cutpurse deals combat damage to a player, that player discards a card and you draw a card. mana={1}{U}{B} type=Creature @@ -25333,7 +25343,7 @@ type=Sorcery [card] name=Dissipation Field mana={2}{U}{U} -auto=@damaged(controller) from(*|battlefield):all(trigger[from]) moveto(ownerhand) +auto=@damageof(player) from(*|battlefield):all(trigger[from]) moveto(ownerhand) type=Enchantment text=Whenever a permanent deals damage to you, return it to its owner's hand. [/card] @@ -25549,10 +25559,10 @@ type=Instant [card] name=Diviner's Wand auto={3}:equip -auto=@drawn(controller):1/1 ueot -auto=@drawn(controller):flying ueot +auto=@drawof(player):1/1 ueot +auto=@drawof(player):flying ueot auto=teach(creature) {4}:draw:1 controller -auto=@movedto(creature[wizard]|battlefield):may all(trigger[to]) retarget +auto=@movedto(creature[wizard]|battlefield):may all(trigger[to]) rehook text=Equipped creature has "Whenever you draw a card, this creature gets +1/+1 and gains flying until end of turn" and "{4}: Draw a card." -- Whenever a Wizard creature enters the battlefield, you may attach Diviner's Wand to it. -- Equip {3} mana={3} type=Tribal Artifact @@ -25736,7 +25746,8 @@ toughness=1 [card] name=Doomsday Specter abilities=flying -auto=@combatdamaged(player) from(this|mybattlefield):reject target(*|opponenthand) +auto=@combatdamagefoeof(player) from(this):reject target(*|opponenthand) +auto=@combatdamageof(player) from(this):reject target(*|myhand) auto=moveTo(ownerhand) notatarget(creature[blue;black]|myBattlefield) text=Flying -- When Doomsday Specter enters the battlefield, return a blue or black creature you control to its owner's hand. -- Whenever Doomsday Specter deals combat damage to a player, look at that player's hand and choose a card from it. The player discards that card. mana={2}{U}{B} @@ -26576,7 +26587,7 @@ type=Sorcery [card] name=Dread abilities=fear -auto=@damaged(controller) from(creature):all(trigger[from]) destroy +auto=@damageof(player) from(creature):all(trigger[from]) destroy autograveyard=moveTo(ownerlibrary) && shuffle text=Fear (This creature can't be blocked except by artifact creatures and/or black creatures.) -- Whenever a creature deals damage to you, destroy it. -- When Dread is put into a graveyard from anywhere, shuffle it into its owner's library. mana={3}{B}{B}{B} @@ -27056,8 +27067,7 @@ toughness=1 [card] name=Drinker of Sorrow abilities=cantblock -auto=@combatdamaged(player) from(this):moveto(graveyard) notatarget(*|myBattlefield) -auto=@combatdamaged(creature) from(this):moveto(graveyard) notatarget(*|myBattlefield) +auto=@combatdamaged(creature,player) from(this):sacrifice notatarget(*|myBattlefield) text=Drinker of Sorrow can't block. -- Whenever Drinker of Sorrow deals combat damage, sacrifice a permanent. mana={2}{B} type=Creature @@ -27111,7 +27121,7 @@ toughness=2 [card] name=Drogskol Reaver abilities=flying,double strike,lifelink -auto=@lifed(controller):draw:1 controller +auto=@lifeof(player):draw:1 controller text=Flying, doublestrike, lifelink -- Whenever you gain life, draw a card. mana={5}{W}{U} type=Creature @@ -27670,7 +27680,7 @@ toughness=3 [card] name=Dunerider Outlaw abilities=protection from green -auto=@damaged(opponent) from(this):all(trigger[from]) phaseaction[endofturn once] counter(1/1,1) +auto=@damagefoeof(player) from(this):all(trigger[from]) phaseaction[endofturn once] counter(1/1,1) text=Protection from green -- At the beginning of each end step, if Dunerider Outlaw dealt damage to an opponent this turn, put a +1/+1 counter on it. mana={B}{B} type=Creature @@ -28476,7 +28486,8 @@ toughness=4 [card] name=Ebonblade Reaper auto=@combat(attacking) source(this):life:-halfuplifetotal controller -auto=@combatdamaged(opponent) from(this):life:-halfupopponentlifetotal opponent +auto=@combatdamagefoeof(player) from(this):life:-halfupopponentlifetotal opponent +auto=@combatdamageof(player) from(this):life:-halfuplifetotal controller facedown={3} autofacedown={3}{b}{b}:morph text=Whenever Ebonblade Reaper attacks, you lose half your life, rounded up. -- Whenever Ebonblade Reaper deals combat damage to a player, that player loses half his or her life, rounded up. -- Morph {3}{B}{B} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) @@ -28670,7 +28681,7 @@ subtype=Aura [/card] [card] name=Edric, Spymaster of Trest -auto=@combatdamaged(opponent) from(creature|mybattlefield):may draw:1 controller +auto=@combatdamagefoeof(player) from(creature|mybattlefield):may draw:1 controller text=Whenever a creature deals combat damage to one of your opponents, that creature's controller may draw a card. mana={1}{G}{U} type=Legendary Creature @@ -28896,7 +28907,8 @@ name=Elder Mastery target=creature auto=3/3 auto=flying -auto=@damaged(player) from(mytgt):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ opponent +auto=@damagefoeof(player) from(mytgt):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ opponent +auto=@damageof(player) from(mytgt):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ controller text=Enchant creature -- Enchanted creature gets +3/+3 and has flying. -- Whenever enchanted creature deals damage to a player, that player discards two cards. mana={3}{U}{B}{R} type=Enchantment @@ -28927,7 +28939,7 @@ toughness=6 name=Elderscale Wurm abilities=trample auto=if compare(lifetotal)~lessthan~7 then lifeset:7 controller -auto=this(controllerlife > 6) transforms((,newability[@damaged(controller):if compare(lifetotal)~lessthan~7 then lifeset:7 controller])) +auto=this(controllerlife >= 7) transforms((,newability[reduceto:7])) text=Trample. -- When Elderscale Wurm enters the battlefield, if your life total is less than 7, your life total becomes 7. -- As long as you have 7 or more life, damage that would reduce your life total to less than 7 reduces it to 7 instead. mana={4}{G}{G}{G} type=Creature @@ -28997,7 +29009,7 @@ type=Instant [/card] [card] name=Electryte -auto=@combatdamaged(player) from(this):all(creature[blocking]) dynamicability +auto=@combatdamagefoeof(player) from(this):all(creature[blocking]) dynamicability text=Whenever Electryte deals combat damage to defending player, it deals damage equal to its power to each blocking creature. mana={3}{R}{R} type=Creature @@ -29462,7 +29474,7 @@ type=Instant [card] name=Elvish Guidance target=land -auto=@tappedformana(mytgt):foreach(elf|myBattlefield) Add{G} targetcontroller +auto=transforms((,newability[foreach(elf|battlefield) produceextra:{G}])) text=Enchant land -- Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool for each Elf on the battlefield (in addition to the mana the land produces). mana={2}{G} type=Enchantment @@ -29814,8 +29826,7 @@ toughness=1 [card] name=Emberwilde Caliph abilities=flying,trample,mustattack -auto=@damaged(creature) from(this):life:-thatmuch controller -auto=@damaged(opponent) from(this):life:-thatmuch controller +auto=@damaged(creature,player) from(this):life:-thatmuch controller text=Flying, trample -- Emberwilde Caliph attacks each turn if able. -- Whenever Emberwilde Caliph deals damage, you lose that much life. mana={2}{U}{R} type=Creature @@ -29928,7 +29939,8 @@ type=Artifact [card] name=Emissary of Despair abilities=flying -auto=@combatdamaged(player) from(this):life:-type:artifact:opponentbattlefield opponent +auto=@combatdamagefoeof(player) from(this):life:-type:artifact:opponentbattlefield opponent +auto=@combatdamageof(player) from(this):life:-type:artifact:mybattlefield controller text=Flying -- Whenever Emissary of Despair deals combat damage to a player, that player loses 1 life for each artifact he or she controls. mana={1}{B}{B} type=Creature @@ -29939,7 +29951,8 @@ toughness=1 [card] name=Emissary of Hope abilities=flying -auto=@combatdamaged(player) from(this):life:type:artifact:opponentbattlefield controller +auto=@combatdamagefoeof(player) from(this):life:type:artifact:opponentbattlefield controller +auto=@combatdamageof(player) from(this):life:type:artifact:mybattlefield controller text=Flying -- Whenever Emissary of Hope deals combat damage to a player, you gain 1 life for each artifact that player controls. mana={1}{W}{W} type=Creature @@ -29969,15 +29982,10 @@ toughness=3 [/card] [card] name=Emrakul, the Aeons Torn -abilities=nofizzle,flying +abilities=nofizzle,flying,protectionfromcoloredspells auto=if casted(this) then turns:+1 controller autograveyard=moveTo(ownerlibrary) all(*|ownergraveyard) && shuffle auto=@combat(attacking) source(this):name(Annihilate) ability$!name(sacrifice 6 permanents) notatarget(<6>*|mybattlefield) sacrifice!$ opponent -auto=protection from(*[white]|stack) -auto=protection from(*[blue]|stack) -auto=protection from(*[black]|stack) -auto=protection from(*[red]|stack) -auto=protection from(*[green]|stack) text=Emrakul, the Aeons Torn can't be countered. -- When you cast Emrakul, take an extra turn after this one. -- Flying, protection from colored spells, annihilator 6 -- When Emrakul is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library. mana={15} type=Legendary Creature @@ -30640,8 +30648,8 @@ toughness=2 [card] name=Entropic Specter auto=type:*:opponenthand/type:*:opponenthand cdaactive -auto=@damaged(controller) from(this):ability$!name(discard) target(*|myhand) reject!$ controller -auto=@damaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@damageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller +auto=@damagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent text=Flying -- As Entropic Specter enters the battlefield, choose an opponent. -- Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand. -- Whenever Entropic Specter deals damage to a player, that player discards a card. mana={3}{B}{B} type=Creature @@ -30810,7 +30818,7 @@ subtype=God [card] name=Erdwal Ripper abilities=haste -auto=@combatdamaged(opponent) from(this):counter(1/1,1) +auto=@combatdamaged(player) from(this):counter(1/1,1) text=Haste -- Whenever Erdwal Ripper deals combat damage to a player, put a +1/+1 counter on it. mana={1}{R}{R} type=Creature @@ -31842,7 +31850,7 @@ type=Instant [/card] [card] name=Exquisite Blood -auto=@lifeloss(opponent):life:thatmuch controller +auto=@lifelostfoeof(player):life:thatmuch controller text=Whenever an opponent loses life, you gain that much life. mana={4}{B} type=Enchantment @@ -32513,7 +32521,7 @@ toughness=2 #emblem ueot removes the effect, the ability acts an observer [card] name=False Cure -auto=emblem transforms((,newability[@lifed(opponent):life:-twicethatmuch opponent],newability[@lifed(controller):life:-twicethatmuch controller])) ueot +auto=emblem transforms((,newability[@lifefoeof(player):life:-twicethatmuch opponent],newability[@lifeof(player):life:-twicethatmuch controller])) ueot text=Until end of turn, whenever a player gains life, that player loses 2 life for each 1 life he or she gained. mana={B}{B} type=Instant @@ -32802,8 +32810,7 @@ type=Sorcery [/card] [card] name=Farsight Mask -auto=@damaged(controller) from(*|opponentbattlefield) sourcenottap:may draw:1 controller -auto=@damaged(controller) from(*|opponentstack) sourcenottap:may draw:1 controller +auto=@damageof(player) from(*|opponentbattlefield,opponentstack,opponentgraveyard,opponentlibrary,opponentexile) sourcenottap:may draw:1 controller text=Whenever a source an opponent controls deals damage to you, if Farsight Mask is untapped, you may draw a card. mana={5} type=Artifact @@ -32879,7 +32886,7 @@ subtype=Aura [/card] [card] name=Fate Unraveler -auto=@drawn(opponent):damage:1 opponent +auto=@drawfoeof(player):damage:1 opponent text=Whenever an opponent draws a card, Fate Unraveler deals 1 damage to that player. mana={3}{B} type=Enchantment Creature @@ -33015,7 +33022,7 @@ auto=@targeted(this) from(*[instant;sorcery;enchantment]|myhand,mygraveyard):cou text=Heroic - Whenever you cast a spell that targets Favored Hoplite, put a +1/+1 counter on Favored Hoplite and prevent all damage that would be dealt to it this turn. mana={W} type=Creature -subtype=Human Warrior +subtype=Human Soldier power=1 toughness=2 [/card] @@ -33438,10 +33445,11 @@ subtype=Beast power=2 toughness=2 [/card] +#produceextra:selectmana when used acts as an observer so the ability must be on the source since its a mayability of mana not a menuability [card] name=Fertile Ground target=land -auto=teach(land) transforms((,newability[@tappedformana(this):chooseacolor add{chosencolor} chooseend])) +auto=all(this) transforms((,newability[produceextra:selectmana])) forever text=Enchant land -- Whenever enchanted land is tapped for mana, its controller adds one mana of any color to his or her mana pool (in addition to the mana the land produces). mana={1}{G} type=Enchantment @@ -34972,7 +34980,7 @@ toughness=1 [card] name=Flesh Reaver auto=@damaged(creature) from(this):damage:thatmuch controller -auto=@damaged(opponent) from(this):damage:thatmuch controller +auto=@damagefoeof(player) from(this):damage:thatmuch controller text=Whenever Flesh Reaver deals damage to a creature or opponent, Flesh Reaver deals that much damage to you. mana={1}{B} type=Creature @@ -36158,7 +36166,7 @@ toughness=3 name=Fortune Thief facedown={3} autofacedown={R}{R}:morph -auto=@damaged(controller) restriction{compare(lifetotal)~lessthan~1}:this(controllerlife < 1) lifeset:1 controller +auto=this(controllerlife >= 1) transforms((,newability[reduceto:1])) text=Damage that would reduce your life total to less than 1 reduces it to 1 instead. -- Morph {R}{R} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) mana={4}{R} type=Creature @@ -36890,7 +36898,7 @@ auto={G}{G}:counter(0/0,1,Spore) target(fungus) [card] name=Fungal Shambler abilities=trample -auto=@damaged(opponent) from(this):draw:1 controller && ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@damagefoeof(player) from(this):draw:1 controller && ability$!name(discard) target(*|myhand) reject!$ opponent text=Trample -- Whenever Fungal Shambler deals damage to an opponent, you draw a card and that opponent discards a card. mana={4}{G}{U}{B} type=Creature @@ -37093,6 +37101,7 @@ toughness=3 [/card] [card] name=Fylgja +target=creature auto=all(this) counter(0/0,4,Healing) auto={C(0/0,-1,Healing)}:prevent:1 auto={2}{W}:all(this) counter(0/0,1,Healing) @@ -37693,19 +37702,19 @@ toughness=3 [card] name=Gauntlet of Might auto=lord(creature[red]) 1/1 -auto=@tappedformana(mountain|mybattlefield):Add{R} controller -auto=@tappedformana(mountain|opponentbattlefield):Add{R} opponent +auto=lord(mountain|battlefield) transforms((,newability[produceextra:{R}])) text=Red creatures get +1/+1. -- Whenever a Mountain is tapped for mana, its controller adds {R} to his or her mana pool (in addition to the mana the land produces). mana={4} type=Artifact [/card] +#producecolor looks for the color... maybe needs restriction... [card] name=Gauntlet of Power -auto=choice name(choose white) all(this) transforms((,newability[lord(creature[white]|battlefield) 1/1],newability[@tappedformana(plains[basic]|mybattlefield):add{W}],newability[@tappedformana(plains[basic]|opponentbattlefield):add{W} opponent])) forever -auto=choice name(choose blue) all(this) transforms((,newability[lord(creature[blue]|battlefield) 1/1],newability[@tappedformana(island[basic]|mybattlefield):add{U}],newability[@tappedformana(island[basic]|opponentbattlefield):add{U} opponent])) forever -auto=choice name(choose black) all(this) transforms((,newability[lord(creature[black]|battlefield) 1/1],newability[@tappedformana(swamp[basic]|mybattlefield):add{B}],newability[@tappedformana(swamp[basic]|opponentbattlefield):add{B} opponent])) forever -auto=choice name(choose red) all(this) transforms((,newability[lord(creature[red]|battlefield) 1/1],newability[@tappedformana(mountain[basic]|mybattlefield):add{R}],newability[@tappedformana(mountain[basic]|opponentbattlefield):add{R} opponent])) forever -auto=choice name(choose green) all(this) transforms((,newability[lord(creature[green]|battlefield) 1/1],newability[@tappedformana(forest[basic]|mybattlefield):add{G}],newability[@tappedformana(forest[basic]|opponentbattlefield):add{G} opponent])) forever +auto=choice name(green) all(this) transforms((,newability[lord(creature[green]|battlefield) 1/1],newability[lord(forest[basic]|battlefield) producecolor:green])) forever +auto=choice name(blue) all(this) transforms((,newability[lord(creature[blue]|battlefield) 1/1],newability[lord(island[basic]|battlefield) producecolor:blue])) forever +auto=choice name(red) all(this) transforms((,newability[lord(creature[red]|battlefield) 1/1],newability[lord(mountain[basic]|battlefield) producecolor:red])) forever +auto=choice name(black) all(this) transforms((,newability[lord(creature[black]|battlefield) 1/1],newability[lord(swamp[basic]|battlefield) producecolor:black])) forever +auto=choice name(white) all(this) transforms((,newability[lord(creature[white]|battlefield) 1/1],newability[lord(plains[basic]|battlefield) producecolor:white])) forever text=As Gauntlet of Power enters the battlefield, choose a color. -- Creatures of the chosen color get +1/+1. -- Whenever a basic land is tapped for mana of the chosen color, its controller adds one mana of that color to his or her mana pool (in addition to the mana the land produces). mana={5} type=Artifact @@ -37927,13 +37936,16 @@ type=Artifact [card] name=Gemstone Mine auto=counter(0/0,3,Mining) -auto={T}{C(0/0,-1,Mining)}:Add{W} -auto={T}{C(0/0,-1,Mining)}:Add{U} -auto={T}{C(0/0,-1,Mining)}:Add{B} -auto={T}{C(0/0,-1,Mining)}:Add{R} -auto={T}{C(0/0,-1,Mining)}:Add{G} -auto=@tapped(this):bury all(gemstone mine[-counter{0/0.1.Mining}]) -auto=this(counter{0/0.1.Mining}<1) {0}:sacrifice all(this) +auto=this(counter{0/0,1,Mining}>1) {T}{C(0/0,-1,Mining)}:Add{G} +auto=this(counter{0/0,1,Mining}>1) {T}{C(0/0,-1,Mining)}:Add{R} +auto=this(counter{0/0,1,Mining}>1) {T}{C(0/0,-1,Mining)}:Add{U} +auto=this(counter{0/0,1,Mining}>1) {T}{C(0/0,-1,Mining)}:Add{B} +auto=this(counter{0/0,1,Mining}>1) {T}{C(0/0,-1,Mining)}:Add{W} +auto=this(counter{0/0,1,Mining}=1) {T}{C(0/0,-1,Mining)}:Add{G} && sacrifice +auto=this(counter{0/0,1,Mining}=1) {T}{C(0/0,-1,Mining)}:Add{R} && sacrifice +auto=this(counter{0/0,1,Mining}=1) {T}{C(0/0,-1,Mining)}:Add{U} && sacrifice +auto=this(counter{0/0,1,Mining}=1) {T}{C(0/0,-1,Mining)}:Add{B} && sacrifice +auto=this(counter{0/0,1,Mining}=1) {T}{C(0/0,-1,Mining)}:Add{W} && sacrifice text=Gemstone Mine enters the battlefield with three mining counters on it. -- {T}, Remove a mining counter from Gemstone Mine: Add one mana of any color to your mana pool. If there are no mining counters on Gemstone Mine, sacrifice it. type=Land [/card] @@ -38161,7 +38173,8 @@ toughness=4 [card] name=Ghastlord of Fugue auto=unblockable -auto=@combatdamaged(player) from(this):moveTo(myexile) target(*|opponenthand) +auto=@combatdamagefoeof(player) from(this):may moveTo(myexile) target(*|opponenthand) +auto=@combatdamageof(player) from(this):may moveTo(myexile) target(*|myhand) text=Ghastlord of Fugue is unblockable. -- Whenever Ghastlord of Fugue deals combat damage to a player, that player reveals his or her hand. You choose a card from it. That player exiles that card. mana={UB}{UB}{UB}{UB}{UB} type=Creature @@ -41578,8 +41591,8 @@ type=Instant [card] name=Graveblade Marauder abilities=deathtouch -auto=@combatdamaged(opponent) from(this):life:-type:creature:mygraveyard opponent -auto=@combatdamaged(controller) from(this):life:-type:creature:mygraveyard controller +auto=@combatdamagefoeof(player) from(this):life:-type:creature:mygraveyard opponent +auto=@combatdamageof(player) from(this):life:-type:creature:mygraveyard controller text=Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.) -- Whenever Graveblade Marauder deals combat damage to a player, that player loses life equal to the number of creature cards in your graveyard. mana={2}{B} type=Creature @@ -41924,7 +41937,8 @@ type=Enchantment [card] name=Greater Harvester auto=@each my upkeep:sacrifice notatarget(creature|mybattlefield) -auto=@combatdamaged(opponent) from(this):ability$!name(sacrifice 2 permanents) target(<2>*|mybattlefield) sacrifice!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(sacrifice 2 permanents) target(<2>*|mybattlefield) sacrifice!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(sacrifice 2 permanents) target(<2>*|mybattlefield) sacrifice!$ controller text=At the beginning of your upkeep, sacrifice a permanent. -- Whenever Greater Harvester deals combat damage to a player, that player sacrifices two permanents. mana={2}{B}{B}{B} type=Creature @@ -42196,7 +42210,7 @@ name=Grifter's Blade abilities=flash auto={1}:equip auto=1/1 -auto=aslongas(parents) retarget target(creature|mybattlefield) <1 +auto=aslongas(parents) rehook target(creature|mybattlefield) <1 text=Flash -- As Grifter's Blade enters the battlefield, choose a creature you control it could be attached to. If you do, it enters the battlefield attached to that creature. -- Equipped creature gets +1/+1. -- Equip {1} mana={3} type=Artifact @@ -43123,7 +43137,8 @@ subtype=Aura name=Guul Draz Specter abilities=flying auto=aslongas(*|opponenthand) 3/3 while <1 -auto=@combatdamaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller text=Flying -- Guul Draz Specter gets +3/+3 as long as an opponent has no cards in hand. -- Whenever Guul Draz Specter deals combat damage to a player, that player discards a card. mana={2}{B}{B} type=Creature @@ -43661,8 +43676,8 @@ type=Legendary Enchantment Artifact name=Hammer of Ruin auto={2}:equip auto=2/0 -auto=@combatdamaged(controller) from(this):may destroy target(equipment|myBattlefield) -auto=@combatdamaged(opponent) from(this):may destroy target(equipment|opponentBattlefield) +auto=teach(creature) transforms((,newability[@combatdamageof(player) from(this):may destroy target(equipment|myBattlefield)])) +auto=teach(creature) transforms((,newability[@combatdamagefoeof(player) from(this):may destroy target(equipment|opponentBattlefield)])) text=Equipped creature gets +2/+0. -- Whenever equipped creature deals combat damage to a player, you may destroy target Equipment that player controls. -- Equip {2} mana={2} type=Artifact @@ -44197,7 +44212,8 @@ toughness=3 [/card] [card] name=Haunted Cadaver -auto=@combatdamaged(player) from(this):may ability$!name(discard 3 cards) target(<3>*|myhand) reject!$ opponent && sacrifice all(this) +auto=@combatdamagefoeof(player) from(this):may ability$!name(discard 3 cards) target(<3>*|myhand) reject!$ opponent && sacrifice all(this) +auto=@combatdamageof(player) from(this):may ability$!name(discard 3 cards) target(<3>*|myhand) reject!$ controller && sacrifice all(this) facedown={3} autofacedown={1}{B}:morph text=Whenever Haunted Cadaver deals combat damage to a player, you may sacrifice it. If you do, that player discards three cards. -- Morph {1}{B} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) @@ -44411,7 +44427,8 @@ toughness=2 [/card] [card] name=Headhunter -auto=@combatdamaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller autofacedown={B}:morph facedown={3} text=Whenever Headhunter deals combat damage to a player, that player discards a card. -- Morph {B} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) @@ -44478,7 +44495,7 @@ name=Healer's Headdress auto={1}:equip auto=0/2 auto=teach(creature) {T}:prevent:1 target(creature,player) -auto={W}{W}:name(attach) retarget target(creature|mybattlefield) +auto={W}{W}:name(attach) rehook target(creature|mybattlefield) text=Equipped creature gets +0/+2 and has "{T}: Prevent the next 1 damage that would be dealt to target creature or player this turn." -- {W}{W}: Attach Healer's Headdress to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) mana={2} type=Artifact @@ -45150,7 +45167,7 @@ toughness=5 [/card] [card] name=Hellkite Hatchling -auto=may target(other creature|mybattlefield) sacrifice && counter(1/1,1) all(this) && all(this) transforms((,flying,trample)) forever +auto=may target(other creature|mybattlefield) sacrifice && counter(1/1,1) all(this) && all(this) transforms((,newability[flying],newability[trample])) forever text=Devour 1 (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with that many +1/+1 counters on it.) -- Hellkite Hatchling has flying and trample if it devoured a creature. mana={2}{R}{G} type=Creature @@ -45184,7 +45201,7 @@ toughness=8 [card] name=Hellkite Tyrant abilities=flying,trample -auto=@combatdamaged(player) from(this):all(artifact|opponentbattlefield) transforms((,newability[moveTo(opponentBattlefield)])) +auto=@combatdamagefoeof(player) from(this):moveTo(myBattlefield) all(artifact|opponentbattlefield) auto=@each my upkeep restriction{type(artifact|myBattlefield)~morethan~19}:winGame text=Flying, trample -- Whenever Hellkite Tyrant deals combat damage to a player, gain control of all artifacts that player controls. -- At the beginning of your upkeep, if you control twenty or more artifacts, you win the game. mana={4}{R}{R} @@ -45249,9 +45266,9 @@ subtype=Equipment name=Helm of the Ghastlord target=creature auto=teach(creature[blue]) 1/1 -auto=teach(creature[blue]) transforms((,newability[@damaged(opponent) from(this):draw:1 controller])) +auto=teach(creature[blue]) transforms((,newability[@damagefoeof(player) from(this):draw:1 controller])) auto=teach(creature[black]) 1/1 -auto=teach(creature[black]) transforms((,newability[@damaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent])) +auto=teach(creature[black]) transforms((,newability[@damagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent])) text=Enchant creature -- As long as enchanted creature is blue, it gets +1/+1 and has "Whenever this creature deals damage to an opponent, draw a card." -- As long as enchanted creature is black, it gets +1/+1 and has "Whenever this creature deals damage to an opponent, that player discards a card." mana={3}{UB} type=Enchantment @@ -45459,7 +45476,7 @@ toughness=2 name=Hero's Blade auto={4}:equip auto=3/2 -auto=@movedto(creature[legendary]|mybattlefield):may all(trigger[to]) retarget +auto=@movedto(creature[legendary]|mybattlefield):may all(trigger[to]) rehook text=Equipped creature gets +3/+2. -- Whenever a legendary creature enters the battlefield under your control, you may attach Hero's Blade to it. mana={2} type=Artifact @@ -45571,9 +45588,8 @@ toughness=2 name=Hickory Woodlot auto=tap auto=counter(0/0,2,Depletion) -auto={T}{C(0/0,-1,Depletion)}:Add{G}{G} -auto=@tapped(this):bury all(hickory woodlot[-counter{0/0.1.Depletion}]) -auto=this(counter{0/0.1.Depletion}<1) {0}:sacrifice all(this) +auto=this(counter{0/0,1,Depletion}>1) {T}{C(0/0,-1,Depletion)}:Add{G}{G} +auto=this(counter{0/0,1,Depletion}=1) {T}{C(0/0,-1,Depletion)}:Add{G}{G} && sacrifice text=Hickory Woodlot enters the battlefield tapped with two depletion counters on it. -- {T}, Remove a depletion counter from Hickory Woodlot: Add {G}{G} to your mana pool. If there are no depletion counters on Hickory Woodlot, sacrifice it. type=Land [/card] @@ -45720,7 +45736,7 @@ toughness=4 [/card] [card] name=High Tide -auto=all(island) transforms((,newability[@tappedformana(this):add{U}])) ueot +auto=emblem transforms((,newability[lord(island) produceextra:{U}])) ueot text=Until end of turn, whenever a player taps an Island for mana, that player adds {U} to his or her mana pool (in addition to the mana the land produces). mana={U} type=Instant @@ -46413,7 +46429,7 @@ toughness=2 [/card] [card] name=Hoofprints of the Stag -auto=@drawn(controller):may counter(0/0,1,Hoofprint) +auto=@drawof(player):may counter(0/0,1,Hoofprint) auto={C(0/0,-4,Hoofprint)}{2}{W}:token(Elemental,Creature Elemental,4/4,flying,white) myTurnOnly text=Whenever you draw a card, you may put a hoofprint counter on Hoofprints of the Stag. -- {2}{W}, Remove four hoofprint counters from Hoofprints of the Stag: Put a 4/4 white Elemental creature token with flying onto the battlefield. Activate this ability only during your turn. mana={1}{W} @@ -46477,7 +46493,7 @@ type=Land [card] name=Horizon Chimera abilities=flash,flying,trample -auto=@drawn(controller):life:1 controller +auto=@drawof(player):life:1 controller text=Flash. -- Flying. -- Trample. -- Whenever you draw a card, you gain 1 life. mana={2}{G}{U} type=Creature @@ -46558,7 +46574,7 @@ toughness=2 name=Horned Helm auto=1/1 auto=trample -auto={G}{G}:name(attach) retarget target(creature|mybattlefield) +auto={G}{G}:name(attach) rehook target(creature|mybattlefield) auto={1}:equip text=Equipped creature gets +1/+1 and has trample. -- {G}{G}: Attach Horned Helm to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) mana={2} @@ -47213,7 +47229,7 @@ type=Instant [/card] [card] name=Hunting Cheetah -auto=@damaged(opponent) from(this):may moveTo(myHand) target(forest|mylibrary) +auto=@damagefoeof(player) from(this):may moveTo(myHand) target(forest|mylibrary) text=Whenever Hunting Cheetah deals damage to an opponent, you may search your library for a Forest card, reveal that card, put it into your hand, then shuffle your library. mana={2}{G} type=Creature @@ -47506,7 +47522,7 @@ type=Sorcery [card] name=Hypnotic Specter abilities=flying -auto=@damaged(opponent) from(this):discard:1 opponent +auto=@damagefoeof(player) from(this):discard:1 opponent text=Flying -- Whenever Hypnotic Specter deals damage to an opponent, that player discards a card at random. mana={1}{B}{B} type=Creature @@ -48872,7 +48888,8 @@ toughness=11 [card] name=Ink-Eyes, Servant of Oni autohand={3}{B}{B}{N}:ninjutsu -auto=@combatdamaged(player) from(this):may moveTo(myBattlefield) target(creature|opponentgraveyard) +auto=@combatdamagefoeof(player) from(this):may moveTo(myBattlefield) target(creature|opponentgraveyard) +auto=@combatdamageof(player) from(this):may moveTo(myBattlefield) target(creature|mygraveyard) auto={1}{B}:all(this) regenerate text=Ninjutsu {3}{B}{B} ({3}{B}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) -- Whenever Ink-Eyes, Servant of Oni deals combat damage to a player, you may put target creature card from that player's graveyard onto the battlefield under your control. -- {1}{B}: Regenerate Ink-Eyes. mana={4}{B}{B} @@ -49936,7 +49953,7 @@ toughness=2 [/card] [card] name=Jace's Erasure -auto=@drawn(controller):may deplete:1 target(player) +auto=@drawof(player):may deplete:1 target(player) text=Whenever you draw a card, you may have target player put the top card of his or her library into his or her graveyard. mana={1}{U} type=Enchantment @@ -50048,7 +50065,7 @@ type=Sorcery [card] name=Jagged Poppet auto=@damaged(this):ability$!name(discard) target(*|myhand) reject!$ controller -auto=@combatdamaged(opponent) from(this) restriction{type(*|myhand)~lessthan~1}:ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this) restriction{type(*|myhand)~lessthan~1}:ability$!name(discard) target(*|myhand) reject!$ opponent text=Whenever Jagged Poppet is dealt damage, discard that many cards. -- Hellbent - Whenever Jagged Poppet deals combat damage to a player, if you have no cards in hand, that player discards cards equal to the damage. mana={1}{B}{R} type=Creature @@ -50640,6 +50657,7 @@ toughness=3 [card] name=Jokulmorder abilities=trample,doesnotuntap +auto=tap auto=aslongas(land|mybattlefield) choice target(<5>land|mybattlefield) sacrifice oneshot >4 auto=choice sacrifice all(this) auto=@movedTo(island|mybattlefield):untap @@ -51358,9 +51376,9 @@ toughness=2 [/card] [card] name=Kaldra -auto=all(helm of kaldra) newtarget -auto=all(shield of kaldra) newtarget -auto=all(sword of kaldra) newtarget +auto=all(helm of kaldra) newhook +auto=all(shield of kaldra) newhook +auto=all(sword of kaldra) newhook type=Legendary Creature subtype=Avatar power=4 @@ -52015,7 +52033,7 @@ toughness=3 [card] name=Kavu Predator abilities=trample -auto=@lifed(opponent):all(trigger[to]) dynamicability +auto=@lifefoeof(player):all(trigger[to]) dynamicability text=Trample -- Whenever an opponent gains life, put that many +1/+1 counters on Kavu Predator. mana={1}{G} type=Creature @@ -52159,7 +52177,7 @@ toughness=5 [/card] [card] name=Kederekt Parasite -auto=@drawn(opponent) restriction{type(*[red]|myBattlefield)~morethan~0}:may damage:1 opponent +auto=@drawfoeof(player) restriction{type(*[red]|myBattlefield)~morethan~0}:may damage:1 opponent text=Whenever an opponent draws a card, if you control a red permanent, you may have Kederekt Parasite deal 1 damage to that player. mana={B} type=Creature @@ -52170,7 +52188,7 @@ toughness=1 [card] name=Keen Sense target=creature -auto=@damaged(opponent) from(mytgt):may draw:1 controller +auto=@damagefoeof(player) from(mytgt):may draw:1 controller text=Enchant creature -- Whenever enchanted creature deals damage to an opponent, you may draw a card. mana={G} type=Enchantment @@ -53245,8 +53263,7 @@ toughness=1 name=Kiyomaro, First to Stand auto=type:*:myhand/type:*:myhand cdaactive auto=aslongas(*|myhand) vigilance >3 -auto=@damaged(player) from(this) restriction{type(*|myhand)~morethan~6}:life:7 controller >6 -auto=@damaged(creature) from(this) restriction{type(*|myhand)~morethan~6}:life:7 controller >6 +auto=@damaged(creature,player) from(this) restriction{type(*|myhand)~morethan~6}:if type(*|myhand)~morethan~6 then life:7 controller text=Kiyomaro, First to Stand's power and toughness are each equal to the number of cards in your hand. -- As long as you have four or more cards in hand, Kiyomaro has vigilance. -- Whenever Kiyomaro deals damage, if you have seven or more cards in hand, you gain 7 life. mana={3}{W}{W} type=Legendary Creature @@ -53928,7 +53945,7 @@ toughness=1 [/card] [card] name=Kor Outfitter -auto=target(equipment|mybattlefield) transforms((,newability[retarget target(creature|mybattlefield)])) forever +auto=target(equipment|mybattlefield) transforms((,newability[rehook target(creature|mybattlefield)])) forever text=When Kor Outfitter enters the battlefield, you may attach target Equipment you control to target creature you control. mana={W}{W} type=Creature @@ -54793,7 +54810,7 @@ type=Sorcery [card] name=Laboratory Maniac abilities=cantmilllose -auto=@drawn(controller) restriction{type(*|mylibrary)~equalto~0}:wingame +auto=@drawof(player) restriction{type(*|mylibrary)~equalto~0}:wingame text=If you would draw a card while your library has no cards in it, you win the game instead. mana={2}{U} type=Creature @@ -54967,7 +54984,7 @@ toughness=2 [/card] [card] name=Silverpelt Werewolf -auto=@combatdamaged(opponent) from(this):draw:1 controller +auto=@combatdamaged(player) from(this):draw:1 controller auto=@each upkeep restriction{lastturn(*|stack)~morethan~1}:flip(Lambholt Elder) text=Whenever Silverpelt Werewolf deals combat damage to a player, draw a card. -- At the beginning of each upkeep, if a player cast two or more spells last turn, transform Silverpelt Werewolf. color=green @@ -55110,7 +55127,8 @@ type=Sorcery [/card] [card] name=Larceny -auto=@combatdamaged(player) from(creature|mybattlefield):all(trigger[to]) ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(creature|mybattlefield):all(trigger[to]) ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(creature|mybattlefield):all(trigger[to]) ability$!name(discard) target(*|myhand) reject!$ controller text=Whenever a creature you control deals combat damage to a player, that player discards a card. mana={3}{B}{B} type=Enchantment @@ -56117,7 +56135,7 @@ toughness=2 [card] name=Lich's Tomb abilities=cantlifelose -auto=@lifeloss(controller):ability$!sacrifice notatarget(*|mybattlefield)!$ controller +auto=@lifelostof(player):ability$!sacrifice notatarget(*|mybattlefield)!$ controller text=You don't lose the game for having 0 or less life. -- Whenever you lose life, sacrifice a permanent for each 1 life you lost. (Damage causes loss of life.) mana={4} type=Artifact @@ -56640,7 +56658,8 @@ toughness=1 [card] name=Lightwielder Paladin abilities=first strike -auto=@combatdamaged(player) from(this):may moveTo(exile) target(*[black;red]|opponentBattlefield) +auto=@combatdamagefoeof(player) from(this):may moveTo(exile) target(*[black;red]|opponentBattlefield) +auto=@combatdamageof(player) from(this):may moveTo(exile) target(*[black;red]|myBattlefield) text=First strike (This creature deals combat damage before creatures without first strike.) -- Whenever Lightwielder Paladin deals combat damage to a player, you may exile target black or red permanent that player controls. mana={3}{W}{W} type=Creature @@ -56723,8 +56742,9 @@ type=Enchantment [card] name=Liliana's Reaver abilities=deathtouch -auto=@combatdamaged(opponent) from(this):token(-370740) -auto=@combatdamaged(opponent) from(this):ability$!name(discard) notatarget(*|myhand) reject!$ opponent +auto=@combatdamaged(player) from(this):token(-370740) +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) notatarget(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard) notatarget(*|myhand) reject!$ controller text=Deathtouch. -- Whenever Liliana's Reaver deals combat damage to a player, that player discards a card and you put a 2/2 black Zombie creature token onto the battlefield tapped. mana={2}{B}{B} type=Creature @@ -56957,7 +56977,7 @@ type=Artifact [card] name=Living Artifact target=artifact -auto=@damaged(controller):all(this) counter(0/0,thatmuch,vitality) +auto=@damageof(player):all(this) counter(0/0,thatmuch,vitality) auto={c(0/0,-1,vitality)}:life:1 controller limit:1 myupkeeponly text=Enchant artifact -- Whenever you're dealt damage, put that many vitality counters on Living Artifact. -- At the beginning of your upkeep, you may remove a vitality counter from Living Artifact. If you do, you gain 1 life. mana={g} @@ -57407,8 +57427,7 @@ toughness=1 [card] name=Looter il-Kor abilities=shadow -auto=@damaged(opponent) from(this):reject target(*|myHand) -auto=@damaged(opponent) from(this):draw:1 controller +auto=@damagefoeof(player) from(this):draw:1 && transforms((,newability[target(*|myhand) reject])) ueot text=Shadow (This creature can block or be blocked by only creatures with shadow.) -- Whenever Looter il-Kor deals damage to an opponent, draw a card, then discard a card. mana={1}{U} type=Creature @@ -57520,7 +57539,7 @@ toughness=2 [/card] [card] name=Lorescale Coatl -auto=@drawn(controller):may counter(1/1,1) +auto=@drawof(player):may counter(1/1,1) text=Whenever you draw a card, you may put a +1/+1 counter on Lorescale Coatl. mana={1}{G}{U} type=Creature @@ -57940,7 +57959,7 @@ toughness=2 [card] name=Lu Xun, Scholar General abilities=horsemanship -auto=@damaged(opponent) from(this):may draw:1 controller +auto=@damagefoeof(player) from(this):may draw:1 controller text=Horsemanship (This creature can't be blocked except by creatures with horsemanship.) -- Whenever Lu Xun, Scholar General deals damage to an opponent, you may draw a card. mana={2}{U}{U} type=Legendary Creature @@ -58776,7 +58795,7 @@ type=Enchantment [card] name=Magnetic Theft target=equipment -auto=transforms((,newability[retarget target(creature)])) forever +auto=transforms((,newability[rehook target(creature)])) forever text=Attach target Equipment to target creature. (Control of the Equipment doesn't change.) mana={R} type=Instant @@ -59283,8 +59302,8 @@ type=Instant [card] name=Mana Skimmer abilities=flying -auto=@damaged(opponent) from(this):frozen target(land|opponentbattlefield) -auto=@damaged(controller) from(this):frozen target(land|mybattlefield) +auto=@damagefoeof(player) from(this):frozen target(land|opponentbattlefield) +auto=@damageof(player) from(this):frozen target(land|mybattlefield) text=Flying -- Whenever Mana Skimmer deals damage to a player, tap target land that player controls. That land doesn't untap during its controller's next untap step. mana={3}{B} type=Creature @@ -59455,8 +59474,8 @@ toughness=1 [card] name=Mangara's Equity auto=upcost[{1}{W}] sacrifice -auto=choice name(choose black) transforms((,newability[@damaged(controller) from(creature[black]|*):damage:thatmuch all(trigger[from])],newability[@damaged(creature[white]|mybattlefield) from(creature[black]|*):damage:thatmuch all(trigger[from])])) forever -auto=choice name(choose red) transforms((,newability[@damaged(controller) from(creature[red]|*):damage:thatmuch all(trigger[from])],newability[@damaged(creature[white]|mybattlefield) from(creature[red]|*):damage:thatmuch all(trigger[from])])) forever +auto=choice name(choose black) transforms((,newability[@damageof(player) from(creature[black]|*):damage:thatmuch all(trigger[from])],newability[@damaged(creature[white]|mybattlefield) from(creature[black]|*):damage:thatmuch all(trigger[from])])) forever +auto=choice name(choose red) transforms((,newability[@damageof(player) from(creature[red]|*):damage:thatmuch all(trigger[from])],newability[@damaged(creature[white]|mybattlefield) from(creature[red]|*):damage:thatmuch all(trigger[from])])) forever text=As Mangara's Equity enters the battlefield, choose black or red. -- At the beginning of your upkeep, sacrifice Mangara's Equity unless you pay {1}{W}. -- Whenever a creature of the chosen color deals damage to you or a white creature you control, Mangara's Equity deals that much damage to that creature. mana={1}{W}{W} type=Enchantment @@ -59746,7 +59765,7 @@ toughness=1 [/card] [card] name=Mardu Heart-Piercer -auto=if thisturn(creature[attacking]|mybattlefield)~morethan~0 then damage:2 target(creature,player) +auto=if raid then damage:2 target(creature,player) text=Raid -- When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player. mana={3}{R} type=Creature @@ -59756,7 +59775,7 @@ toughness=3 [/card] [card] name=Mardu Hordechief -auto=if thisturn(creature[attacking]|mybattlefield)~morethan~0 then token(Warrior,Creature Warrior,1/1,white) +auto=if raid then token(Warrior,Creature Warrior,1/1,white) text=Raid - When Mardu Hordechief enters the battlefield, if you attacked with a creature this turn, put a 1/1 white Warrior creature token onto the battlefield. mana={2}{W} type=Creature @@ -59810,7 +59829,7 @@ toughness=1 [card] name=Mardu Skullhunter auto=tap -auto=if thisturn(creature[attacking]|mybattlefield)~morethan~0 then target(opponent) ability$!name(discard) target(*|myhand) reject!$ targetedplayer +auto=if raid then target(opponent) ability$!name(discard) target(*|myhand) reject!$ targetedplayer text=Mardu Skullhunter enters the battlefield tapped. -- Raid - When Mardu Skullhunter enters the battlefield, if you attacked with a creature this turn, target opponent discards a card. mana={1}{B} type=Creature @@ -59832,7 +59851,7 @@ toughness=2 [/card] [card] name=Mardu Warshrieker -auto=if thisturn(creature[attacking]|mybattlefield)~morethan~0 then Add{R}{W}{B} +auto=if raid then Add{R}{W}{B} text=Raid - When Mardu Warshrieker enters the battlefield, if you attacked with a creature this turn, add {R}{W}{B} to your mana pool. mana={3}{R} type=Creature @@ -59969,6 +59988,7 @@ subtype=Insect power=2 toughness=3 [/card] +#tappedformana stack...produceextra:selectmana don't support combination of mana at the moment since it a mayability not a menuability [card] name=Market Festival target=land @@ -59981,7 +60001,7 @@ subtype=Aura [card] name=Markov Blademaster abilities=double strike -auto=@combatdamaged(opponent) from(this):counter(1/1,1) +auto=@combatdamaged(player) from(this):counter(1/1,1) text=Double strike -- Whenever Markov Blademaster deals combat damage to a player, put a +1/+1 counter on it. mana={1}{R}{R} type=Creature @@ -60365,7 +60385,7 @@ subtype=Aura [/card] [card] name=Mask of Memory -auto=@damaged(opponent) from(mytgt):may draw:2 controller && reject target(*|myhand) +auto=@damaged(player) from(mytgt):may draw:2 controller && reject target(*|myhand) text=Whenever equipped creature deals combat damage to a player, you may draw two cards. If you do, discard a card. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery. This card enters the battlefield unattached and stays on the battlefield if the creature leaves.) auto={1}:equip mana={2} @@ -61206,7 +61226,7 @@ auto=@movedTo(other creature[power<=2]|myBattlefield):pay({1}) draw:1 text=Whenever another creature with power 2 or less enters the battlefield under your control, you may pay {1}. If you do, draw a card. mana={2}{W} type=Creature -subtype=Human Solider +subtype=Human Soldier power=2 toughness=2 [/card] @@ -61814,7 +61834,7 @@ toughness=2 [/card] [card] name=Michiko Konda, Truth Seeker -auto=@combatdamaged(controller) from(creature|opponentbattlefield):ability$!name(sacrifice permanent) notatarget(*|mybattlefield) sacrifice!$ opponent +auto=@damageof(player) from(*|opponentstack,opponentbattlefield,opponentgraveyard,opponenthand,opponentexile):ability$!name(sacrifice permanent) notatarget(*|mybattlefield) sacrifice!$ opponent text=Whenever a source an opponent controls deals damage to you, that player sacrifices a permanent. mana={3}{W} type=Legendary Creature @@ -62027,7 +62047,7 @@ name=Mikaeus, the Unhallowed abilities=intimidate auto=lord(other creature[-human]|mybattlefield) 1/1 auto=lord(other creature[-human]|mybattlefield) undying -auto=@damaged(controller) from(human):all(trigger[from]) destroy +auto=@damageof(player) from(human):all(trigger[from]) destroy text=Intimidate -- Whenever a Human deals damage to you, destroy it. -- Other non-Human creatures you control get +1/+1 and have undying. (When a creature with undying dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) mana={3}{B}{B}{B} type=Legendary Creature @@ -62121,7 +62141,7 @@ type=Legendary Land [/card] [card] name=Mind's Eye -auto=@drawn(opponent):pay({1}) draw:1 +auto=@drawfoeof(player):pay({1}) draw:1 text=Whenever an opponent draws a card, you may pay {1}. If you do, draw a card. mana={5} type=Artifact @@ -62324,7 +62344,7 @@ toughness=2 [/card] [card] name=Mindcrank -auto=@lifeloss(opponent):deplete:thatmuch opponent +auto=@lifelostfoeof(player):deplete:thatmuch opponent text=Whenever an opponent loses life, that player puts that many cards from the top of his or her library into his or her graveyard. (Damage dealt by sources without infect causes loss of life.) mana={2} type=Artifact @@ -62363,7 +62383,8 @@ toughness=1 [card] name=Mindleech Mass abilities=trample -auto=@combatdamaged(player) from(this):may target(*[-land]|opponenthand) castcard(normal) +auto=@combatdamagefoeof(player) from(this):may target(*[-land]|opponenthand) castcard(normal) +auto=@combatdamageof(player) from(this):may target(*[-land]|myhand) castcard(normal) text=Trample -- Whenever Mindleech Mass deals combat damage to a player, you may look at that player's hand. If you do, you may cast a nonland card in it without paying that card's mana cost. mana={5}{U}{B}{B} type=Creature @@ -62404,7 +62425,7 @@ type=Enchantment [card] name=Mindscour Dragon abilities=flying -auto=@combatdamaged(opponent) from(this):deplete:4 target(player) +auto=@combatdamagefoeof(player) from(this):deplete:4 target(player) text=Flying -- Whenever Mindscour Dragon deals combat damage to an opponent, target player puts the top 4 cards of his or her library into his or her graveyard. mana={4}{U}{U} type=Creature @@ -63062,7 +63083,8 @@ toughness=4 [card] name=Mistblade Shinobi autohand={U}{N}:ninjutsu -auto=@combatdamaged(player) from(this):may moveTo(ownerhand) target(creature|opponentBattlefield) +auto=@combatdamagefoeof(player) from(this):may moveTo(ownerhand) target(creature|opponentBattlefield) +auto=@combatdamageof(player) from(this):may moveTo(ownerhand) target(creature|myBattlefield) text=Ninjutsu {U} ({U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) -- Whenever Mistblade Shinobi deals combat damage to a player, you may return target creature that player controls to its owner's hand. mana={2}{U} type=Creature @@ -64288,7 +64310,8 @@ type=Sorcery name=Mordant Dragon abilities=flying auto={1}{R}:1/0 -auto=@combatdamaged(opponent) from(this):may name(same amount of damage to opponent's creature) damage:thatmuch target(creature|opponentbattlefield) +auto=@combatdamagefoeof(player) from(this):may name(same amount of damage to opponent's creature) damage:thatmuch target(creature|opponentbattlefield) +auto=@combatdamageof(player) from(this):may name(same amount of damage to controller creature) damage:thatmuch target(creature|mybattlefield) text=Flying -- {1}{R}: Mordant Dragon gets +1/+0 until end of turn. -- Whenever Mordant Dragon deals combat damage to a player, you may have it deal that much damage to target creature that player controls. mana={3}{R}{R}{R} type=Creature @@ -66470,7 +66493,8 @@ type=Enchantment [card] name=Needle Specter abilities=flying,wither -auto=@combatdamaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller text=Flying -- Wither (This deals damage to creatures in the form of -1/-1 counters.) -- Whenever Needle Specter deals combat damage to a player, that player discards that many cards. mana={1}{B}{B} type=Creature @@ -66866,7 +66890,7 @@ toughness=2 [card] name=Neurok Stealthsuit auto=teach(creature) shroud -auto={U}{U}:name(attach) retarget target(creature|mybattlefield) +auto={U}{U}:name(attach) rehook target(creature|mybattlefield) auto={1}:equip text=Equipped creature has shroud. (It can't be the target of spells or abilities.) -- {U}{U}: Attach Neurok Stealthsuit to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) mana={2} @@ -67081,7 +67105,7 @@ toughness=2 name=Nicol Bolas auto=flying auto=upcost[{U}{B}{R}] sacrifice -auto=@damaged(opponent) from(this):reject all(*|opponenthand) +auto=@damagefoeof(player) from(this):reject all(*|opponenthand) text=Flying -- At the beginning of your upkeep, sacrifice Nicol Bolas unless you pay {U}{B}{R}. -- Whenever Nicol Bolas deals damage to an opponent, that player discards his or her hand. mana={2}{U}{U}{B}{B}{R}{R} type=Legendary Creature @@ -67103,8 +67127,7 @@ subtype=Bolas [/card] [card] name=Night Dealings -auto=@damaged(opponent) from(*|mybattlefield):counter(0/0,thatmuch,Theft) -auto=@damaged(opponent) from(*|mystack):counter(0/0,thatmuch,Theft) +auto=@damagefoeof(player) from(*|mybattlefield,mystack,mygraveyard,mylibrary,myexile):counter(0/0,thatmuch,Theft) auto={2}{B}{B}:name(X = 0) && moveto(myhand) target(*[-land;manacost=0]|mylibrary) auto=this(counter{0/0.1.Theft}=>) {2}{B}{B}{C(0/0,-1,Theft)}:name(X = 1) && moveTo(myhand) target(*[-land;manacost=1]|mylibrary) auto=this(counter{0/0.2.Theft}=>) {2}{B}{B}{C(0/0,-2,Theft)}:name(X = 2) && moveTo(myhand) target(*[-land;manacost=2]|mylibrary) @@ -67596,7 +67619,7 @@ toughness=2 [/card] [card] name=Nirkana Revenant -auto=@tappedformana(swamp|mybattlefield):Add{B} +auto=lord(swamp|mybattlefield) transforms((,newability[produceextra:{B}])) auto={B}:1/1 text=Whenever you tap a Swamp for mana, add {B} to your mana pool (in addition to the mana the land produces). -- {B}:Nirkana Revenant gets +1/+1 until end of turn. type=Creature @@ -67680,7 +67703,7 @@ toughness=5 [card] name=Niv-Mizzet, the Firemind abilities=flying -auto=@drawn(controller):damage:1 target(creature,player) +auto=@drawof(player):damage:1 target(creature,player) auto={T}:draw:1 text=Flying -- Whenever you draw a card, Niv-Mizzet, the Firemind deals 1 damage to target creature or player. -- {T}: Draw a card. mana={2}{U}{U}{R}{R} @@ -67691,7 +67714,7 @@ toughness=4 [/card] [card] name=No Mercy -auto=@damaged(controller) from(creature):all(trigger[from]) destroy +auto=@damageof(player) from(creature):all(trigger[from]) destroy text=Whenever a creature deals damage to you, destroy it. mana={2}{B}{B} type=Enchantment @@ -68602,7 +68625,7 @@ name=Obsidian Battle-Axe auto={3}:equip auto=2/1 auto=haste -auto=@movedto(creature[warrior]|battlefield):may all(trigger[to]) retarget +auto=@movedto(creature[warrior]|battlefield):may all(trigger[to]) rehook text=Equipped creature gets +2/+1 and has haste. -- Whenever a Warrior creature enters the battlefield, you may attach Obsidian Battle-Axe to it. -- Equip {3} mana={3} type=Tribal Artifact @@ -68699,8 +68722,8 @@ toughness=2 [card] name=Odylic Wraith abilities=swampwalk -auto=@damaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent -auto=@damaged(controller) from(this):reject target(*|myhand) +auto=@damagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@damageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller text=Swampwalk -- Whenever Odylic Wraith deals damage to a player, that player discards a card. mana={3}{B} type=Creature @@ -68956,7 +68979,8 @@ type=Artifact [/card] [card] name=Okiba-Gang Shinobi -auto=@combatdamaged(opponent) from(this):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ controller autohand={3}{B}{N}:ninjutsu text=Ninjutsu {3}{B} ({3}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) -- Whenever Okiba-Gang Shinobi deals combat damage to a player, that player discards two cards. mana={3}{B}{B} @@ -69163,7 +69187,8 @@ type=Artifact name=Oona's Blackguard abilities=flying auto=@movedto(other rogue|myBattlefield):all(trigger[to]) counter(1/1,1) -auto=@combatdamaged(opponent) from(creature[counter{1/1.1}]|mybattlefield):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(creature[counter{1/1.1}]|mybattlefield):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(creature[counter{1/1.1}]|mybattlefield):ability$!name(discard) target(*|myhand) reject!$ controller text=Flying -- Each other Rogue creature you control enters the battlefield with an additional +1/+1 counter on it. -- Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card. mana={1}{B} type=Creature @@ -69345,7 +69370,7 @@ toughness=3 name=Ophidian Eye abilities=flash target=creature -auto=@damaged(opponent) from(mytgt):may draw:1 controller +auto=@damagefoeof(player) from(mytgt):may draw:1 controller text=Flash (You may cast this spell any time you could cast an instant.) -- Enchant creature -- Whenever enchanted creature deals damage to an opponent, you may draw a card. mana={2}{U} type=Enchantment @@ -69744,8 +69769,8 @@ toughness=4 [card] name=Order of Yawgmoth abilities=fear -auto=@damaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent -auto=@damaged(controller) from(this):reject target(*|myhand) +auto=@damagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@damageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller text=Fear (This creature can't be blocked except by artifact creatures and/or black creatures.) -- Whenever Order of Yawgmoth deals damage to a player, that player discards a card. mana={2}{B}{B} type=Creature @@ -69826,7 +69851,7 @@ toughness=1 name=Orgg abilities=trample auto=cantbeblockerof(creature[white;power>=3]) -auto=aslongas(creature[power>=3;-tapped]|opponentbattlefield]) cantattack +auto=aslongas(creature[power>=3;-tapped]|opponentbattlefield) cantattack text=Trample -- Orgg can't attack if defending player controls an untapped creature with power 3 or greater. -- Orgg can't block creatures with power 3 or greater. mana={3}{R}{R} type=Creature @@ -70224,7 +70249,7 @@ subtype=Swamp Forest [card] name=Overgrowth target=land -auto=@tappedformana(mytgt):Add{G}{G} targetcontroller +auto=teach(land) transforms((,newability[produceextra:{G}{G}])) text=Enchant land (Target a land as you cast this. This card enters the battlefield attached to that land.) -- Whenever enchanted land is tapped for mana, its controller adds {G}{G} to his or her mana pool (in addition to the mana the land produces). mana={2}{G} type=Enchantment @@ -70469,7 +70494,7 @@ toughness=2 [/card] [card] name=Pain Magnification -auto=@damaged(opponent) restriction{compare(thatmuch)~morethan~2}:ability$!reject notatarget(*|myhand)!$ opponent +auto=@damagefoeof(player) restriction{compare(thatmuch)~morethan~2}:ability$!reject notatarget(*|myhand)!$ opponent text=Whenever an opponent is dealt 3 or more damage by a single source, that player discards a card. mana={1}{B}{R} type=Enchantment @@ -71418,9 +71443,8 @@ toughness=2 name=Peat Bog auto=tap auto=counter(0/0,2,Depletion) -auto={T}{C(0/0,-1,Depletion)}:Add{B}{B} -auto=@tapped(this):bury all(peat bog[-counter{0/0.1.Depletion}]|myBattlefield) -auto=this(counter{0/0.1.Depletion}<1) {0}:sacrifice all(this) +auto=this(counter{0/0,1,Depletion}>1) {T}{C(0/0,-1,Depletion)}:Add{B}{B} +auto=this(counter{0/0,1,Depletion}=1) {T}{C(0/0,-1,Depletion)}:Add{B}{B} && sacrifice text=Peat Bog enters the battlefield tapped with two depletion counters on it. -- {T}, Remove a depletion counter from Peat Bog: Add {B}{B} to your mana pool. If there are no depletion counters on Peat Bog, sacrifice it. type=Land [/card] @@ -71958,12 +71982,12 @@ subtype=Golem power=4 toughness=2 [/card] -##the cantlose on phage only last until the ability checks if she was played from hand enjoy :) [card] name=Phage the Untouchable auto=ifnot casted(this) then wingame opponent auto=@combatdamaged(creature) from(this):all(trigger[to]) bury -auto=@combatdamaged(player) from(this):winGame controller +auto=@combatdamagefoeof(player) from(this):winGame controller +auto=@combatdamageof(player) from(this):winGame opponent text=When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game. Whenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated. -- Whenever Phage deals combat damage to a player, that player loses the game. mana={3}{B}{B}{B}{B} type=Legendary Creature @@ -72798,8 +72822,8 @@ type=Sorcery [/card] [card] name=Phyrexian Tyranny -auto=@drawn(opponent):name(pay or lifeloss) ability$!name(pay or lifeloss) pay[[{2}]] name(pay 2 mana) donothing?life:-2!$ opponent -auto=@drawn(controller):name(pay or lifeloss) ability$!name(pay or lifeloss) pay[[{2}]] name(pay 2 mana) donothing?life:-2!$ controller +auto=@drawfoeof(player):name(pay or lifeloss) ability$!name(pay or lifeloss) pay[[{2}]] name(pay 2 mana) donothing?life:-2!$ opponent +auto=@drawof(player):name(pay or lifeloss) ability$!name(pay or lifeloss) pay[[{2}]] name(pay 2 mana) donothing?life:-2!$ controller text=Whenever a player draws a card, that player loses 2 life unless he or she pays {2}. mana={U}{B}{R} type=Enchantment @@ -73170,7 +73194,7 @@ toughness=3 [/card] [card] name=Piston Sledge -auto=aslongas(parents) retarget target(creature|mybattlefield) <1 +auto=aslongas(parents) rehook target(creature|mybattlefield) <1 auto=teach(creature) 3/1 auto={S(artifact|mybattlefield)}:equip text=When Piston Sledge enters the battlefield, attach it to target creature you control. -- Equipped creature gets +3/+1. -- Equip - Sacrifice an artifact. @@ -74509,8 +74533,8 @@ type=Instant [card] name=Primal Clay auto=choice name(enter as 3/3) transforms((,setpower=3,settoughness=3)) forever -auto=choice name(enter as 2/2 fly) transforms((,flying,setpower=2,settoughness=2)) forever -auto=choice name(enter as a wall) transforms((Wall,defender,setpower=1,settoughness=6)) forever +auto=choice name(enter as 2/2 fly) transforms((,newability[flying],setpower=2,settoughness=2)) forever +auto=choice name(enter as a wall) transforms((Wall,newability[defender],setpower=1,settoughness=6)) forever text=As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Shapeshifter Wall artifact creature with defender. mana={4} type=Artifact Creature @@ -75238,8 +75262,9 @@ subtype=Aura [/card] [card] name=Psychic Possession +target=opponent auto=phasealter(remove,draw,controller) -auto=@drawn(opponent):may draw:1 controller +auto=@drawn(targetedplayer):may draw:1 controller text=Enchant opponent -- Skip your draw step. -- Whenever enchanted opponent draws a card, you may draw a card. mana={2}{U}{U} type=Enchantment @@ -75296,7 +75321,7 @@ type=Enchantment [card] name=Psychosis Crawler auto=type:*:myhand/type:*:myhand cdaactive -auto=@drawn(controller):life:-1 opponent +auto=@drawof(player):life:-1 opponent text=Psychosis Crawler's power and toughness are each equal to the number of cards in your hand. - Whenever you draw a card, each opponent loses 1 life. mana={5} type=Artifact Creature @@ -75493,7 +75518,7 @@ type=Instant name=Punishing Fire target=creature,player auto=damage:2 -autograveyard=@lifed(opponent):pay({R}) moveto(ownerhand) +autograveyard=@lifefoeof(player):pay({R}) moveto(ownerhand) text=Punishing Fire deals 2 damage to target creature or player. -- Whenever an opponent gains life, you may pay {R}. If you do, return Punishing Fire from your graveyard to your hand. mana={1}{R} type=Instant @@ -75554,6 +75579,17 @@ mana={W} type=Instant [/card] [card] +name=Puresteel Paladin +auto=@movedTo(equipment|mybattlefield):may draw:1 controller +auto=lord(equipment|mybattlefield) transforms((,newability[{0}:name(Equip Zero) rehook target(creature|mybattlefield) assorcery restriction{type(artifact|mybattlefield)~morethan~2}])) +text=Whenever an Equipment enters the battlefield under your control, you may draw a card. -- Metalcraft - As long as you control 3 or more artifacts, each Equipment you control has equip {0}. +mana={W}{W} +type=Creature +subtype=Human Knight +power=2 +toughness=2 +[/card] +[card] name=Purge target=creature[black;artifact] auto=bury @@ -75704,8 +75740,7 @@ toughness=4 [/card] [card] name=Putrid Warrior -auto=@damaged(creature) from(this):all(this) transforms((,newability[chocie all(player) life:-1],newability[choice all(player) life:1])) ueot -auto=@damaged(opponent) from(this):all(this) transforms((,newability[choice all(player) life:-1],newability[choice all(player) life:1])) ueot +auto=@damaged(creature,player) from(this):all(this) transforms((,newability[chocie all(player) life:-1],newability[choice all(player) life:1])) ueot text=Whenever Putrid Warrior deals damage, choose one - each player loses 1 life; or each player gains 1 life. mana={W}{B} type=Creature @@ -76028,7 +76063,7 @@ type=Enchantment [card] name=Quest for the Holy Relic auto=@movedTo(creature|mystack):may counter(0/0,1,Quest) all(this) -auto={C(0/0,-5,Quest)}{S}:name(move and attach) target(equipment|mylibrary) transforms((,newability[retarget target(creature|mybattlefield)],newability[moveto(mybattlefield)])) +auto={C(0/0,-5,Quest)}{S}:name(move and attach) target(equipment|mylibrary) moveto(mybattlefield) and!(transforms((,newability[rehook target(creature|mybattlefield)])))! text=Whenever you cast a creature spell, you may put a quest counter on Quest for the Holy Relic. -- Remove five quest counters from Quest for the Holy Relic and sacrifice it: Search your library for an Equipment card, put it onto the battlefield, and attach it to a creature you control. Then shuffle your library. mana={W} type=Enchantment @@ -76189,8 +76224,7 @@ name=Quietus Spike text=Equipped creature has deathtouch. -- Whenever equipped creature deals combat damage to a player, that player loses half his or her life, rounded up. -- Equip {3} mana={3} auto={3}:equip -auto=teach(creature) deathtouch -auto=@combatdamaged(opponent) from(mytgt):life:-halfupopponentlifetotal opponent +auto=teach(creature) transforms((,newability[deathtouch],newability[@combatdamagefoeof(player) from(this):life:-halfupopponentlifetotal opponent],newability[@combatdamageof(player) from(this):life:-halfuplifetotal controller])) type=Artifact subtype=Equipment [/card] @@ -76987,8 +77021,8 @@ toughness=3 [/card] [card] name=Rakdos Ringleader -auto=@combatdamaged(opponent) from(this):discard:1 opponent -auto=@combatdamaged(controller) from(this):discard:1 controller +auto=@combatdamagefoeof(player) from(this):discard:1 opponent +auto=@combatdamageof(player) from(this):discard:1 controller auto={B}:regenerate abilities=first strike text=First strike -- Whenever Rakdos Ringleader deals combat damage to a player, that player discards a card at random. -- {B}: Regenerate Rakdos Ringleader. @@ -77019,8 +77053,8 @@ type=Artifact name=Rakdos the Defiler abilities=flying,trample auto=@combat(attacking) source(this):choice target(*|mybattlefield) sacrifice -auto=@combatdamaged(opponent) from(this):ability$!name(sacrifice) target(*|mybattlefield) sacrifice!$ opponent -auto=@combatdamaged(controller) from(this):ability$!name(sacrifice) target(*|mybattlefield) sacrifice!$ controller +auto=@combatdamagefoeof(player) from(this):ability$!name(sacrifice) target(*|mybattlefield) sacrifice!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(sacrifice) target(*|mybattlefield) sacrifice!$ controller text=Flying, trample -- Whenever Rakdos the Defiler attacks, sacrifice half the non-Demon permanents you control, rounded up. -- Whenever Rakdos deals combat damage to a player, that player sacrifices half the non-Demon permanents he or she controls, rounded up. mana={2}{B}{B}{R}{R} type=Legendary Creature @@ -77667,7 +77701,8 @@ toughness=4 name=Raven Guild Master facedown={3} autofacedown={2}{U}{U}:morph -auto=@combatdamaged(player) from(this):deplete:10 opponent +auto=@combatdamagefoeof(player) from(this):deplete:10 opponent +auto=@combatdamageof(player) from(this):deplete:10 controller text=Whenever Raven Guild Master deals combat damage to a player, that player exiles the top ten cards of his or her library. -- Morph {2}{U}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) mana={1}{U}{U} type=Creature @@ -78612,7 +78647,7 @@ toughness=6 [/card] [card] name=Reef Pirates -auto=@damaged(opponent) from(this):deplete:1 opponent +auto=@damagefoeof(player) from(this):deplete:1 opponent text=Whenever Reef Pirates deals damage to an opponent, that player puts the top card of his or her library into his or her graveyard. mana={1}{U}{U} type=Creature @@ -78998,9 +79033,8 @@ type=Sorcery name=Remote Farm auto=tap auto=counter(0/0,2,Depletion) -auto={T}{C(0/0,-1,Depletion)}:Add{W}{W} -auto=@tapped(this):bury all(remote farm[-counter{0/0.1.Depletion}]|myBattlefield) -auto=this(counter{0/0.1.Depletion}<1) {0}:sacrifice all(this) +auto=this(counter{0/0,1,Depletion}>1) {T}{C(0/0,-1,Depletion)}:Add{W}{W} +auto=this(counter{0/0,1,Depletion}=1) {T}{C(0/0,-1,Depletion)}:Add{W}{W} && sacrifice text=Remote Farm enters the battlefield tapped with two depletion counters on it. -- {T}, Remove a depletion counter from Remote Farm: Add {W}{W} to your mana pool. If there are no depletion counters on Remote Farm, sacrifice it. type=Land [/card] @@ -79571,8 +79605,7 @@ type=Instant [card] name=Retaliator Griffin abilities=flying -auto=@damaged(controller) from(*|opponentbattlefield):may all(trigger[to]) dynamicability -auto=@damaged(controller) from(*|opponentstack):may all(trigger[to]) dynamicability +auto=@damageof(player) from(*|opponentbattlefield,opponentstack,opponentgraveyard,opponentlibrary,opponentexile):may all(trigger[to]) dynamicability text=Flying -- Whenever a source an opponent controls deals damage to you, you may put that many +1/+1 counters on Retaliator Griffin. mana={1}{R}{G}{W} type=Creature @@ -80532,7 +80565,7 @@ toughness=3 name=Riptide Entrancer facedown={3} autofacedown={U}{U}:morph -auto=@combatdamaged(player) from(this):may moveTo(mybattlefield) target(creature|myBattlefield) && sacrifice all(this) +auto=@combatdamagefoeof(player) from(this):may moveTo(mybattlefield) target(creature|opponentBattlefield) && sacrifice all(this) text=Whenever Riptide Entrancer deals combat damage to a player, you may sacrifice it. If you do, gain control of target creature that player controls. (This effect lasts indefinitely.) -- Morph {U}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) mana={1}{U}{U} type=Creature @@ -80549,7 +80582,8 @@ type=Land [/card] [card] name=Riptide Pilferer -auto=@combatdamaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller autofacedown={U}:morph facedown={3} text=Whenever Riptide Pilferer deals combat damage to a player, that player discards a card. -- Morph {U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) @@ -80869,7 +80903,8 @@ toughness=1 [/card] [card] name=River of Tears -auto={t}:name(Add Mana) if type(land[fresh]|mybattlefield)~morethan~0 then add{B} else add{U} +auto=aslongas(land[fresh]|mybattlefield) {T}:add{B} >0 +auto=aslongas(land[fresh]|mybattlefield) {T}:add{U} <1 text={T}: Add {U} to your mana pool. If you played a land this turn, add {B} to your mana pool instead. type=Land [/card] @@ -81190,7 +81225,7 @@ toughness=4 [card] name=Rogue's Gloves auto={2}:equip -auto=@damaged(opponent) from(mytgt):may draw:1 controller +auto=@damaged(player) from(mytgt):may draw:1 controller text=Whenever equipped creature deals combat damage to a player, you may draw a card. -- Equip: 2 mana={2} type=Artifact @@ -81296,7 +81331,7 @@ toughness=2 [/card] [card] name=Ronin Warclub -auto=@movedto(creature|myBattlefield):choice all(trigger[to]) retarget +auto=@movedto(creature|myBattlefield):all(trigger[to]) rehook auto=+2/+1 text=Equipped creature gets +2/+1. -- Whenever a creature enters the battlefield under your control, attach Ronin Warclub to that creature. -- Equip {5} ({5}: Attach to target creature you control. Equip only as a sorcery.) mana={3} @@ -81535,7 +81570,8 @@ toughness=1 [card] name=Rootwater Thief auto={U}:flying -auto=@combatdamaged(player) from(this):pay({2}) moveto(exile) and!(shuffle)! notatarget(*|opponentlibrary) +auto=@combatdamagefoeof(player) from(this):pay({2}) moveto(exile) and!(shuffle)! notatarget(*|opponentlibrary) +auto=@combatdamageof(player) from(this):pay({2}) moveto(exile) and!(shuffle)! notatarget(*|mylibrary) text={U}: Rootwater Thief gains flying until end of turn. -- Whenever Rootwater Thief deals combat damage to a player, you may pay {2}. If you do, search that player's library for a card and exile it, then the player shuffles his or her library. mana={1}{U} type=Creature @@ -81873,7 +81909,7 @@ toughness=6 [/card] [card] name=Ruinous Minotaur -auto=@damaged(opponent) from(this):moveto(graveyard) notatarget(land|mybattlefield) +auto=@damagefoeof(player) from(this):moveto(graveyard) notatarget(land|mybattlefield) text=Whenever Ruinous Minotaur deals damage to an opponent, sacrifice a land. mana={1}{R}{R} type=Creature @@ -82326,7 +82362,8 @@ toughness=* [/card] [card] name=Rustmouth Ogre -auto=@combatdamaged(player) from(this):may destroy target(artifact|opponentBattlefield) +auto=@combatdamagefoeof(player) from(this):may destroy target(artifact|opponentBattlefield) +auto=@combatdamageof(player) from(this):may destroy target(artifact|myBattlefield) text=Whenever Rustmouth Ogre deals combat damage to a player, you may destroy target artifact that player controls. mana={4}{R}{R} type=Creature @@ -82789,7 +82826,7 @@ toughness=6 name=Sai of the Shinobi auto={2}:equip auto=1/1 -auto=@movedto(creature|mybattlefield):may all(trigger[to]) retarget +auto=@movedto(creature|mybattlefield):may all(trigger[to]) rehook text=Equipped creature gets +1/+1. -- Whenever a creature enters the battlefield under your control, you may attach Sai of the Shinobi to it. -- Equip {2} mana={1} type=Artifact @@ -83233,9 +83270,8 @@ type=Artifact name=Sandstone Needle auto=tap auto=counter(0/0,2,Depletion) -auto={T}{C(0/0,-1,Depletion)}:Add{R}{R} -auto=@tapped(this):bury all(sandstone needle[-counter{0/0.1.Depletion}]|myBattlefield) -auto=this(counter{0/0.1.Depletion}<1) {0}:sacrifice all(this) +auto=this(counter{0/0,1,Depletion}>1) {T}{C(0/0,-1,Depletion)}:Add{R}{R} +auto=this(counter{0/0,1,Depletion}=1) {T}{C(0/0,-1,Depletion)}:Add{R}{R} && sacrifice text=Sandstone Needle enters the battlefield tapped with two depletion counters on it. -- {T}, Remove a depletion counter from Sandstone Needle: Add {R}{R} to your mana pool. If there are no depletion counters on Sandstone Needle, sacrifice it. type=Land [/card] @@ -83331,7 +83367,7 @@ type=Sorcery [/card] [card] name=Sanguine Bond -auto=@lifed(controller):dynamicability +auto=@lifeof(player):dynamicability text=Whenever you gain life, target opponent loses that much life. mana={3}{B}{B} type=Enchantment @@ -83471,9 +83507,8 @@ toughness=2 name=Saprazzan Skerry auto=tap auto=counter(0/0,2,Depletion) -auto={T}{C(0/0,-1,Depletion)}:Add{U}{U} -auto=@tapped(this):bury all(saprazzan skerry[-counter{0/0.1.Depletion}]|myBattlefield) -auto=this(counter{0/0.1.Depletion}<1) {0}:sacrifice all(this) +auto=this(counter{0/0,1,Depletion}>1) {T}{C(0/0,-1,Depletion)}:Add{U}{U} +auto=this(counter{0/0,1,Depletion}=1) {T}{C(0/0,-1,Depletion)}:Add{U}{U} && sacrifice text=Saprazzan Skerry enters the battlefield tapped with two depletion counters on it. -- {T}, Remove a depletion counter from Saprazzan Skerry: Add {U}{U} to your mana pool. If there are no depletion counters on Saprazzan Skerry, sacrifice it. type=Land [/card] @@ -83662,8 +83697,8 @@ toughness=1 [/card] [card] name=Satyr Firedancer -auto=@damaged(opponent) from(instant|mystack):damage:thatmuch target(creature|opponentbattlefield) -auto=@damaged(opponent) from(sorcery|mystack):damage:thatmuch target(creature|opponentbattlefield) +auto=@damagefoeof(player) from(instant|mystack):damage:thatmuch target(creature|opponentbattlefield) +auto=@damagefoeof(player) from(sorcery|mystack):damage:thatmuch target(creature|opponentbattlefield) text=Whenever an instant or sorcery spell you control deals damage to an opponent, Satyr Firedancer deals that much damage to target creature that player controls. mana={1}{R} type=Enchantment Creature @@ -84350,7 +84385,8 @@ type=Land [card] name=Scion of Darkness abilities=trample -auto=@combatdamaged(player) from(this):may moveTo(myBattlefield) target(creature|opponentgraveyard) +auto=@combatdamagefoeof(player) from(this):may moveTo(myBattlefield) target(creature|opponentgraveyard) +auto=@combatdamageof(player) from(this):may moveTo(myBattlefield) target(creature|mygraveyard) autohand=__CYCLING__({3}) text=Trample -- Whenever Scion of Darkness deals combat damage to a player, you may put target creature card from that player's graveyard onto the battlefield under your control. -- Cycling {3} ({3}, Discard this card: Draw a card.) mana={5}{B}{B}{B} @@ -84913,7 +84949,8 @@ toughness=2 [card] name=Screeching Silcaw abilities=flying -auto=@combatdamaged(player) from(this) restriction{type(artifact|myBattlefield)~morethan~2}:deplete:4 opponent +auto=@combatdamagefoeof(player) from(this) restriction{type(artifact|myBattlefield)~morethan~2}:deplete:4 opponent +auto=@combatdamageof(player) from(this) restriction{type(artifact|myBattlefield)~morethan~2}:deplete:4 controller text=Flying -- Metalcraft - Whenever Screeching Silcaw deals combat damage to a player, if you control three or more artifacts, that player puts the top four cards of his or her library into his or her graveyard. mana={1}{U} type=Creature @@ -85133,7 +85170,7 @@ toughness=2 name=Scythe of the Wretched auto=teach(creature) +2/+2 auto={4}:equip -auto=@vampired(creature) from(mytgt):all(trigger[to]) moveto(mybattlefield) and!(retarget)! +auto=@vampired(creature) from(mytgt):all(trigger[to]) moveto(mybattlefield) and!(rehook)! text=Equipped creature gets +2/+2. -- Whenever a creature dealt damage by equipped creature this turn is put into a graveyard, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature. -- Equip {4} mana={2} type=Artifact @@ -85413,7 +85450,7 @@ type=Sorcery [/card] [card] name=Searing Meditation -auto=@lifed(controller):pay({2}) target(creature,player) damage:2 +auto=@lifeof(player):pay({2}) target(creature,player) damage:2 text=Whenever you gain life, you may pay {2}. If you do, Searing Meditation deals 2 damage to target creature or player. mana={1}{R}{W} type=Enchantment @@ -85654,7 +85691,8 @@ toughness=2 [card] name=Sedraxis Specter abilities=flying -auto=@combatdamaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ controller autograveyard={1}{B}:moveto(mybattlefield) && transforms((,unearth,haste)) asSorcery forever text=Flying -- Whenever Sedraxis Specter deals combat damage to a player, that player discards a card. -- Unearth {1}{B} ({1}{B}: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.) mana={U}{B}{R} @@ -85760,7 +85798,7 @@ auto=@movedTo(*[-creature]|mystack):lifelink ueot text=Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.) -- Whenever you cast a noncreature spell, Seeker of the Way gains lifelink until end of turn. mana={1}{W} type=Creature -subtype=Human Monk +subtype=Human Warrior power=2 toughness=2 [/card] @@ -86571,7 +86609,7 @@ toughness=1 [/card] [card] name=Serra Avatar -auto=controllerlife/controllerlife cdaactive +auto=lifetotal/lifetotal cdaactive autograveyard=moveTo(ownerlibrary) && shuffle text=Serra Avatar's power and toughness are each equal to your life total. -- When Serra Avatar is put into a graveyard from anywhere, shuffle it into its owner's library. mana={4}{W}{W}{W} @@ -87734,8 +87772,9 @@ toughness=0 [card] name=Shimian Specter abilities=flying -auto=@combatdamaged(opponent) from(this) restriction{type(*[-land]|opponenthand)~morethan~0}:name(exile a nonland) notatarget(*[-land]|opponenthand) transforms((,newability[all(*[share!name!]|mylibrary) moveto(exile) and!(shuffle)!],newability[all(*[share!name!]|mygraveyard) moveto(exile)],newability[all(*[share!name!]|myhand) moveto(exile)])) -auto=@combatdamaged(opponent) from(this) restriction{type(*[-land]|opponenthand)~lessthan~1}:name(look) notatarget(*|opponenthand) donothing +auto=@combatdamagefoeof(player) from(this) restriction{type(*[-land]|opponenthand)~morethan~0}:name(exile a nonland) notatarget(*[-land]|opponenthand) transforms((,newability[all(*[share!name!]|mylibrary) moveto(exile) and!(shuffle)!],newability[all(*[share!name!]|mygraveyard) moveto(exile)],newability[all(*[share!name!]|myhand) moveto(exile)])) +auto=@combatdamageof(player) from(this) restriction{type(*[-land]|myhand)~morethan~0}:name(exile a nonland) notatarget(*[-land]|myhand) transforms((,newability[all(*[share!name!]|mylibrary) moveto(exile) and!(shuffle)!],newability[all(*[share!name!]|mygraveyard) moveto(exile)],newability[all(*[share!name!]|myhand) moveto(exile)])) +auto=@combatdamagefoeof(player) from(this) restriction{type(*[-land]|opponenthand)~lessthan~1}:name(look) notatarget(*|opponenthand) donothing text=Flying -- Whenever Shimian Specter deals combat damage to a player, that player reveals his or her hand. You choose a nonland card from it. Search that player's graveyard, hand, and library for all cards with the same name as that card and exile them. Then that player shuffles his or her library. mana={2}{B}{B} type=Creature @@ -87926,7 +87965,8 @@ toughness=2 [card] name=Shisato, Whispering Hunter auto=@each my upkeep:target(snake|mybattlefield) sacrifice -auto=@combatdamaged(opponent) from(this):nextphasealter(remove,untap,opponent) +auto=@combatdamagefoeof(player) from(this):nextphasealter(remove,untap,opponent) +auto=@combatdamageof(player) from(this):nextphasealter(remove,untap,controller) text=At the beginning of your upkeep, sacrifice a Snake. -- Whenever Shisato, Whispering Hunter deals combat damage to a player, that player skips his or her next untap step. mana={3}{G} type=Legendary Creature @@ -88108,8 +88148,8 @@ toughness=2 [/card] [card] name=Shocker -auto=@damaged(opponent) from(this):all(*|opponenthand) transforms((,newability[reject],newability[draw:1])) ueot -auto=@damaged(controller) from(this):all(*|myhand) transforms((,newability[reject],newability[draw:1])) ueot +auto=@damagefoeof(player) from(this):all(*|opponenthand) transforms((,newability[reject],newability[draw:1])) ueot +auto=@damageof(player) from(this):all(*|myhand) transforms((,newability[reject],newability[draw:1])) ueot text=Whenever Shocker deals damage to a player, that player discards all the cards in his or her hand, then draws that many cards. mana={1}{R} type=Creature @@ -88120,7 +88160,8 @@ toughness=1 [card] name=Shockmaw Dragon abilities=flying -auto=@combatdamaged(opponent) from(this):all(creature|opponentbattlefield) damage:1 +auto=@combatdamagefoeof(player) from(this):all(creature|opponentbattlefield) damage:1 +auto=@combatdamageof(player) from(this):all(creature|mybattlefield) damage:1 text=Flying -- Whenever Shockmaw Dragon deals combat damage to a player, it deals 1 damage to each creature that player controls. mana={4}{R}{R} type=Creature @@ -88286,7 +88327,8 @@ toughness=3 [card] name=Shriekgeist abilities=flying -auto=@combatdamaged(player) from(this):deplete:2 opponent +auto=@combatdamagefoeof(player) from(this):deplete:2 opponent +auto=@combatdamageof(player) from(this):deplete:2 controller text=Flying -- Whenever Shriekgeist deals combat damage to a player, that player puts the top two cards of his or her library into his or her graveyard. mana={1}{U} type=Creature @@ -88799,7 +88841,8 @@ subtype=Equipment [card] name=Sigil of Sleep target=creature -auto=@damaged(player) from(mytgt):moveto(ownerhand) target(creature|opponentbattlefield) +auto=@damagefoeof(player) from(mytgt):moveto(ownerhand) target(creature|opponentbattlefield) +auto=@damageof(player) from(mytgt):moveto(ownerhand) target(creature|mybattlefield) text=Enchant creature -- Whenever enchanted creature deals damage to a player, return target creature that player controls to its owner's hand. mana={U} type=Enchantment @@ -88938,7 +88981,8 @@ toughness=6 [card] name=Silent Specter abilities=flying -auto=@combatdamaged(player) from(this):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this):ability$!name(discard 2 cards) target(<2>*|myhand) reject!$ controller facedown={3} autofacedown={3}{B}{B}:morph text=Flying -- Whenever Silent Specter deals combat damage to a player, that player discards two cards. -- Morph {3}{B}{B} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) @@ -88951,7 +88995,8 @@ toughness=4 [card] name=Silent-Blade Oni autohand={4}{U}{B}{N}:ninjutsu -auto=@combatdamaged(player) from(this):may target(*[-land]|opponenthand) castcard(normal) +auto=@combatdamagefoeof(player) from(this):may target(*[-land]|opponenthand) castcard(normal) +auto=@combatdamageof(player) from(this):may target(*[-land]|myhand) castcard(normal) text=Ninjutsu {4}{U}{B} ({4}{U}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) -- Whenever Silent-Blade Oni deals combat damage to a player, look at that player's hand. You may cast a nonland card in it without paying that card's mana cost. mana={3}{U}{U}{B}{B} type=Creature @@ -89959,7 +90004,8 @@ toughness=2 name=Skirk Commando facedown={3} autofacedown={2}{R}:morph -auto=@combatdamaged(opponent) from(this):may damage:2 target(creature|opponentbattlefield) +auto=@combatdamagefoeof(player) from(this):may damage:2 target(creature|opponentbattlefield) +auto=@combatdamageof(player) from(this):may damage:2 target(creature|mybattlefield) text=Whenever Skirk Commando deals combat damage to a player, you may have it deal 2 damage to target creature that player controls. -- Morph {2}{R} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) mana={1}{R}{R} type=Creature @@ -90305,7 +90351,8 @@ toughness=3 [card] name=Skullsnatcher autohand={B}{N}:ninjutsu -auto=@combatdamaged(player) from(this):may target(*|opponentgraveyard) moveTo(exile) +auto=@combatdamagefoeof(player) from(this):may target(*|opponentgraveyard) moveTo(exile) +auto=@combatdamageof(player) from(this):may target(*|mygraveyard) moveTo(exile) text=Ninjutsu {B} ({B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) -- Whenever Skullsnatcher deals combat damage to a player, exile up to two target cards from that player's graveyard. mana={1}{B} type=Creature @@ -90847,7 +90894,7 @@ toughness=1 [/card] [card] name=Skywise Teachings -auto=@movedto(*[-creature]|mystack):pay[{1}{U}] name(Pay 1U mana) token(Djinn Monk,Creature Djinn Monk,2/2,flying,blue) controller +auto=@movedto(*[-creature]|mystack):pay({1}{U}) name(Pay 1U mana) token(Djinn Monk,Creature Djinn Monk,2/2,flying,blue) controller text=Whenever you cast a noncreature spell, you may pay {1}{U}. If you do, put a 2/2 blue Djinn Monk creature token with flying onto the battlefield. mana={3}{U} type=Enchantment @@ -90990,7 +91037,8 @@ type=Sorcery [/card] [card] name=Slavering Nulls -auto=@combatdamaged(opponent) from(this) restriction{type(swamp|mybattlefield)~morethan~0}:may name(opponent discard) ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamagefoeof(player) from(this) restriction{type(swamp|mybattlefield)~morethan~0}:may name(opponent discard) ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@combatdamageof(player) from(this) restriction{type(swamp|mybattlefield)~morethan~0}:may name(discard) ability$!name(discard) target(*|myhand) reject!$ controller text=Whenever Slavering Nulls deals combat damage to a player, if you control a Swamp, you may have that player discard a card. mana={1}{R} type=Creature @@ -91057,7 +91105,7 @@ subtype=Aura name=Sleeper's Robe target=creature auto=fear -auto=@combatdamaged(opponent) from(mytgt):may draw:1 controller +auto=@combatdamagefoeof(player) from(mytgt):may draw:1 controller text=Enchant creature -- Enchanted creature has fear. (It can't be blocked except by artifact creatures and/or black creatures.) -- Whenever enchanted creature deals combat damage to an opponent, you may draw a card. mana={U}{B} type=Enchantment @@ -91690,7 +91738,8 @@ toughness=2 name=Snapping Thragg facedown={3} autofacedown={4}{R}{R}:morph -auto=@combatdamaged(opponent) from(this):may damage:3 target(creature|opponentbattlefield) +auto=@combatdamagefoeof(player) from(this):may damage:3 target(creature|opponentbattlefield) +auto=@combatdamageof(player) from(this):may damage:3 target(creature|mybattlefield) text=Whenever Snapping Thragg deals combat damage to a player, you may have it deal 3 damage to target creature that player controls. -- Morph {4}{R}{R} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) mana={4}{R} type=Creature @@ -92195,7 +92244,8 @@ toughness=1 [card] name=Soltari Visionary abilities=shadow -auto=@damaged(player) from(this):destroy target(enchantment|opponentBattlefield) +auto=@damagefoeof(player) from(this):destroy target(enchantment|opponentBattlefield) +auto=@damageof(player) from(this):destroy target(enchantment|myBattlefield) text=Shadow (This creature can block or be blocked by only creatures with shadow.) -- Whenever Soltari Visionary deals damage to a player, destroy target enchantment that player controls. mana={1}{W}{W} type=Creature @@ -92268,8 +92318,8 @@ toughness=1 [card] name=Somnophore abilities=flying -auto=@damaged(opponent) from(this):name(tap target creature) target(creature|opponentbattlefield) transforms((,newability[tap],newability[doesnotuntap])) -auto=@damaged(controller) from(this):name(tap target creature) target(creature|mybattlefield) transforms((,newability[tap],newability[doesnotuntap])) +auto=@damagefoeof(player) from(this):name(tap target creature) target(creature|opponentbattlefield) transforms((,newability[tap],newability[doesnotuntap])) +auto=@damageof(player) from(this):name(tap target creature) target(creature|mybattlefield) transforms((,newability[tap],newability[doesnotuntap])) text=Flying -- Whenever Somnophore deals damage to a player, tap target creature that player controls. That creature doesn't untap during its controller's untap step for as long as Somnophore remains on the battlefield. mana={2}{U}{U} type=Creature @@ -93124,7 +93174,8 @@ toughness=1 [/card] [card] name=Spark Mage -auto=@combatdamaged(player) from(this):may damage:1 target(creature|opponentBattlefield) +auto=@combatdamagefoeof(player) from(this):may damage:1 target(creature|opponentBattlefield) +auto=@combatdamageof(player) from(this):may damage:1 target(creature|myBattlefield) text=Whenever Spark Mage deals combat damage to a player, you may have Spark Mage deal 1 damage to target creature that player controls. mana={R} type=Creature @@ -93195,7 +93246,7 @@ toughness=3 [card] name=Sparring Collar auto=first strike -auto={R}{R}:name(attach) retarget target(creature|mybattlefield) +auto={R}{R}:name(attach) rehook target(creature|mybattlefield) auto={1}:equip text=Equipped creature has first strike. -- {R}{R}: Attach Sparring Collar to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) mana={2} @@ -94422,8 +94473,8 @@ subtype=Aura name=Spiteful Visions auto=@each my draw:draw:1 controller auto=@each opponent draw:draw:1 opponent -auto=@drawn(controller):damage:1 controller -auto=@drawn(opponent):damage:1 opponent +auto=@drawof(player):damage:1 controller +auto=@drawfoeof(player):damage:1 opponent text=At the beginning of each player's draw step, that player draws an additional card. -- Whenever a player draws a card, Spiteful Visions deals 1 damage to that player. mana={2}{BR}{BR} type=Enchantment @@ -96250,7 +96301,7 @@ subtype=Aura [card] name=Stonehewer Giant abilities=vigilance -auto={1}{W}{T}:name(move and attach) target(equipment|mylibrary) transforms((,newability[retarget target(creature|mybattlefield)],newability[moveto(mybattlefield)])) +auto={1}{W}{T}:name(move and attach) target(equipment|mylibrary) moveto(mybattlefield) and!(transforms((,newability[rehook target(creature|mybattlefield)])))! text=Vigilance -- {1}{W}, {T}: Search your library for an Equipment card and put it onto the battlefield. Attach it to a creature you control. Then shuffle your library. mana={3}{W}{W} type=Creature @@ -96530,7 +96581,7 @@ toughness=3 name=Stormrider Rig auto={2}:equip auto=1/1 -auto=@movedto(creature|mybattlefield):may all(trigger[to]) retarget +auto=@movedto(creature|mybattlefield):may all(trigger[to]) rehook text=Equipped creature gets +1/+1. -- Whenever a creature enters the battlefield under your control, you may attach Stormrider Rig to it. -- Equip {2} mana={2} type=Artifact @@ -97520,7 +97571,7 @@ subtype=Aura [/card] [card] name=Sun Droplet -auto=@damaged(controller):counter(0/0,thatmuch,Charge) +auto=@damageof(player):counter(0/0,thatmuch,Charge) auto=@each my upkeep:may name(Gain Life) transforms((,[newability[counter(0/0,-1,Charge)],newability[life:1 controller])) text=Whenever you're dealt damage, put that many charge counters on Sun Droplet. -- At the beginning of each upkeep, you may remove a charge counter from Sun Droplet. If you do, you gain 1 life. mana={2} @@ -97591,7 +97642,7 @@ toughness=5 [card] name=Sunbond target=creature -auto=teach(creature) transforms((,newability[@lifed(controller):dynamicability])) +auto=teach(creature) transforms((,newability[@lifeof(player):dynamicability])) text=Enchant creature -- Enchanted creature has "Whenever you gain life, put that many +1/+1 counters on this creature." mana={3}{W} type=Enchantment @@ -98227,6 +98278,17 @@ power=2 toughness=3 [/card] [card] +name=Sustaining Spirit +auto=cumulativeupcost[{1}{W}] sacrifice +auto=this(controllerlife >= 1) transforms((,newability[reduceto:1])) +text=Cumulative upkeep {1}{W} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) -- Damage that would reduce your life total to less than 1 reduces it to 1 instead. +mana={1}{W} +type=Creature +subtype=Angel Spirit +power=0 +toughness=3 +[/card] +[card] name=Sustenance auto={1}{S(land|myBattlefield)}:1/1 target(creature) text={1}, Sacrifice a land: Target creature gets +1/+1 until end of turn. @@ -98340,7 +98402,7 @@ toughness=1 [/card] [card] name=Swarmborn Giant -auto=@combatdamaged(controller):sacrifice all(this) +auto=@combatdamageof(player):sacrifice all(this) auto=this(cantargetcard(*[-monstrous]) {4}{G}{G}:becomes(monstrous) forever && counter(1/1,2) && transforms((,newAbility[reach])) forever text=When you're dealt combat damage, sacrifice Swarmborn Giant. -- {3}{G}{G}: Monstrosity 2. (If this creature isn't monstrous, put two +1/+1 counters on it and it becomes monstrous.) -- As long as Swarmborn Giant is monstrous, it has reach. mana={2}{G}{G} @@ -98633,7 +98695,7 @@ subtype=Equipment name=Sword of the Meek auto={2}:equip auto=1/2 -autograveyard=@movedto(creature[power=1;toughness=1]|mybattlefield):may all(trigger[to]) retarget +autograveyard=@movedto(creature[power=1;toughness=1]|mybattlefield):may all(trigger[to]) rehook text=Equipped creature gets +1/+2. -- Equip {2} -- Whenever a 1/1 creature enters the battlefield under your control, you may return Sword of the Meek from your graveyard to the battlefield, then attach it to that creature. mana={2} type=Artifact @@ -98903,8 +98965,8 @@ type=Sorcery [/card] [card] name=Synapse Sliver -auto=@combatdamaged(player) from(sliver|myBattlefield):may draw:1 controller -auto=@combatdamaged(player) from(sliver|opponentBattlefield):draw:1 opponent +auto=@combatdamagefoeof(player) from(sliver):ability$!name(Draw) may draw:1!$ opponent +auto=@combatdamageof(player) from(sliver):ability$!name(Draw) may draw:1!$ controller text=Whenever a Sliver deals combat damage to a player, its controller may draw a card. mana={4}{U} type=Creature @@ -99011,6 +99073,7 @@ text=Syphon Soul deals 2 damage to each other player. You gain life equal to the mana={2}{B} type=Sorcery [/card] +#workaround szadek. [card] name=Szadek, Lord of Secrets abilities=flying @@ -99316,7 +99379,7 @@ toughness=3 [/card] [card] name=Talon of Pain -auto=@damaged(opponent) from(other *|mybattlefield,mystack):counter(0/0,1,charge) +auto=@damagefoeof(player) from(other *|mybattlefield,mystack,mygraveyard,mylibrary,myexile):counter(0/0,1,charge) auto={1}{C(0/0,-1,charge)}{T}:name(remove 1 counter) damage:1 target(creature,player) auto={2}{C(0/0,-2,charge)}{T}:name(Remove 2 Counters) damage:2 target(creature,player) auto={3}{C(0/0,-3,charge)}{T}:name(Remove 3 Counters) damage:3 target(creature,player) @@ -99454,10 +99517,7 @@ toughness=4 [/card] [card] name=Tamanoa -auto=@damaged(creature) from(*[-creature]|mybattlefield):may life:thatmuch controller -auto=@damaged(player) from(*[-creature]|mybattlefield):may life:thatmuch controller -auto=@damaged(creature) from(*[-creature]|mystack):may life:thatmuch controller -auto=@damaged(player) from(*[-creature]|mystack):may life:thatmuch controller +auto=@damaged(creature,player) from(*[-creature]|mybattlefield,mystack,mygraveyard,mylibrary,myexile):life:thatmuch controller text=Whenever a noncreature source you control deals damage, you gain that much life. mana={R}{G}{W} type=Creature @@ -99478,7 +99538,7 @@ subtype=Tamiyo [/card] [card] name=Tandem Lookout -auto=soulbond @damaged(opponent) from(this):draw:1 controller +auto=soulbond @damagefoeof(player) from(this):draw:1 controller abilities=soulbond text=Soulbond (You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.) -- As long as Tandem Lookout is paired with another creature, each of those creatures has "Whenever this creature deals damage to an opponent, draw a card." mana={2}{U} @@ -100858,7 +100918,7 @@ toughness=3 name=Teysa, Envoy of Ghosts abilities=Vigilance auto=protection from(creature) -auto=@damaged(controller) from(creature):all(trigger[from]) destroy && token(Spirit,Creature Spirit,1/1,white,black, flying) +auto=@damageof(player) from(creature):all(trigger[from]) destroy && token(Spirit,Creature Spirit,1/1,white,black, flying) text=Vigilance. -- Protection from creatures. -- Whenever a creature deals damage to you, destroy that creature. Put a 1/1 white and black spirit token with flying onto the battlefield. mana={5}{W}{B} type=Legendary Creature @@ -101117,7 +101177,7 @@ subtype=Aura [/card] [card] name=The Fallen -auto=@damaged(opponent) from(this) once:transforms((,newability[@each my upkeep:damage:1 opponent])) forever +auto=@damagefoeof(player) from(this) once:transforms((,newability[@each my upkeep:damage:1 opponent])) forever text=At the beginning of your upkeep, The Fallen deals 1 damage to each opponent it has dealt damage to this game. mana={1}{B}{B}{B} type=Creature @@ -101320,7 +101380,7 @@ toughness=2 [card] name=Thieving Magpie abilities=flying -auto=@damaged(opponent) from(this):draw:1 controller +auto=@damagefoeof(player) from(this):draw:1 controller text=Flying (This creature can't be blocked except by creatures with flying or reach.) -- Whenever Thieving Magpie deals damage to an opponent, you draw a card. mana={2}{U}{U} type=Creature @@ -101392,8 +101452,7 @@ toughness=3 [card] name=Thopter Assembly abilities=flying -auto=@each my upkeep restriction{type(other thopter|myBattlefield)~lessthan~1}:token(Thopter,Artifact Creature,1/1,flying)*5 -auto=@each my upkeep restriction{type(other thopter|myBattlefield)~lessthan~1}:moveTo(ownerhand) +auto=@each my upkeep restriction{type(other thopter|myBattlefield)~lessthan~1}:moveTo(ownerhand) and!(token(Thopter,Artifact Creature,1/1,flying)*5)! text=Flying -- At the beginning of your upkeep, if you control no Thopters other than Thopter Assembly, return Thopter Assembly to its owner's hand and put five 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield. mana={6} type=Artifact Creature @@ -101464,7 +101523,7 @@ toughness=2 name=Thornbite Staff auto=teach(creature) transforms((,newability[{2}{T}:damage:1 target(creature,player)])) auto=@movedto(creature|graveyard) from(creature|battlefield):teach(creature) untap -auto=@movedto(creature[shaman]|battlefield):may all(trigger[to]) retarget +auto=@movedto(creature[shaman]|battlefield):may all(trigger[to]) rehook auto={4}:equip text=Equipped creature has "{2}, {T}: This creature deals 1 damage to target creature or player" and "Whenever a creature dies, untap this creature." -- Whenever a Shaman creature enters the battlefield, you may attach Thornbite Staff to it. -- Equip {4} mana={2} @@ -102034,7 +102093,8 @@ type=Sorcery [card] name=Throat Slitter autohand={2}{B}{N}:ninjutsu -auto=@combatdamaged(player) from(this):destroy target(creature[-black]|opponentbattlefield) +auto=@combatdamagefoeof(player) from(this):destroy target(creature[-black]|opponentbattlefield) +auto=@combatdamageof(player) from(this):destroy target(creature[-black]|mybattlefield) text=Ninjutsu {2}{B} ({2}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) -- Whenever Throat Slitter deals combat damage to a player, destroy target nonblack creature that player controls. mana={4}{B} type=Creature @@ -102228,9 +102288,7 @@ type=Instant [card] name=Thunderbreak Regent abilities=flying -auto=@targeted(dragon|mybattlefield) from(*|opponentbattlefield):damage:3 opponent -auto=@targeted(dragon|mybattlefield) from(*|opponenthand):damage:3 opponent -auto=@targeted(dragon|mybattlefield) from(*|graveyard):damage:3 opponent +auto=@targeted(dragon|mybattlefield) from(*|opponentbattlefield,opponenthand,opponentstack,opponentgraveyard,opponentexile,opponentlibrary):damage:3 opponent text=Flying -- Whenever a Dragon you control becomes the target of a spell or ability an opponent controls, Thunderbreak Regent deals 3 damage to that player. mana={2}{R}{R} type=Creature @@ -102837,7 +102895,7 @@ type=Sorcery [/card] [card] name=Timely Hordemate -auto=if thisturn(creature[attacking]|mybattlefield)~morethan~0 then moveTo(mybattlefield) target(creature[manacost<=2]|mygraveyard) +auto=if raid then moveTo(mybattlefield) target(creature[manacost<=2]|mygraveyard) text=Raid - When Timely Hordemate enters the battlefield, if you attacked with a creature this turn, return target creature card with converted mana cost 2 or less from your graveyard to the battlefield. mana={3}{W} type=Creature @@ -103394,11 +103452,11 @@ power=6 toughness=4 [/card] ###The 2 cards above should stay together (Flip Card)### +#need parser from stack [card] name=Tormented Hero auto=tap -auto=@targeted(this) from(*[instant;sorcery;enchantment]|myhand,mygraveyard):life:-1 opponent -auto=@targeted(this) from(*[instant;sorcery;enchantment]|myhand,mygraveyard):life:1 controller +auto=@targeted(this) from(*|nonbattlezone):life:-1 opponent && life:1 controller text=Tormented Hero enters the battlefield tapped. -- Heroic - Whenever you cast a spell that targets Tormented Hero, each opponent loses 1 life. You gain life equal to the life lost this way. mana={B} type=Creature @@ -103853,11 +103911,12 @@ subtype=Spellshaper power=1 toughness=1 [/card] +#produceextra:selectmana when used acts as an observer so the ability must be on the source since its a mayability of mana not a menuability [card] name=Trace of Abundance target=land auto=shroud -auto=teach(land) transforms((,newability[@tappedformana(this):chooseacolor add{chosencolor} chooseend])) +auto=all(this) transforms((,newability[produceextra:selectmana])) forever text=Enchant land -- Enchanted land has shroud. (It can't be the target of spells or abilities.) -- Whenever enchanted land is tapped for mana, its controller adds one mana of any color to his or her mana pool (in addition to the mana the land produces). mana={RW}{G} type=Enchantment @@ -104149,10 +104208,9 @@ type=Land [card] name=Transcendence abilities=cantlifelose -auto=this(controllerlife > 19) winGame opponent -auto=@lifed(controller):this(controllerlife > 19) winGame opponent -auto=@damaged(controller):life:twicethatmuch controller -auto=@lifeloss(controller):life:twicethatmuch controller +auto=this(controllerlife > 19)while winGame opponent +auto=@damageof(player):life:twicethatmuch controller +auto=@lifelostof(player):life:twicethatmuch controller text=You don't lose the game for having 0 or less life. -- When you have 20 or more life, you lose the game. -- Whenever you lose life, you gain 2 life for each 1 life you lost. (Damage dealt to you causes you to lose life.) mana={3}{W}{W}{W} type=Enchantment @@ -105194,7 +105252,8 @@ subtype=Equipment [card] name=Trygon Predator abilities=flying -auto=@combatdamaged(player) from(this):may destroy target(artifact,enchantment|opponentBattlefield) +auto=@combatdamagefoeof(player) from(this):may destroy target(artifact,enchantment|opponentBattlefield) +auto=@combatdamageof(player) from(this):may destroy target(artifact,enchantment|myBattlefield) text=Flying -- Whenever Trygon Predator deals combat damage to a player, you may destroy target artifact or enchantment that player controls. mana={1}{G}{U} type=Creature @@ -106177,7 +106236,7 @@ subtype=Aura [/card] [card] name=Underworld Dreams -auto=@drawn(opponent):damage:1 opponent +auto=@drawfoeof(player):damage:1 opponent text=Whenever an opponent draws a card, Underworld Dreams deals 1 damage to him or her. mana={B}{B}{B} type=Enchantment @@ -106979,21 +107038,27 @@ type=Artifact [/card] [card] name=Urza's Mine -auto={t}:name(Add Mana) if type(Urza's Tower|mybattlefield)~morethan~0,type(Urza's Power Plant|mybattlefield)~morethan~0 then add{2} else add{1} +alias=4192 +auto=this(variable{urzatron} >0) produceextra:{1} +auto={T}:add{1} text={T}: Add {1} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {2} to your mana pool instead. type=Land subtype=Urza's Mine [/card] [card] name=Urza's Power Plant -auto={t}:name(Add Mana) if type(Urza's Tower|mybattlefield)~morethan~0,type(Urza's Mine|mybattlefield)~morethan~0 then add{2} else add{1} +alias=4193 +auto=this(variable{urzatron} >0) produceextra:{1} +auto={T}:add{1} text={T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Tower, add {2} to your mana pool instead. type=Land subtype=Urza's Power-Plant [/card] [card] name=Urza's Tower -auto={t}:name(Add Mana) if type(Urza's Power Plant|mybattlefield)~morethan~0,type(Urza's Mine|mybattlefield)~morethan~0 then add{3} else add{1} +alias=4194 +auto=this(variable{urzatron} >0) produceextra:{2} +auto={T}:add{1} text={T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead. type=Land subtype=Urza's Tower @@ -107027,7 +107092,11 @@ toughness=2 [card] name=Utopia Sprawl target=forest -auto=chooseacolor transforms((,newability[@tappedformana(mytgt):add{chosencolor}])) forever chooseend +auto=choice name(green) transforms((,newability[produceextra:{g}])) forever +auto=choice name(blue) transforms((,newability[produceextra:{u}])) forever +auto=choice name(red) transforms((,newability[produceextra:{r}])) forever +auto=choice name(black) transforms((,newability[produceextra:{b}])) forever +auto=choice name(white) transforms((,newability[produceextra:{w}])) forever text=Enchant Forest -- As Utopia Sprawl enters the battlefield, choose a color. -- Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool (in addition to the mana the land produces). mana={G} type=Enchantment @@ -107764,7 +107833,7 @@ toughness=1 [/card] [card] name=Vedalken Heretic -auto=@damaged(opponent) from(this):may draw:1 controller +auto=@damagefoeof(player) from(this):may draw:1 controller text=Whenever Vedalken Heretic deals damage to an opponent, you may draw a card. mana={G}{U} type=Creature @@ -108018,8 +108087,7 @@ toughness=2 [card] name=Vengeful Pharaoh abilities=deathtouch -autograveyard=@combatdamaged(controller):moveTo(ownerlibrary) -autograveyard=@combatdamaged(controller):destroy target(creature[attacking]) +autograveyard=@combatdamaged(player,planeswalker) from(*|opponentbattlefield):and!(destroy target(creature[attacking]))! moveTo(ownerlibrary) text=Deathtouch -- Whenever combat damage is dealt to your or a planeswalker you control, if Vengeful Pharaoh is in your graveyard, destroy target attacking creature, then put Vengeful Pharaoh on top of your library. mana={2}{B}{B}{B} type=Creature @@ -108211,11 +108279,12 @@ subtype=Elemental power=7 toughness=7 [/card] +#produceextra:selectmana when used acts as an observer so the ability must be on the source since its a mayability of mana not a menuability [card] name=Verdant Haven target=land auto=life:2 controller -auto=teach(land) transforms((,newability[@tappedformana(this):chooseacolor add{chosencolor} chooseend])) +auto=all(this) transforms((,newability[produceextra:selectmana])) forever text=Enchant land -- When Verdant Haven enters the battlefield, you gain 2 life. -- Whenever enchanted land is tapped for mana, its controller adds one mana of any color to his or her mana pool (in addition to the mana the land produces). mana={2}{G} type=Enchantment @@ -108290,8 +108359,7 @@ toughness=1 [/card] [card] name=Vernal Bloom -auto=@tappedformana(forest|mybattlefield):Add{G} controller -auto=@tappedformana(forest|opponentbattlefield):Add{G} opponent +auto=lord(forest|battlefield) transforms((,newability[produceextra:{G}])) text=Whenever a Forest is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces). mana={3}{G} type=Enchantment @@ -108363,7 +108431,7 @@ type=Land name=Veteran's Armaments auto={2}:equip auto=@combat(attacking,blocking) source(mytgt) :all(trigger[to]) foreach(creature[attacking]|battlefield) 1/1 ueot -auto=@movedto(creature[soldier]|battlefield):may all(trigger[to]) retarget +auto=@movedto(creature[soldier]|battlefield):may all(trigger[to]) rehook text=Equipped creature has "Whenever this creature attacks or blocks, it gets +1/+1 until end of turn for each attacking creature." -- Whenever a Soldier creature enters the battlefield, you may attach Veteran's Armaments to it. -- Equip {2} mana={2} type=Tribal Artifact @@ -109609,7 +109677,7 @@ type=Sorcery [card] name=Vizkopa Guildmage auto={1}{W}{B}:target(creature) lifelink ueot -auto={1}{W}{B}:name(lifeleech) emblem transforms((,newability[@lifed(controller):life:-thatmuch opponent])) ueot +auto={1}{W}{B}:name(lifeleech) emblem transforms((,newability[@lifeof(player):life:-thatmuch opponent])) ueot text={1}{W}{B}: Target creature gains lifelink until end of turn. -- {1}{W}{B}: Whenever you gain life this turn, each opponent loses that much life. mana={W}{B} type=Creature @@ -110308,7 +110376,8 @@ subtype=Vraska [/card] [card] name=Assassin Token -auto=@combatdamaged(player) from(this):winGame controller +auto=@combatdamagefoeof(player) from(this):winGame controller +auto=@combatdamageof(player) from(this):winGame opponent type=Creature subtype=Assassin power=1 @@ -110360,7 +110429,7 @@ subtype=Equipment [card] name=Vulshok Battlemaster abilities=haste -auto=all(equipment|battlefield) newtarget +auto=all(equipment|battlefield) newhook text=Haste -- When Vulshok Battlemaster enters the battlefield, attach all Equipment on the battlefield to it. (Control of the Equipment doesn't change.) mana={4}{R} type=Creature @@ -110567,7 +110636,7 @@ type=Sorcery [card] name=Walker of Secret Ways autohand={1}{U}{N}:ninjutsu -auto=@combatdamaged(player) from(this):name(look at opponents hand) target(*|opponenthand) donothing ueot +auto=@combatdamagefoeof(player) from(this):name(look at opponents hand) target(*|opponenthand) donothing ueot auto={1}{U}:moveTo(myhand) target(ninja|myBattlefield) myTurnOnly text=Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) -- Whenever Walker of Secret Ways deals combat damage to a player, look at that player's hand. -- {1}{U}: Return target Ninja you control to its owner's hand. Activate this ability only during your turn. mana={2}{U} @@ -110911,7 +110980,7 @@ toughness=5 [card] name=Wall of Limbs abilities=defender -auto=@lifed(controller):counter(1/1,1) +auto=@lifeof(player):counter(1/1,1) auto={5}{B}{B}{S}:name(Lose Life) target(player) life:-storedpower text=Defender (This creature can't attack.) -- Whenever you gain life, put a +1/+1 counter on Wall of Limbs. -- {5}{B}{B}, Sacrifice Wall of Limbs: Target player loses X life, where X is Wall of Limbs's power. mana={2}{B} @@ -111368,7 +111437,7 @@ type=Artifact [card] name=War Elemental auto=this(opponentdamagecount < 1) aslongas(War Elemental|mybattlefield) sacrifice oneshot -auto=@damaged(opponent):may all(trigger[to]) dynamicability +auto=@damagefoeof(player):may all(trigger[to]) dynamicability text=When War Elemental enters the battlefield, sacrifice it unless an opponent was dealt damage this turn. -- Whenever an opponent is dealt damage, put that many +1/+1 counters on War Elemental. mana={R}{R}{R} type=Creature @@ -111443,7 +111512,7 @@ type=Instant [/card] [card] name=War-Name Aspirant -auto=if thisturn(creature[attacking]|mybattlefield)~morethan~0 then counter(1/1,1) +auto=if raid then counter(1/1,1) auto=cantbeblockedby(creature[power<=1]) text=Raid - War-Name Aspirant enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn. -- War-Name Aspirant can't be blocked by creatures with power 1 or less. mana={1}{R} @@ -111682,7 +111751,7 @@ type=Instant [card] name=Warren Instigator abilities=double strike -auto=@damaged(player) from(this):may moveto(myBattlefield) target(creature[goblin]|myHand) +auto=@damagefoeof(player) from(this):may moveto(myBattlefield) target(creature[goblin]|myHand) text=Double strike -- Whenever Warren Instigator deals damage to an opponent, you may put a Goblin creature card from your hand onto the battlefield. mana={R}{R} type=Creature @@ -111728,7 +111797,7 @@ type=Instant [card] name=Warrior's Lesson target=creature|mybattlefield -auto=transforms((,newability[@combatdamaged(opponent) from(this):draw:1 controller])) ueot +auto=transforms((,newability[@combatdamaged(player) from(this):draw:1 controller])) ueot text=Until end of turn, up to two target creatures you control each gain "Whenever this creature deals combat damage to a player, draw a card." mana={G} type=Instant @@ -112245,7 +112314,7 @@ toughness=1 [card] name=Wei Night Raiders abilities=horsemanship -auto=@damaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@damagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent text=Horsemanship (This creature can't be blocked except by creatures with horsemanship.) -- Whenever Wei Night Raiders deals damage to an opponent, that player discards a card. mana={2}{B}{B} type=Creature @@ -112639,7 +112708,7 @@ type=Artifact [card] name=Whirling Dervish abilities=protection from black -auto=@damaged(opponent) from(this):all(trigger[from]) phaseaction[endofturn once] counter(1/1,1) +auto=@damagefoeof(player) from(this):all(trigger[from]) phaseaction[endofturn once] counter(1/1,1) text=Protection from black -- At the beginning of each end step, if Whirling Dervish dealt damage to an opponent this turn, put a +1/+1 counter on it. mana={G}{G} type=Creature @@ -113015,7 +113084,7 @@ toughness=2 [card] name=Wild Growth target=land -auto=@tappedformana(mytgt):add{g} targetcontroller +auto=teach(land) transforms((,newability[produceextra:{G}])) text=Enchant land -- Whenever enchanted land is tapped for mana, its controller adds {G} to his or her mana pool (in addition to the mana the land produces). mana={G} type=Enchantment @@ -113611,7 +113680,7 @@ toughness=1 [card] name=Wingmate Roc abilities=flying -auto=if thisturn(creature[attacking]|mybattlefield)~morethan~0 then token(Bird,Creature Bird,3/4,white,flying) +auto=if raid then token(Bird,Creature Bird,3/4,white,flying) auto=@combat(attacking) source(this):life:type:creature[attacking]:battlefield controller text=Flying. -- Raid - When Wingmate Roc enters the battlefield, if you attacked with a creature this turn, put a 3/4 white Bird creature token with flying onto the battlefield. -- Whenever Wingmate Roc attacks, you gain 1 life for each attacking creature. mana={3}{W}{W} @@ -113975,7 +114044,7 @@ type=Instant [card] name=Witherscale Wurm auto=@combat(blocking,blocked) source(this) from(creature):all(trigger[from]) wither ueot -auto=@damaged(player) from(this):thisforeach(counter{-1/-1.1}) counter(-1/-1,-1) +auto=@damagefoeof(player) from(this):thisforeach(counter{-1/-1.1}) counter(-1/-1,-1) text=Whenever Witherscale Wurm blocks or becomes blocked by a creature, that creature gains wither until end of turn. (It deals damage to creatures in the form of -1/-1 counters.) -- Whenever Witherscale Wurm deals damage to an opponent, remove all -1/-1 counters from it. mana={4}{G}{G} type=Creature @@ -114653,6 +114722,13 @@ mana={3} type=Artifact [/card] [card] +name=Worship +auto=this(variable{worshipped} >= 1) transforms((,newability[reduceto:1])) +text=If you control a creature, damage that would reduce your life total to less than 1 reduces it to 1 instead. +mana={3}{W} +type=Enchantment +[/card] +[card] name=Worthy Cause auto=life:storedtoughness controller buyback={W}{2} @@ -114796,7 +114872,8 @@ type=Sorcery [card] name=Wrexial, the Risen Deep abilities=islandwalk,swampwalk -auto=@combatdamaged(player) from(this):may target(*[instant;sorcery]|opponentgraveyard) castcard(normal) and!(transforms((,newability[exiledeath])) forever)! +auto=@combatdamagefoeof(player) from(this):may target(*[instant;sorcery]|opponentgraveyard) castcard(normal) and!(transforms((,newability[exiledeath])) forever)! +auto=@combatdamageof(player) from(this):may target(*[instant;sorcery]|mygraveyard) castcard(normal) and!(transforms((,newability[exiledeath])) forever)! text=Islandwalk, swampwalk -- Whenever Wrexial, the Risen Deep deals combat damage to a player, you may cast target instant or sorcery card from that player's graveyard without paying its mana cost. If that card would be put into a graveyard this turn, exile it instead. mana={3}{U}{U}{B} type=Legendary Creature @@ -115782,7 +115859,7 @@ toughness=2 [/card] [card] name=Zhang Liao, Hero of Hefei -auto=@damaged(opponent) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent +auto=@damagefoeof(player) from(this):ability$!name(discard) target(*|myhand) reject!$ opponent text=Whenever Zhang Liao, Hero of Hefei deals damage to an opponent, that opponent discards a card. mana={4}{B}{B} type=Legendary Creature @@ -116032,7 +116109,8 @@ toughness=3 [/card] [card] name=Zombie Cannibal -auto=@combatdamaged(player) from(this):may moveto(exile) target(*|opponentgraveyard) +auto=@combatdamagefoeof(player) from(this):may moveto(exile) target(*|opponentgraveyard) +auto=@combatdamageof(player) from(this):may moveto(exile) target(*|mygraveyard) text=Whenever Zombie Cannibal deals combat damage to a player, you may exile target card from that player's graveyard. mana={B} type=Creature diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index f1608d66b..4be2a582b 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -187,6 +187,13 @@ power=1 toughness=1 [/card] [card] +name=Aladdin's Lamp +alias=1092 +text={X}, {T}: The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0. +mana={10} +type=Artifact +[/card] +[card] name=Alive // Well text=Put a 3/3 green Centaur creature token onto the battlefield. -- // -- You gain 2 life for each creature you control. -- -- Fuse (You may cast one or both halves of this card from your hand.) mana={3}{G} // {W} @@ -470,15 +477,6 @@ type=Enchantment subtype=Aura [/card] [card] -name=Arrogant Wurm -text=Trample -- Madness {2}{G} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={3}{G}{G} -type=Creature -subtype=Wurm -power=4 -toughness=4 -[/card] -[card] name=Arrow Volley Trap text=If four or more creatures are attacking, you may pay {1}{W} rather than pay Arrow Volley Trap's mana cost. -- Arrow Volley Trap deals 5 damage divided as you choose among any number of target attacking creatures. mana={3}{W}{W} @@ -993,15 +991,6 @@ toughness=4 text=Flying -- Players can't cast spells during combat. {R}: Target creature attacks this turn if able. [/card] [card] -name=Basking Rootwalla -text={1}{G}: Basking Rootwalla gets +2/+2 until end of turn. Activate this ability only once each turn. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={G} -type=Creature -subtype=Lizard -power=1 -toughness=1 -[/card] -[card] name=Baton of Morale text={2}: Target creature gains banding until end of turn. (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding a player controls are blocking or being blocked by a creature, that player divides that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.) mana={2} @@ -1162,15 +1151,6 @@ mana={5}{B} type=Instant [/card] [card] -name=Big Game Hunter -text=When Big Game Hunter enters the battlefield, destroy target creature with power 4 or greater. It can't be regenerated. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={1}{B}{B} -type=Creature -subtype=Human Rebel Assassin -power=1 -toughness=1 -[/card] -[card] name=Bind text=Counter target activated ability. (Mana abilities can't be targeted.) -- Draw a card. mana={1}{G} @@ -1875,12 +1855,6 @@ mana={1}{W} type=Enchantment [/card] [card] -name=Call to the Netherworld -text=Return target black creature card from your graveyard to your hand. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={B} -type=Sorcery -[/card] -[card] name=Callous Deceiver text={1}: Look at the top card of your library. -- {2}: Reveal the top card of your library. If it's a land card, Callous Deceiver gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn. mana={2}{U} @@ -3422,12 +3396,6 @@ mana={2}{B} type=Enchantment [/card] [card] -name=Dark Withering -text=Destroy target nonblack creature. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={4}{B}{B} -type=Instant -[/card] -[card] name=Darkpact text=Remove Darkpact from your deck before playing if you're not playing for ante. -- You own target card in the ante. Exchange that card with the top card of your library. mana={B}{B}{B} @@ -5116,12 +5084,6 @@ mana={R}{G}{W} type=Sorcery [/card] [card] -name=Fiery Temper -text=Fiery Temper deals 3 damage to target creature or player. -- Madness {R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={1}{R}{R} -type=Instant -[/card] -[card] name=Fight or Flight text=At the beginning of each opponent's combat phase, separate all creatures that player controls into two piles. Only creatures in the pile of his or her choice can attack this turn. mana={3}{W} @@ -5555,12 +5517,6 @@ toughness=3 text=At the beginning of your upkeep, you may ask target player a yes-or-no question. If you do, that player answers the question truthfully and abides by that answer if able until end of turn. [/card] [card] -name=Frantic Purification -text=Destroy target enchantment. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={2}{W} -type=Instant -[/card] -[card] name=Frazzled Editor mana={1}{R} type=Creature — Human Bureaucrat @@ -5928,8 +5884,14 @@ subtype=Turtle power=2 toughness=4 [/card] +#bug phasealter not turning off [card] name=Gibbering Descent +abilities=madness +autoexile=restriction{discarded} pay({2}{B}{B}) name(pay 2BB to cast) activate name(pay 2BB to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard) +auto=@each my upkeep:life:-1 controller && reject target(*|myhand) +auto=@each opponentupkeep:life:-1 opponent && ability$!name(discard) target(*|myhand) reject!$ opponent +auto=this(variable{phandcount} <1) phasealter(remove,upkeep,controller) text=At the beginning of each player's upkeep, that player loses 1 life and discards a card. -- Hellbent - Skip your upkeep step if you have no cards in hand. -- Madness {2}{B}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) mana={4}{B}{B} type=Enchantment @@ -6429,15 +6391,6 @@ power=0 toughness=3 [/card] [card] -name=Gorgon Recluse -text=Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. -- Madness {B}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={3}{B}{B} -type=Creature -subtype=Gorgon -power=2 -toughness=4 -[/card] -[card] name=Gorilla Berserkers text=Trample; rampage 2 (Whenever this creature becomes blocked, it gets +2/+2 until end of turn for each creature blocking it beyond the first.) -- Gorilla Berserkers can't be blocked except by three or more creatures. mana={3}{G}{G} @@ -7441,12 +7394,6 @@ power=1 toughness=1 [/card] [card] -name=Ichor Slick -text=Target creature gets -3/-3 until end of turn. -- Cycling {2} ({2}, Discard this card: Draw a card.) -- Madness {3}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={2}{B} -type=Sorcery -[/card] -[card] name=Icy Prison text=When Icy Prison enters the battlefield, exile target creature. -- At the beginning of your upkeep, sacrifice Icy Prison unless any player pays {3}. -- When Icy Prison leaves the battlefield, return the exiled creature to the battlefield under its owner's control. mana={U}{U} @@ -11068,12 +11015,6 @@ type=Legendary Artifact subtype=Equipment [/card] [card] -name=Obsessive Search -text=Draw a card. -- Madness {U} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={U} -type=Instant -[/card] -[card] name=Obstinate Baloth auto=life:4 text=When Obstinate Baloth enters the battlefield, you gain 4 life. -- If a spell or ability an opponent controls causes you to discard Hardheaded Baloth, put it onto the battlefield instead of putting it into your graveyard. @@ -12425,12 +12366,6 @@ mana={1}{B}{B} type=Sorcery [/card] [card] -name=Psychotic Haze -text=Psychotic Haze deals 1 damage to each creature and each player. -- Madness {1}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={2}{B}{B} -type=Instant -[/card] -[card] name=Puca's Mischief text=At the beginning of your upkeep, you may exchange control of target nonland permanent you control and target nonland permanent an opponent controls with an equal or lesser converted mana cost. mana={3}{U} @@ -12474,18 +12409,6 @@ type=Enchantment subtype=Aura [/card] [card] -#to be tested.... -name=Puresteel Paladin -auto=@movedTo(equipment|mybattlefield):may draw:1 controller -auto=lord(equipment|mybattlefield) transforms((,newability[{0}:name(equip 0) retarget target(creature|mybattlefield) assorcery restriction{type(artifact|mybattlefield)~morethan~2}])) -text=Whenever an Equipment enters the battlefield under your control, you may draw a card. -- Metalcraft - As long as you control 3 or more artifacts, each Equipment you control has equip {0}. -mana={W}{W} -type=Creature -subtype=Human Knight -power=2 -toughness=2 -[/card] -[card] name=Pure // Simple (Pure) text=Destroy target multicolored permanent. mana={1}{R}{G} @@ -12983,15 +12906,6 @@ mana={W} type=Instant [/card] [card] -name=Reckless Wurm -text=Trample -- Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={3}{R}{R} -type=Creature -subtype=Wurm -power=4 -toughness=4 -[/card] -[card] name=Reclamation auto=lord(creature[black]) cantattack auto=lord(creature[black]) {S(land|myinplay)}:-cantattack @@ -16054,20 +15968,6 @@ mana={X}{R} type=Instant [/card] [card] -name=Strength of Isolation -text=Enchant creature -- Enchanted creature gets +1/+2 and has protection from black. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={1}{W} -type=Enchantment -subtype=Aura -[/card] -[card] -name=Strength of Lunacy -text=Enchant creature -- Enchanted creature gets +2/+1 and has protection from white. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.) -mana={1}{B} -type=Enchantment -subtype=Aura -[/card] -[card] name=Strength of the Tajuru text=Multikicker {1} (You may pay an additional {1} any number of times as you cast this spell.) -- Choose target creature, then choose another target creature for each time Strength of the Tajuru was kicked. Put X +1/+1 counters on each of them. mana={X}{G}{G} @@ -16296,15 +16196,6 @@ 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=Sustaining Spirit -text=Cumulative upkeep {1}{W} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) -- Damage that would reduce your life total to less than 1 reduces it to 1 instead. -mana={1}{W} -type=Creature -subtype=Angel Spirit -power=0 -toughness=3 -[/card] -[card] name=Sutured Ghoul text=Trample -- As Sutured Ghoul enters the battlefield, exile any number of creature cards from your graveyard. -- Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness. mana={4}{B}{B}{B} @@ -18813,12 +18704,6 @@ mana={2}{B}{B}{B} type=Enchantment [/card] [card] -name=Worship -text=If you control a creature, damage that would reduce your life total to less than 1 reduces it to 1 instead. -mana={3}{W} -type=Enchantment -[/card] -[card] name=Wort, the Raidmother text=When Wort, the Raidmother enters the battlefield, put two 1/1 red and green Goblin Warrior creature tokens onto the battlefield. -- Each red or green instant or sorcery spell you cast has conspire. (As you cast the spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose new targets for the copy.) mana={4}{RG}{RG} diff --git a/projects/mtg/bin/Res/test/ExchangeController.txt b/projects/mtg/bin/Res/test/ExchangeController.txt new file mode 100644 index 000000000..887ddb4b5 --- /dev/null +++ b/projects/mtg/bin/Res/test/ExchangeController.txt @@ -0,0 +1,28 @@ +#Hypnotic Specter vs Control Magic +#The opponent of the current controller of Hypnotic Specter +#Must discard at random when combat damage is dealt... +[INIT] +FIRSTMAIN +[PLAYER1] +hand:Control Magic +inplay:Concordant Crossroads +manapool:{B}{B}{U}{U} +[PLAYER2] +inplay:Hypnotic Specter +hand:Forest +[DO] +Control Magic +Hypnotic Specter +next +next +Hypnotic Specter +next +eot +[ASSERT] +UNTAP +[PLAYER1] +inplay:Control Magic, Hypnotic Specter, Concordant Crossroads +[PLAYER2] +graveyard:Forest +life:18 +[END] diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index c55f155e7..5ef04fa98 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -311,6 +311,7 @@ evil_presence3.txt evil_presence_i647.txt evil_presence_i647_2.txt exaltedsourcekilled.txt +ExchangeController.txt executioners_swing.txt executioners_swing2.txt executioners_swing3.txt diff --git a/projects/mtg/bin/Res/test/curiosity2_i217.txt b/projects/mtg/bin/Res/test/curiosity2_i217.txt index efc1f4a99..8f36e109a 100644 --- a/projects/mtg/bin/Res/test/curiosity2_i217.txt +++ b/projects/mtg/bin/Res/test/curiosity2_i217.txt @@ -2,6 +2,15 @@ #DESC: Tests whether Curiosity works correctly #DESC: when cast on an opponent's creature #DESC: http://code.google.com/p/wagic/issues/detail?id=217 +# +#revised...10-22-2015...kevlahnota +#2/1/2007 You draw one card each time the enchanted creature damages the opponent. This is not one card per point of damage. +#2/1/2007 If put on your opponent's creature, you do not draw a card when that creature damages you. The creature has to damage your opponent in order to have this work. +#2/1/2007 Drawing a card is optional. If you forget, you can't go back later and do it, even if it is something you normally do. +#9/22/2011 "You" refers to the controller of Curiosity, which may be different from the controller of the enchanted creature."An opponent" refers to an opponent of Curiosity's controller. +#9/22/2011 Any damage dealt by the enchanted creature to an opponent will cause Curiosity to trigger, not just combat damage. +#9/22/2011 Curiosity doesn't trigger if the enchanted creature deals damage to a planeswalker controlled by an opponent. +# [INIT] firstmain [PLAYER1] @@ -29,7 +38,7 @@ next combatend [PLAYER1] inplay:Curiosity -hand:Island +library:Island life:14 [PLAYER2] inplay:Craw Wurm diff --git a/projects/mtg/bin/Res/themes/Christmas/backdrop.jpg b/projects/mtg/bin/Res/themes/Christmas/backdrop.jpg index 96df925ad..269d2c2c3 100644 Binary files a/projects/mtg/bin/Res/themes/Christmas/backdrop.jpg and b/projects/mtg/bin/Res/themes/Christmas/backdrop.jpg differ diff --git a/projects/mtg/bin/Res/themes/Classic/backdrop.jpg b/projects/mtg/bin/Res/themes/Classic/backdrop.jpg index 228964878..648a6b086 100644 Binary files a/projects/mtg/bin/Res/themes/Classic/backdrop.jpg and b/projects/mtg/bin/Res/themes/Classic/backdrop.jpg differ diff --git a/projects/mtg/bin/Res/themes/Gemstones/backdrop_black.jpg b/projects/mtg/bin/Res/themes/Gemstones/backdrop_black.jpg index 35d77fa27..b3c01c72e 100644 Binary files a/projects/mtg/bin/Res/themes/Gemstones/backdrop_black.jpg and b/projects/mtg/bin/Res/themes/Gemstones/backdrop_black.jpg differ diff --git a/projects/mtg/bin/Res/themes/Gemstones/backdrop_blue.jpg b/projects/mtg/bin/Res/themes/Gemstones/backdrop_blue.jpg index 4ca776b0d..a8e129f0c 100644 Binary files a/projects/mtg/bin/Res/themes/Gemstones/backdrop_blue.jpg and b/projects/mtg/bin/Res/themes/Gemstones/backdrop_blue.jpg differ diff --git a/projects/mtg/bin/Res/themes/Gemstones/backdrop_green.jpg b/projects/mtg/bin/Res/themes/Gemstones/backdrop_green.jpg index f4ae6edca..663901da4 100644 Binary files a/projects/mtg/bin/Res/themes/Gemstones/backdrop_green.jpg and b/projects/mtg/bin/Res/themes/Gemstones/backdrop_green.jpg differ diff --git a/projects/mtg/bin/Res/themes/Gemstones/backdrop_red.jpg b/projects/mtg/bin/Res/themes/Gemstones/backdrop_red.jpg index f79bd5bc9..52d3d66c3 100644 Binary files a/projects/mtg/bin/Res/themes/Gemstones/backdrop_red.jpg and b/projects/mtg/bin/Res/themes/Gemstones/backdrop_red.jpg differ diff --git a/projects/mtg/bin/Res/themes/Gemstones/backdrop_white.jpg b/projects/mtg/bin/Res/themes/Gemstones/backdrop_white.jpg index 04c5588ea..3ec0453b6 100644 Binary files a/projects/mtg/bin/Res/themes/Gemstones/backdrop_white.jpg and b/projects/mtg/bin/Res/themes/Gemstones/backdrop_white.jpg differ diff --git a/projects/mtg/bin/Res/themes/Green/backdrop.jpg b/projects/mtg/bin/Res/themes/Green/backdrop.jpg index b2c8b8dc0..427da7540 100644 Binary files a/projects/mtg/bin/Res/themes/Green/backdrop.jpg and b/projects/mtg/bin/Res/themes/Green/backdrop.jpg differ diff --git a/projects/mtg/bin/Res/themes/White Shrine/backdrop.JPG b/projects/mtg/bin/Res/themes/White Shrine/backdrop.JPG index b881729aa..aa16211a2 100644 Binary files a/projects/mtg/bin/Res/themes/White Shrine/backdrop.JPG and b/projects/mtg/bin/Res/themes/White Shrine/backdrop.JPG differ diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index cf8706933..cbc9fb7fd 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -556,6 +556,15 @@ private: intValue = card->previous->previous->sunburst; } } + else if (s == "converge") + { + intValue = 0; + for (int i = Constants::MTG_COLOR_GREEN; i <= Constants::MTG_COLOR_WHITE; ++i) + { + if(card->getManaCost()->getManaUsedToCast()->hasColor(i)) + intValue +=1; + } + } else if (s == "targetedcurses") { if(card->playerTarget) @@ -645,11 +654,11 @@ private: } else if (s == "p" || s == "power") { - intValue = target->getPower(); + intValue = target->getCurrentPower(); } else if (s == "t" || s == "toughness") { - intValue = target->getToughness(); + intValue = target->getCurrentToughness(); } else if (s == "kicked") { @@ -679,6 +688,20 @@ private: { intValue = target->controller()->opponent()->game->hand->nb_cards; } + else if (s == "urzatron")//Urza lands + { + if(card->controller()->game->battlefield->hasAlias(4192) && card->controller()->game->battlefield->hasAlias(4193) && card->controller()->game->battlefield->hasAlias(4194)) + intValue = 1; + else + intValue = 0; + } + else if (s == "worshipped")//Worship + { + if(card->controller()->game->battlefield->hasType("creature")) + intValue = card->controller()->life; + else + intValue = 0; + } else if (s == "pancientooze")//Ancient Ooze { intValue = 0; @@ -708,7 +731,7 @@ private: else if (s == "pbasiclandtypes")//Basic Land types { intValue = 0; - int forest, plains, swamp, island, mountain = 0; + int forest = 0, plains = 0, swamp = 0, island = 0, mountain = 0; for (int j = card->controller()->game->battlefield->nb_cards - 1; j >= 0; --j) { if (card->controller()->game->battlefield->cards[j]->hasType("forest")) @@ -801,7 +824,7 @@ private: else if (s == "gravecardtypes")//Tarmogoyf { intValue = 0; - int art, cre, enc, ins, lnd, sor, trb, pwk = 0; + int art = 0, cre = 0, enc = 0, ins = 0, lnd = 0, sor = 0, trb = 0, pwk = 0; for (int i = 0; i < 2; i++) { Player * p = card->getObserver()->players[i]; @@ -1173,9 +1196,9 @@ public: class TrcardDrawn: public Trigger { public: - - TrcardDrawn(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false) : - Trigger(observer, id, source,once, tc) + bool thiscontroller, thisopponent; + TrcardDrawn(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false, bool thiscontroller = false, bool thisopponent = false) : + Trigger(observer, id, source,once, tc),thiscontroller(thiscontroller),thisopponent(thisopponent) { } @@ -1184,7 +1207,12 @@ public: WEventcardDraw * e = dynamic_cast (event); if (!e) return 0; if (!tc->canTarget(e->player)) return 0; - + if(thiscontroller) + if(e->player != source->controller()) + return 0; + if(thisopponent) + if(e->player == source->controller()) + return 0; return 1; } @@ -1272,8 +1300,10 @@ public: bool sourceUntapped; bool limitOnceATurn; int triggeredTurn; - TrDamaged(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool limitOnceATurn = false,bool once = false) : - Trigger(observer, id, source, once, tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped),limitOnceATurn(limitOnceATurn) + bool thiscontroller; + bool thisopponent; + TrDamaged(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool limitOnceATurn = false,bool once = false, bool thiscontroller = false, bool thisopponent = false) : + Trigger(observer, id, source, once, tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped),limitOnceATurn(limitOnceATurn),thiscontroller(thiscontroller),thisopponent(thisopponent) { triggeredTurn = -1; } @@ -1290,6 +1320,15 @@ public: if (fromTc && !fromTc->canTarget(e->damage->source)) return 0; if (type == 1 && e->damage->typeOfDamage != Damage::DAMAGE_COMBAT) return 0; if (type == 2 && e->damage->typeOfDamage == Damage::DAMAGE_COMBAT) return 0; + if (e->damage->target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER) + { + if(thiscontroller) + if(e->damage->target != (Damageable *)source->controller()) + return 0; + if(thisopponent) + if(e->damage->target == (Damageable *)source->controller()) + return 0; + } e->damage->target->thatmuch = e->damage->damage; e->damage->source->thatmuch = e->damage->damage; this->source->thatmuch = e->damage->damage; @@ -1314,9 +1353,9 @@ class TrLifeGained: public Trigger public: TargetChooser * fromTc; int type;//this allows damagenoncombat and combatdamage to share this trigger - bool sourceUntapped; - TrLifeGained(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool once = false) : - Trigger(observer, id, source, once , tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped) + bool sourceUntapped, thiscontroller, thisopponent; + TrLifeGained(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool once = false, bool thiscontroller = false, bool thisopponent = false) : + Trigger(observer, id, source, once , tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped) , thiscontroller(thiscontroller) , thisopponent(thisopponent) { } @@ -1330,6 +1369,12 @@ public: if (fromTc && !fromTc->canTarget(e->player)) return 0; if (type == 1 && (e->amount > 0)) return 0; if (type == 0 && (e->amount < 0)) return 0; + if(thiscontroller) + if(e->player != source->controller()) + return 0; + if(thisopponent) + if(e->player == source->controller()) + return 0; e->player->thatmuch = abs(e->amount); this->source->thatmuch = abs(e->amount); @@ -1417,7 +1462,7 @@ public: } }; -//targetted trigger +//counter trigger class TrCounter: public Trigger { public: @@ -1749,7 +1794,9 @@ public: string destination; MTGAbility * andAbility; string named; - AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL); + bool undying; + bool persist; + AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL, bool undying = false, bool persist = false); MTGGameZone * destinationZone(Targetable * target = NULL); int resolve(); const string getMenuText(); @@ -2068,6 +2115,7 @@ public: assert(value < 2); _target->basicAbilities.set(ability, value > 0); + _target->modifiedbAbi += 1; return InstantAbility::addToGame(); } @@ -2080,7 +2128,10 @@ public: { MTGCardInstance * _target = (MTGCardInstance *) target; if (_target) + { _target->basicAbilities.set(ability, stateBeforeActivation); + _target->modifiedbAbi -= 1; + } return 1; } @@ -4170,7 +4221,9 @@ class AANewTarget: public ActivatedAbility { public: bool retarget; - AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL); +bool reequip; +bool newhook; + AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL, bool reequip = false, bool newhook = false); int resolve(); const string getMenuText(); AANewTarget * clone() const; @@ -4780,6 +4833,49 @@ public: ~AVanishing(); }; +//Produce Mana when tapped for mana... +class AProduceMana: public MTGAbility +{ +public: + string ManaDescription; + string mana[5]; + + AProduceMana(GameObserver* observer, int _id, MTGCardInstance * _source, string _ManaDescription); + int receiveEvent(WEvent * event); + int produce(); + const string getMenuText(); + //virtual ostream& toString(ostream& out) const; + AProduceMana * clone() const; + ~AProduceMana(); +}; + +//Produce Mana when a mana is engaged... +class AEngagedManaAbility: public MTGAbility +{ +public: + string colorname; + AEngagedManaAbility(GameObserver* observer, int _id, MTGCardInstance * _source, string _colorname) : + MTGAbility(observer, _id, _source) + { + colorname = _colorname; + } + int receiveEvent(WEvent * event) + { + if(WEventEngageMana * isManaProduced = dynamic_cast (event)) + { + if ((isManaProduced->card == source) && isManaProduced->color == Constants::GetColorStringIndex(colorname)) + { + source->controller()->getManaPool()->add(Constants::GetColorStringIndex(colorname),1); + } + } + return 1; + } + AEngagedManaAbility * clone() const + { + return NEW AEngagedManaAbility(*this); + } +}; + //Upkeep Cost class AUpkeep: public ActivatedAbility, public NestedAbility { @@ -5953,6 +6049,37 @@ public: } }; +//Reduce to .. Ali from Cairo... +class AReduceToAbility: public MTGAbility +{ +public: + string life_s; + + AReduceToAbility(GameObserver* observer, int _id, MTGCardInstance * _source, string _life_s) : + MTGAbility(observer, _id, _source) + { + life_s = _life_s; + } + int receiveEvent(WEvent * event) + { + if(WEventDamage * isDamaged = dynamic_cast (event)) + { + if (isDamaged->damage->target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER) + { + Player * p = (Player *) isDamaged->damage->target; + WParsedInt lifetoset(life_s, NULL, source); + if(p && p == source->controller() && p->life <= lifetoset.getValue()) + p->life = lifetoset.getValue(); + } + } + return 1; + } + AReduceToAbility * clone() const + { + return NEW AReduceToAbility(*this); + } +}; + //flanking ability class AFlankerAbility: public MTGAbility { diff --git a/projects/mtg/include/CardGui.h b/projects/mtg/include/CardGui.h index 1957a5505..4ef10700b 100644 --- a/projects/mtg/include/CardGui.h +++ b/projects/mtg/include/CardGui.h @@ -33,7 +33,7 @@ protected: /* ** Tries to render the Big version of a card picture, backups to text version in case of failure */ - static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false); + static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false); static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal); static void AlternateRender(MTGCard * card, const Pos& pos); @@ -55,8 +55,8 @@ public: virtual void Render(); virtual void Update(float dt); - void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false); - static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false); + void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false); + static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false); static JQuadPtr AlternateThumbQuad(MTGCard * card); virtual ostream& toString(ostream&) const; diff --git a/projects/mtg/include/CardPrimitive.h b/projects/mtg/include/CardPrimitive.h index f02cd7d16..8f6041baf 100644 --- a/projects/mtg/include/CardPrimitive.h +++ b/projects/mtg/include/CardPrimitive.h @@ -58,6 +58,8 @@ public: uint8_t colors; typedef std::bitset BasicAbilitiesSet; BasicAbilitiesSet basicAbilities; + BasicAbilitiesSet origbasicAbilities; + BasicAbilitiesSet LKIbasicAbilities; map magicTexts; string magicText; diff --git a/projects/mtg/include/GameApp.h b/projects/mtg/include/GameApp.h index eeb1c8141..d672e45bf 100644 --- a/projects/mtg/include/GameApp.h +++ b/projects/mtg/include/GameApp.h @@ -73,6 +73,7 @@ public: static hgeParticleSystem * Particles[6]; static bool HasMusic; static string systemError; + static char mynbcardsStr[512]; static JMusic* music; static string currentMusicFile; static void playMusic(string filename = "", bool loop = true); diff --git a/projects/mtg/include/GameStateMenu.h b/projects/mtg/include/GameStateMenu.h index d8fb9106a..6b4b3f205 100644 --- a/projects/mtg/include/GameStateMenu.h +++ b/projects/mtg/include/GameStateMenu.h @@ -24,7 +24,6 @@ private: float mCreditsYPos; int currentState; int mVolume; - char nbcardsStr[400]; vector langs; vector primitives; @@ -46,7 +45,6 @@ private: bool langChoices; void runTest(); //!! void listPrimitives(); - void genNbCardsStr(); //computes the contents of nbCardsStr void ensureMGuiController(); //creates the MGuiController if it doesn't exist string loadRandomWallpaper(); //loads a list of string of textures that can be randolmy shown on the loading screen @@ -66,6 +64,7 @@ public: int nextSetFolder(const string & root, const string & file); // Retrieves the next directory to have matching file void createUsersFirstDeck(int setId); + static void genNbCardsStr(); //computes the contents of nbCardsStr virtual ostream& toString(ostream& out) const; enum diff --git a/projects/mtg/include/GuiPhaseBar.h b/projects/mtg/include/GuiPhaseBar.h index 78cec2677..4b78f7d7c 100644 --- a/projects/mtg/include/GuiPhaseBar.h +++ b/projects/mtg/include/GuiPhaseBar.h @@ -22,7 +22,7 @@ private: InOutQuadEasing zoomFactorEasing; DuelLayers* mpDuelLayers; - void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale); + void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale, float z); public: GuiPhaseBar(DuelLayers* duelLayers); ~GuiPhaseBar(); diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 3d460bfdd..5146b4940 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -233,6 +233,10 @@ public: void addbaseT(int t = 0); void revertbaseP(); void revertbaseT(); + int getCurrentPower(); + int getCurrentToughness(); + int LKIpower; + int LKItoughness; void cdaPT(int p = 0, int t = 0); bool isCDA; void switchPT(bool apply = false); @@ -241,6 +245,14 @@ public: bool isSwitchedPT; bool isACopier; bool bypassTC; + bool discarded; + int copiedID; + int modifiedbAbi; + bool StackIsEmptyandSorcerySpeed(); + bool isTargetted(); + int cardistargetted; + bool isTargetter(); + int cardistargetter; void eventattacked(); void eventattackedAlone(); diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index a070722a1..6a0d398fe 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -230,7 +230,11 @@ class Constants NOLIFEGAIN = 112, NOLIFEGAINOPPONENT = 113, AURAWARD = 114, - NB_BASIC_ABILITIES = 115, + MADNESS = 115, + PROTECTIONFROMCOLOREDSPELLS = 116, + MYGCREATUREEXILER = 117, + OPPGCREATUREEXILER = 118, + NB_BASIC_ABILITIES = 119, RARITY_S = 'S', //Special Rarity diff --git a/projects/mtg/include/MTGGameZones.h b/projects/mtg/include/MTGGameZones.h index 97687d006..7662311d0 100644 --- a/projects/mtg/include/MTGGameZones.h +++ b/projects/mtg/include/MTGGameZones.h @@ -103,6 +103,8 @@ class MTGGameZone { //returns true if one of the cards in the zone has the ability bool hasAbility(int ability); + //returns true if one of the cards in the zone has the alias + bool hasAlias(int alias); //returns true if one of the cards in the zone has the type bool hasType(const char * value); diff --git a/projects/mtg/include/MTGRules.h b/projects/mtg/include/MTGRules.h index 5a5fbf2cb..bd31cfc83 100644 --- a/projects/mtg/include/MTGRules.h +++ b/projects/mtg/include/MTGRules.h @@ -76,7 +76,7 @@ public: MTGPutInPlayRule(GameObserver* observer, int _id); const string getMenuText() { - return "cast card normally"; + return "Cast Card Normally"; } virtual MTGPutInPlayRule * clone() const; }; @@ -90,7 +90,7 @@ public: MTGKickerRule(GameObserver* observer, int _id); const string getMenuText() { - return "pay kicker"; + return "Pay Kicker"; } virtual MTGKickerRule * clone() const; }; @@ -110,7 +110,7 @@ public: { if(alternativeName.size()) return alternativeName.c_str(); - return "pay alternative cost"; + return "Pay Alternative Cost"; } virtual MTGAlternativeCostRule * clone() const; }; @@ -124,7 +124,7 @@ public: MTGBuyBackRule(GameObserver* observer, int _id); const string getMenuText() { - return "cast and buy back"; + return "Cast and Buyback"; } virtual MTGBuyBackRule * clone() const; }; @@ -139,7 +139,7 @@ public: MTGFlashBackRule(GameObserver* observer, int _id); const string getMenuText() { - return "flash back"; + return "Flashback"; } virtual MTGFlashBackRule * clone() const; }; @@ -153,7 +153,7 @@ public: MTGRetraceRule(GameObserver* observer, int _id); const string getMenuText() { - return "retrace"; + return "Retrace"; } virtual MTGRetraceRule * clone() const; }; @@ -168,7 +168,7 @@ public: MTGMorphCostRule(GameObserver* observer, int _id); const string getMenuText() { - return "play morphed"; + return "Play Morphed"; } virtual MTGMorphCostRule * clone() const; }; @@ -182,7 +182,7 @@ public: MTGPlayFromGraveyardRule(GameObserver* observer, int _id); const string getMenuText() { - return "cast card from graveyard"; + return "Cast Card From Graveyard"; } virtual MTGPlayFromGraveyardRule * clone() const; }; diff --git a/projects/mtg/include/Player.h b/projects/mtg/include/Player.h index 800ef7db8..eac30a20e 100644 --- a/projects/mtg/include/Player.h +++ b/projects/mtg/include/Player.h @@ -44,6 +44,7 @@ public: int drawCounter; int epic; int initLife; + int raidcount; vector prowledTypes; vectorcurses; Player(GameObserver *observer, string deckFile, string deckFileSmall, MTGDeck * deck = NULL); @@ -71,7 +72,7 @@ public: ManaPool * getManaPool(); void takeMulligan(); void serumMulligan(); - bool DeadLifeState(); + bool DeadLifeState(bool check = false); ManaCost * doesntEmpty; ManaCost * poolDoesntEmpty; void cleanupPhase(); diff --git a/projects/mtg/include/WEvent.h b/projects/mtg/include/WEvent.h index 890762796..94043218e 100644 --- a/projects/mtg/include/WEvent.h +++ b/projects/mtg/include/WEvent.h @@ -279,6 +279,12 @@ struct WEventCardUnattached : public WEventCardUpdate { virtual Targetable * getTarget(int target); }; +//event when card moves from player/opponent battlefield to player/opponent battlefield +struct WEventCardControllerChange : public WEventCardUpdate { + WEventCardControllerChange(MTGCardInstance * card); + virtual Targetable * getTarget(int target); +}; + std::ostream& operator<<(std::ostream&, const WEvent&); #endif diff --git a/projects/mtg/include/Wagic_Version.h b/projects/mtg/include/Wagic_Version.h index 58f7175d4..82d9d8d4b 100644 --- a/projects/mtg/include/Wagic_Version.h +++ b/projects/mtg/include/Wagic_Version.h @@ -12,8 +12,8 @@ Author: Michael Nguyen /* Wagic versions */ #define WAGIC_VERSION_MAJOR 0 -#define WAGIC_VERSION_MEDIUM 20 -#define WAGIC_VERSION_MINOR 1 +#define WAGIC_VERSION_MEDIUM 19 +#define WAGIC_VERSION_MINOR 2 #define VERSION_DOT(a, b, c) a ##.## b ##.## c #define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 24b15752a..5fd4c6f3c 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -93,9 +93,27 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string WFont * mFont = observer->getResourceManager()->GetWFont(Fonts::MAIN_FONT); mFont->SetColor(ARGB(255,255,255,255)); mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); - - mFont->DrawString(_(action).c_str(), x + 35, y + GetVerticalTextOffset(), JGETEXT_LEFT); JRenderer * renderer = JRenderer::GetInstance(); + + if (!targetQuad) + { + /*if(source->controller()->isHuman() && source->controller()->opponent()->isAI() && !alt2.size() && _(action).c_str() == source->name) + mFont->DrawString("You play ", x + 35, y-15 + GetVerticalTextOffset(), JGETEXT_LEFT); + else if(source->controller()->isAI() && source->controller()->opponent()->isHuman() && !alt2.size() && _(action).c_str() == source->name) + mFont->DrawString("Opponent plays ", x + 35, y-15 + GetVerticalTextOffset(), JGETEXT_LEFT);*/ + mFont->DrawString(_(action).c_str(), x + 35, y + GetVerticalTextOffset(), JGETEXT_LEFT); + } + else + { + renderer->FillRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(235,10,10,10)); + /*if(source->controller()->isHuman() && source->controller()->opponent()->isAI()) + renderer->DrawRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(245,0,255,0)); + else + renderer->DrawRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(245,255,0,0));*/ + mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT); + mFont->DrawString(_(action).c_str(), x + 75, y + GetVerticalTextOffset(), JGETEXT_LEFT); + } + JQuadPtr quad = observer->getResourceManager()->RetrieveCard(source, CACHE_THUMB); if (!quad.get()) quad = CardGui::AlternateThumbQuad(source); @@ -123,12 +141,12 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string targetQuad->SetColor(ARGB(255,255,255,255)); targetQuad->SetHotSpot(targetQuad->mWidth / 2, targetQuad->mHeight / 2); float scale = mHeight / targetQuad->mHeight; - renderer->RenderQuad(targetQuad, x + 150, y + ((mHeight - targetQuad->mHeight) / 2) + targetQuad->mHotSpotY, 0, scale, scale); + renderer->RenderQuad(targetQuad, x + 55, y + ((mHeight - targetQuad->mHeight) / 2) + targetQuad->mHotSpotY, 0, scale, scale); targetQuad->SetHotSpot(backupX, backupY); } else if (alt2.size()) { - mFont->DrawString(_(alt2).c_str(), x + 120, y + GetVerticalTextOffset()); + mFont->DrawString(_(alt2).c_str(), x + 35, y+15 + GetVerticalTextOffset()); } } @@ -1219,10 +1237,17 @@ void ActionStack::Render() mFont->SetColor(ARGB(255,255,255,255)); JRenderer * renderer = JRenderer::GetInstance(); - renderer->FillRoundRect(x0 + 16, y0 + 16, width + 2, height + 2, 10, ARGB(128,0,0,0)); - renderer->FillRoundRect(x0 - 5, y0, width + 2, height + 2, 10, ARGB(200,0,0,0)); - renderer->DrawRoundRect(x0 - 5, y0, width + 2, height + 2, 10, ARGB(255,255,255,255)); - + //stack shadow + //renderer->FillRoundRect(x0 - 7, y0+2, width + 17, height + 2, 9.0f, ARGB(128,0,0,0)); + //stack fill + renderer->FillRect(x0 - 7, y0+2, width + 17, height + 14, ARGB(225,5,5,5)); + //stack highlight + renderer->FillRect(x0 - 6, y0+3, width + 15, 30, ARGB(255,89,89,89)); + //another border + renderer->DrawRect(x0 - 6, y0+33, width + 15, height - 18, ARGB(255,89,89,89)); + //stack border + renderer->DrawRect(x0 - 7, y0+2, width + 17, height + 14, ARGB(255,240,240,240)); + std::ostringstream stream; // WALDORF - changed "interrupt ?" to "Interrupt?". Don't display count down // seconds if the user disables auto progressing interrupts by setting the seconds @@ -1235,11 +1260,11 @@ void ActionStack::Render() else stream << _(kInterruptMessageString) << " " << static_cast(timer); - mFont->DrawString(stream.str(), x0 + 5, currenty); + mFont->DrawString(stream.str(), x0 + 5, currenty - 2); // static const float kIconVerticalOffset = 24; - static const float kIconHorizontalOffset = 9; - static const float kBeforeIconSpace = 10; + static const float kIconHorizontalOffset = 10; + static const float kBeforeIconSpace = 12; //Render "interrupt?" text + possible actions { @@ -1248,25 +1273,25 @@ void ActionStack::Render() if (gModRules.game.canInterrupt()) { - renderer->RenderQuad(pspIcons[7].get(), currentx, kIconVerticalOffset, 0, kGamepadIconSize, kGamepadIconSize); + renderer->RenderQuad(pspIcons[7].get(), currentx, kIconVerticalOffset - 2, 0, kGamepadIconSize, kGamepadIconSize); currentx+= kIconHorizontalOffset; - mFont->DrawString(_(kInterruptString), currentx, kIconVerticalOffset - 6); + mFont->DrawString(_(kInterruptString), currentx, kIconVerticalOffset - 8); currentx+= mFont->GetStringWidth(_(kInterruptString).c_str()) + kBeforeIconSpace; } noBtnXOffset = static_cast(currentx); - renderer->RenderQuad(pspIcons[4].get(), currentx, kIconVerticalOffset, 0, kGamepadIconSize, kGamepadIconSize); + renderer->RenderQuad(pspIcons[4].get(), currentx, kIconVerticalOffset - 2, 0, kGamepadIconSize, kGamepadIconSize); currentx+= kIconHorizontalOffset; - mFont->DrawString(_(kNoString), currentx, kIconVerticalOffset - 6); + mFont->DrawString(_(kNoString), currentx, kIconVerticalOffset - 8); currentx+= mFont->GetStringWidth(_(kNoString).c_str()) + kBeforeIconSpace; noToAllBtnXOffset = static_cast(currentx); if (mObjects.size() > 1) { - renderer->RenderQuad(pspIcons[6].get(), currentx, kIconVerticalOffset, 0, kGamepadIconSize, kGamepadIconSize); + renderer->RenderQuad(pspIcons[6].get(), currentx, kIconVerticalOffset - 2, 0, kGamepadIconSize, kGamepadIconSize); currentx+= kIconHorizontalOffset; - mFont->DrawString(_(kNoToAllString), currentx, kIconVerticalOffset - 6); + mFont->DrawString(_(kNoToAllString), currentx, kIconVerticalOffset - 8); currentx+= mFont->GetStringWidth(_(kNoToAllString).c_str()) + kBeforeIconSpace; } diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 622d20af1..a02bc3912 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -390,8 +390,26 @@ int AACopier::resolve() MTGCardInstance * _target = (MTGCardInstance *) target; if (_target) { - source->copy(_target); + MTGCard* clone = MTGCollection()->getCardById(_target->copiedID); + MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game); + source->copy(myClone); source->isACopier = true; + source->copiedID = _target->copiedID; + source->modifiedbAbi = _target->modifiedbAbi; + source->origbasicAbilities = _target->origbasicAbilities; + if(_target->isMorphed) + { + source->power = 2; + source->life = 2; + source->toughness = 2; + source->setColor(0,1); + source->name = "Morph"; + source->types.clear(); + string cre = "Creature"; + source->setType(cre.c_str()); + source->basicAbilities.reset(); + source->getManaCost()->resetCosts(); + } return 1; } return 0; @@ -1160,14 +1178,14 @@ int GenericPaidAbility::resolve() baseAbility->target = target; optionalCost = ManaCost::parseManaCost(baseCost, NULL, source); - // hacky way to produce better MenuText + /*// hacky way to produce better MenuText AAFakeAbility* isFake = dynamic_cast< AAFakeAbility* >( baseAbility ); size_t findPayN = isFake->named.find(" {value} mana"); if (isFake && findPayN != string::npos) { stringstream parseN; parseN << optionalCost->getCost(Constants::MTG_COLOR_ARTIFACT); isFake->named.replace(findPayN + 1, 7, parseN.str()); - } + }//commented out, it crashes cards with recover ability*/ MTGAbility * set = baseAbility->clone(); set->oneShot = true; @@ -1721,8 +1739,8 @@ AAFrozen * AAFrozen::clone() const } // chose a new target for an aura or enchantment and equip it note: VERY basic right now. -AANewTarget::AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget, ManaCost * _cost) : -ActivatedAbility(observer, id, card, _cost, 0),retarget(retarget) +AANewTarget::AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget, ManaCost * _cost, bool reequip, bool newhook) : +ActivatedAbility(observer, id, card, _cost, 0),retarget(retarget),reequip(reequip),newhook(newhook) { target = _target; } @@ -1735,7 +1753,7 @@ int AANewTarget::resolve() _target = source; source = (MTGCardInstance *) target; } - if (_target) + if (_target && !reequip) { while (_target->next) _target = _target->next; @@ -1772,6 +1790,37 @@ int AANewTarget::resolve() } } + if (_target && _target->currentZone == _target->controller()->game->battlefield && reequip) + { + if(!newhook) + { + _target = source; + source = (MTGCardInstance *) target; + } + else + { + while (_target->next) + _target = _target->next; + } + if(_target->hasSubtype(Subtypes::TYPE_EQUIPMENT)) + { + for (size_t i = 1; i < game->mLayers->actionLayer()->mObjects.size(); i++) + { + MTGAbility * a = ((MTGAbility *) game->mLayers->actionLayer()->mObjects[i]); + AEquip * eq = dynamic_cast (a); + if (eq && eq->source == _target) + { + ((AEquip*)a)->unequip(); + ((AEquip*)a)->equip(source); + } + } + } + if(!newhook) + { + target = source; + source = _target; + } + } return 1; } @@ -2069,16 +2118,16 @@ int AADynamic::resolve() switch(type) { case DYNAMIC_ABILITY_TYPE_POWER: - sourceamount = ((MTGCardInstance *) source)->power; - targetamount = ((MTGCardInstance *) _target)->power; + sourceamount = ((MTGCardInstance *) source)->getCurrentPower(); + targetamount = ((MTGCardInstance *) _target)->getCurrentPower(); if(eachother ) - sourceamount = ((MTGCardInstance *) source)->power; + sourceamount = ((MTGCardInstance *) source)->getCurrentPower(); break; case DYNAMIC_ABILITY_TYPE_TOUGHNESS: - sourceamount = ((MTGCardInstance *) source)->toughness; - targetamount = ((MTGCardInstance *) _target)->toughness; + sourceamount = ((MTGCardInstance *) source)->getCurrentToughness(); + targetamount = ((MTGCardInstance *) _target)->getCurrentToughness(); if(eachother ) - sourceamount = ((MTGCardInstance *) source)->toughness; + sourceamount = ((MTGCardInstance *) source)->getCurrentToughness(); break; case DYNAMIC_ABILITY_TYPE_MANACOST: if(amountsource == 1) @@ -2520,6 +2569,10 @@ int AACloner::resolve() // Use id of the card to have the same image as the original MTGCard* clone = (_target->isToken ? _target: MTGCollection()->getCardById(_target->getId())); + // If its a copier then copy what it is + if(_target->isACopier) + clone = _target; + Player * targetPlayer = who == 1 ? source->controller()->opponent() : source->controller(); int tokenize = 1;//tokenizer support for cloning @@ -2550,7 +2603,7 @@ int AACloner::resolve() if(_target->pbonus > 0) spell->source->power = _target->power - _target->pbonus; else - spell->source->power = _target->power + _target->pbonus; + spell->source->power = _target->power + abs(_target->pbonus); if(_target->tbonus > 0) { spell->source->toughness = _target->toughness - _target->tbonus; @@ -2558,8 +2611,8 @@ int AACloner::resolve() } else { - spell->source->toughness = _target->toughness + _target->tbonus; - spell->source->life = _target->toughness + _target->tbonus; + spell->source->toughness = _target->toughness + abs(_target->tbonus); + spell->source->life = _target->toughness + abs(_target->tbonus); } } list::iterator it; @@ -2575,6 +2628,8 @@ int AACloner::resolve() { spell->source->addType(*it); } + spell->source->modifiedbAbi = _target->modifiedbAbi; + spell->source->origbasicAbilities = _target->origbasicAbilities; delete spell; } return 1; @@ -2710,8 +2765,8 @@ AInstantCastRestrictionUEOT::~AInstantCastRestrictionUEOT() //AAMover -AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost) : - ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName) +AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost, bool undying, bool persist) : + ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist) { if (_target) target = _target; @@ -2758,6 +2813,10 @@ int AAMover::resolve() andAbilityClone->addToGame(); } } + if(persist) + spell->source->counters->addCounter(-1,-1); + if(undying) + spell->source->counters->addCounter(1,1); delete spell; return 1; } @@ -4157,6 +4216,7 @@ for (it = types.begin(); it != types.end(); it++) for (it = abilities.begin(); it != abilities.end(); it++) { _target->basicAbilities.set(*it); + _target->modifiedbAbi += 1; } if(newAbilityFound) @@ -4305,6 +4365,7 @@ int ATransformer::destroy() for (it = abilities.begin(); it != abilities.end(); it++) { _target->basicAbilities.reset(*it); + _target->modifiedbAbi -= 1; } for (it = oldcolors.begin(); it != oldcolors.end(); it++) @@ -4851,6 +4912,78 @@ AVanishing::~AVanishing() { } +//Produce Mana +AProduceMana::AProduceMana(GameObserver* observer, int _id, MTGCardInstance * _source, string ManaDescription) : +MTGAbility(observer, _id, source),ManaDescription(ManaDescription) +{ + source = _source; + mana[0] = "{g}"; mana[1] = "{u}"; mana[2] = "{r}"; mana[3] = "{b}"; mana[4] = "{w}"; +} + +int AProduceMana::receiveEvent(WEvent * event) +{ + if(WEventCardTappedForMana * isTappedForMana = dynamic_cast (event)) + { + if ((isTappedForMana->card == source)||(isTappedForMana->card == source->target && ManaDescription == "selectmana")) + produce(); + } + return 1; +} + +int AProduceMana::produce() +{ + if(ManaDescription == "selectmana") + {//I tried menu ability and vector to have a shorter code but it crashes wagic at end of turn... + //The may ability on otherhand works but the ability is cumulative... + //This must be wrapped on menuability so we can use it on successions... + AManaProducer *ap0 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[0],NULL,source), NULL, 0,"",false); + MayAbility *mw0 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap0, source,true); + MTGAbility *ga0 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw0); + + AManaProducer *ap1 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[1],NULL,source), NULL, 0,"",false); + MayAbility *mw1 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap1, source,true); + MTGAbility *ga1 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw1); + + AManaProducer *ap2 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[2],NULL,source), NULL, 0,"",false); + MayAbility *mw2 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap2, source,true); + MTGAbility *ga2 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw2); + + AManaProducer *ap3 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[3],NULL,source), NULL, 0,"",false); + MayAbility *mw3 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap3, source,true); + MTGAbility *ga3 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw3); + + AManaProducer *ap4 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[4],NULL,source), NULL, 0,"",false); + MayAbility *mw4 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap4, source,true); + MTGAbility *ga4 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw4); + + ga0->resolve(); + ga1->resolve(); + ga2->resolve(); + ga3->resolve(); + ga4->resolve(); + } + else + { + AManaProducer *amp = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(ManaDescription,NULL,source), NULL, 0,"",false); + amp->resolve(); + } + return 1; +} + +const string AProduceMana::getMenuText() +{ + return "Produce Mana"; +} + +AProduceMana * AProduceMana::clone() const +{ + return NEW AProduceMana(*this); +} + +AProduceMana::~AProduceMana() +{ +} + //AUpkeep AUpkeep::AUpkeep(GameObserver* observer, int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int restrictions, int _phase, int _once,bool Cumulative) : @@ -5179,7 +5312,7 @@ void ABlink::returnCardIntoPlay(MTGCardInstance* _target) { return; } - MTGGameZone * inplay = spell->source->owner->game->inPlay; + /*MTGGameZone * inplay = spell->source->owner->game->inPlay; spell->source->target = NULL; for (int i = game->getRandomGenerator()->random()%inplay->nb_cards;;i = game->getRandomGenerator()->random()%inplay->nb_cards) { @@ -5193,7 +5326,16 @@ void ABlink::returnCardIntoPlay(MTGCardInstance* _target) { this->forceDestroy = 1; return; } - } + }*/ + //replaced with castcard(putinplay) + MTGAbility *a = NEW AACastCard(game, game->mLayers->actionLayer()->getMaxId(), Blinker, Blinker,false,false,false,"","Return to Play",false,true); + a->oneShot = false; + a->canBeInterrupted = false; + a->addToGame(); + SAFE_DELETE(spell); + SAFE_DELETE(tc); + this->forceDestroy = 1; + return; } spell->source->power = spell->source->origpower; spell->source->toughness = spell->source->origtoughness; @@ -5541,7 +5683,7 @@ void AACastCard::Update(float dt) toCheck->bypassTC = true; TargetChooserFactory tcf(game); TargetChooser * atc = tcf.createTargetChooser(toCheck->spellTargetType,toCheck); - if (toCheck->hasType(Subtypes::TYPE_AURA) && !atc->validTargetsExist()) + if ((toCheck->hasType(Subtypes::TYPE_AURA) && !atc->validTargetsExist())||toCheck->isToken) { processed = true; this->forceDestroy = 1; @@ -5724,7 +5866,7 @@ const string AACastCard::getMenuText() return nameThis.c_str(); if(putinplay) return "Put Into Play"; - return "Cast For Free"; + return "Cast Card"; } AACastCard * AACastCard::clone() const diff --git a/projects/mtg/src/CardDisplay.cpp b/projects/mtg/src/CardDisplay.cpp index 38cf35913..13c9f2fcd 100644 --- a/projects/mtg/src/CardDisplay.cpp +++ b/projects/mtg/src/CardDisplay.cpp @@ -267,7 +267,7 @@ void CardDisplay::Render() int drawMode = DrawMode::kNormal; if (observer) { - pos.actY = 150; + pos.actY = 145; if (x < (CardGui::BigWidth / 2)) pos.actX = SCREEN_WIDTH - 10 - CardGui::BigWidth / 2; drawMode = observer->getCardSelector()->GetDrawMode(); } diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index a114df329..a9454f183 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -111,17 +111,17 @@ void CardGui::Update(float dt) PlayGuiObject::Update(dt); } -void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb) +void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder) { - DrawCard(card, inPosition, inMode, thumb); + DrawCard(card, inPosition, inMode, thumb, noborder); } -void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb) +void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder) { switch (inMode) { case DrawMode::kNormal: - RenderBig(inCard, inPosition, thumb); + RenderBig(inCard, inPosition, thumb, noborder); break; case DrawMode::kText: AlternateRender(inCard, inPosition); @@ -237,6 +237,31 @@ void CardGui::Render() if (quad) { quad->SetColor(ARGB(static_cast(actA),255,255,255)); + //fake border... + JQuadPtr fakeborder; + JQuadPtr highlightborder; + fakeborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); + highlightborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); + if(fakeborder) + { + fakeborder->SetColor(ARGB((int)(actA),15,15,15)); + renderer->RenderQuad(fakeborder.get(), actX, actY, actT, (29 * actZ + 1) / 16, 42 * actZ / 16); + } + //draw border for highlighting + if (game) + { + if (card && card->isTargetted() && highlightborder) + { + highlightborder->SetColor(ARGB(95,255,0,0)); + renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16); + } + if (card && card->isTargetter() && highlightborder) + { + highlightborder->SetColor(ARGB(95,0,245,0)); + renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16); + } + } + //draw the card image renderer->RenderQuad(quad.get(), actX, actY, actT, scale, scale); } @@ -267,7 +292,7 @@ void CardGui::Render() } JQuadPtr mor; - if(card->isMorphed && !alternate) + if((card->isMorphed||(card->name == "Morph" && card->isACopier)) && !alternate) { mor = card->getObserver()->getResourceManager()->RetrieveTempQuad("morph.jpg"); if (mor && mor->mTex) { @@ -277,14 +302,45 @@ void CardGui::Render() } } + //draw line + if (game) + { + if (card && card->isTargetted()) + { + if(card->isTapped()) + { + if(mHasFocus) + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0)); + else + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0)); + } + else + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,255,0,0)); + } + if (card && card->isTargetter()) + { + if(card->isTapped()) + { + if(mHasFocus) + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0)); + else + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0)); + } + else + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,0,255,0)); + } + } + //draws the numbers power/toughness if (card->isCreature()) { mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); char buffer[200]; sprintf(buffer, "%i/%i", card->power, card->life); - renderer->FillRect(actX - (12 * actZ), actY + 6 * actZ, 25 * actZ, 12 * actZ, + renderer->FillRect(actX - (13 * actZ), actY + 4 * actZ, 25.5f * actZ, 14 * actZ, ARGB(((static_cast(actA))/2),0,0,0)); + renderer->DrawRect(actX - (13 * actZ), actY + 4 * actZ, 25.5f * actZ, 14 * actZ, + ARGB(((static_cast(actA))),20,20,20)); //damaged or buffed or powered down if(card->wasDealtDamage && card->life <= 2) mFont->SetColor(ARGB(static_cast(actA),255,0,0));//red critical and damaged @@ -298,7 +354,7 @@ void CardGui::Render() mFont->SetColor(ARGB(static_cast(actA),255,255,255));//white default mFont->SetScale(actZ); mFont->SetScale(actZ); - mFont->DrawString(buffer, actX - 10 * actZ, actY + 8 * actZ); + mFont->DrawString(buffer, actX - 10 * actZ, actY + 7 * actZ); mFont->SetScale(1); } @@ -988,7 +1044,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad) } //Renders a big card on screen. Defaults to the "alternate" rendering if no image is found -void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb) +void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder) { JRenderer * renderer = JRenderer::GetInstance(); //GameObserver * game = GameObserver::GetInstance(); @@ -1013,7 +1069,30 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb) } quad->SetColor(ARGB(255,255,255,255)); float scale = pos.actZ * 250.f / quad->mHeight; - renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale); + //init setname + string cardsetname = setlist[card->setId].c_str(); + if(!noborder) + { + if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR") + { + //like white border + renderer->FillRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(255,248,248,255)); + //black thin line to simulate card edge + renderer->DrawRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(150,20,20,20)); + } + else + { + //like black border + renderer->FillRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(255,10,10,10)); + //white thin line to simulate card edge + renderer->DrawRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(50,240,240,240)); + } + //render card image + renderer->RenderQuad(quad.get(), x, pos.actY-2, pos.actT, scale-0.02f, scale-0.02f); + } + else + renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale); + RenderCountersBig(card, pos); return; } diff --git a/projects/mtg/src/CardPrimitive.cpp b/projects/mtg/src/CardPrimitive.cpp index 462457492..0ed61cd68 100644 --- a/projects/mtg/src/CardPrimitive.cpp +++ b/projects/mtg/src/CardPrimitive.cpp @@ -41,6 +41,8 @@ CardPrimitive::CardPrimitive(CardPrimitive * source) if(!source) return; basicAbilities = source->basicAbilities; + origbasicAbilities = source->basicAbilities; + LKIbasicAbilities = source->basicAbilities; for (size_t i = 0; i < source->types.size(); ++i) types.push_back(source->types[i]); @@ -76,6 +78,7 @@ CardPrimitive::~CardPrimitive() int CardPrimitive::init() { basicAbilities.reset(); + origbasicAbilities.reset(); types.clear(); diff --git a/projects/mtg/src/CardSelector.cpp b/projects/mtg/src/CardSelector.cpp index ce94a404c..3a7de16a7 100644 --- a/projects/mtg/src/CardSelector.cpp +++ b/projects/mtg/src/CardSelector.cpp @@ -176,7 +176,7 @@ bool CardSelector::CheckUserInput(JButton key) return true; } Target* oldactive = active; - timer = 250; + timer = 800; int x,y; JGE* jge = observer->getInput(); if(!jge) return false; @@ -306,7 +306,7 @@ switch_active: } else { - timer = 250; + timer = 800; } return true; } diff --git a/projects/mtg/src/Damage.cpp b/projects/mtg/src/Damage.cpp index 6626c4df8..3f6a329c9 100644 --- a/projects/mtg/src/Damage.cpp +++ b/projects/mtg/src/Damage.cpp @@ -78,6 +78,11 @@ int Damage::resolve() damage = 0; //rulings = 10/4/2004 The damage prevention ability works even if it has no counters, as long as some effect keeps its toughness above zero. //these creature are essentially immune to damage. however 0/-1 effects applied through lords or counters can kill them. + if ((_target)->has(Constants::PROTECTIONFROMCOLOREDSPELLS)) + {//damage is prevented as long as the damage source is a spell on the stack... + if((source->currentZone == source->controller()->opponent()->game->stack||source->currentZone == source->controller()->game->stack) && (source->hasColor(1)||source->hasColor(2)||source->hasColor(3)||source->hasColor(4)||source->hasColor(5))) + damage = 0; + } if ((_target)->has(Constants::PHANTOM)) { damage = 0; diff --git a/projects/mtg/src/DeckMenu.cpp b/projects/mtg/src/DeckMenu.cpp index d1c0adef2..6a9f7fa5a 100644 --- a/projects/mtg/src/DeckMenu.cpp +++ b/projects/mtg/src/DeckMenu.cpp @@ -276,6 +276,8 @@ void DeckMenu::Render() JQuadPtr quad = WResourceManager::Instance()->RetrieveTempQuad(currentAvatarImageName, TEXTURE_SUB_AVATAR); if(quad.get()) { + quad->mWidth = 35.f; + quad->mHeight = 50.f; if (currentMenuItem->getText() == "Evil Twin") { JQuad * evil = quad.get(); diff --git a/projects/mtg/src/DeckView.cpp b/projects/mtg/src/DeckView.cpp index 682b75957..394a9322c 100644 --- a/projects/mtg/src/DeckView.cpp +++ b/projects/mtg/src/DeckView.cpp @@ -133,13 +133,13 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail) else { Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255); - CardGui::DrawCard(cardPosition.card, pos, asThumbnail); + CardGui::DrawCard(cardPosition.card, pos, asThumbnail, true); } } else { Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255); - CardGui::DrawCard(cardPosition.card, pos, DrawMode::kText, asThumbnail); + CardGui::DrawCard(cardPosition.card, pos, DrawMode::kText, asThumbnail, true); } } else @@ -147,9 +147,10 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail) int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText; Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255); - CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail); + CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true); } - + //the three DrawCard function above, I intentionally disabled the rendered border when in Deck Editor since the border must be dynamically resized + //we can pass variables so the DrawCard method knows what to do to the border but... there must be a better way to do it... int quadAlpha = alpha; if (!deck()->count(cardPosition.card)) quadAlpha /= 2; quadAlpha = 255 - quadAlpha; diff --git a/projects/mtg/src/GameApp.cpp b/projects/mtg/src/GameApp.cpp index 5648b778b..bdc8fbe05 100644 --- a/projects/mtg/src/GameApp.cpp +++ b/projects/mtg/src/GameApp.cpp @@ -39,6 +39,7 @@ bool GameApp::HasMusic = true; JMusic * GameApp::music = NULL; string GameApp::currentMusicFile = ""; string GameApp::systemError = ""; +char GameApp::mynbcardsStr[512] = {0}; vector manaIcons; @@ -173,6 +174,9 @@ void GameApp::Create() LOG("Loading Textures"); LOG("--Loading menuicons.png"); WResourceManager::Instance()->RetrieveTexture("menuicons.png", RETRIEVE_MANAGE); +#if !defined (PSP) + WResourceManager::Instance()->RetrieveTexture("miconslarge.png", RETRIEVE_MANAGE); +#endif LOG("---Gettings menuicons.png quads"); //Load all icons from gModRules and save in manaIcons -> todo. Change the icons positions on menuicons.png to avoid use item->mColorId diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 7eb353859..e87a8084d 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -204,6 +204,8 @@ void GameObserver::nextGamePhase() cleanupPhase(); currentPlayer->damageCount = 0; currentPlayer->drawCounter = 0; + currentPlayer->raidcount = 0; + currentPlayer->opponent()->raidcount = 0; currentPlayer->prowledTypes.clear(); currentPlayer->opponent()->damageCount = 0; //added to clear odcount currentPlayer->preventable = 0; @@ -590,6 +592,25 @@ void GameObserver::gameStateBasedEffects() { if(getCurrentTargetChooser() && int(getCurrentTargetChooser()->getNbTargets()) == getCurrentTargetChooser()->maxtargets) getCurrentTargetChooser()->done = true; + ///////////////////////////////////// + for (int d = 0; d < 2; d++) + { + MTGGameZone * dzones[] = { players[d]->game->inPlay, players[d]->game->graveyard, players[d]->game->hand, players[d]->game->library }; + for (int k = 0; k < 4; k++) + { + MTGGameZone * zone = dzones[k]; + if (mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0) + { + for (int c = zone->nb_cards - 1; c >= 0; c--) + { + zone->cards[c]->cardistargetted = 0; + zone->cards[c]->cardistargetter = 0; + } + } + }//check for losers if its GAMEOVER clear the stack to allow gamestateeffects to continue + players[d]->DeadLifeState(); + } + //////////////////////////////////// if (mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0) return; @@ -608,6 +629,9 @@ void GameObserver::gameStateBasedEffects() for (int j = zone->nb_cards - 1; j >= 0; j--) { MTGCardInstance * card = zone->cards[j]; + card->LKIpower = card->power; + card->LKItoughness = card->toughness; + card->LKIbasicAbilities = card->basicAbilities; card->afterDamage(); card->mPropertiesChangedSinceLastUpdate = false; if(card->hasType(Subtypes::TYPE_PLANESWALKER) && (!card->counters||!card->counters->hasCounter("loyalty",0,0))) @@ -761,7 +785,7 @@ void GameObserver::gameStateBasedEffects() /////////////////////////////////////////////////////////// //life checks/poison checks also checks cant win or lose.// /////////////////////////////////////////////////////////// - players[i]->DeadLifeState();//refactored + players[i]->DeadLifeState(true);//refactored } ////////////////////////////////////////////////////// //-------------card based states effects------------// @@ -824,6 +848,11 @@ void GameObserver::gameStateBasedEffects() } } + if(c->modifiedbAbi > 0) + { + c->modifiedbAbi = 0; + c->basicAbilities = c->origbasicAbilities; + } if(nbcards > z->nb_cards) { t = 0; diff --git a/projects/mtg/src/GameStateMenu.cpp b/projects/mtg/src/GameStateMenu.cpp index b6df5f2f8..0fa693f16 100644 --- a/projects/mtg/src/GameStateMenu.cpp +++ b/projects/mtg/src/GameStateMenu.cpp @@ -85,10 +85,19 @@ void GameStateMenu::Create() { for (int j = 0; j < 2; j++) { +#if defined (PSP) sprintf(buf, "menuicons%d%d", i, j); mIcons[n] = WResourceManager::Instance()->RetrieveQuad("menuicons.png", 2 + i * 36.0f, 2.0f + j * 36.0f, 32.0f, 32.0f, buf); +#else + sprintf(buf, "miconslarge%d%d", i, j); + mIcons[n] = WResourceManager::Instance()->RetrieveQuad("miconslarge.png", 4 + i * 72.0f, 4.0f + j * 72.0f, 72.0f, 72.0f, buf); +#endif if (mIcons[n]) + { + mIcons[n]->mHeight = 36.f; + mIcons[n]->mWidth = 36.f; mIcons[n]->SetHotSpot(16, 16); + } n++; } } @@ -141,10 +150,10 @@ void GameStateMenu::Start() WResourceManager::Instance()->ClearUnlocked(); bgTexture = WResourceManager::Instance()->RetrieveTexture("menutitle.png", RETRIEVE_LOCK); - mBg = WResourceManager::Instance()->RetrieveQuad("menutitle.png", 0, 0, 256, 166); // Create background quad for rendering. + mBg = WResourceManager::Instance()->RetrieveQuad("menutitle.png", 0, 0, 0, 0); // Create background quad for rendering. if (mBg) - mBg->SetHotSpot(128, 50); + mBg->SetHotSpot(0, 0); if (MENU_STATE_MAJOR_MAINMENU == currentState) currentState = currentState | MENU_STATE_MINOR_FADEIN; @@ -160,22 +169,22 @@ void GameStateMenu::genNbCardsStr() PlayerData * playerdata = NEW PlayerData(MTGCollection()); size_t totalUnique = MTGCollection()->primitives.size(); size_t totalPrints = MTGCollection()->totalCards(); - + if (totalUnique != totalPrints) { if (playerdata && !options[Options::ACTIVE_PROFILE].isDefault()) - sprintf(nbcardsStr, _("%s: %i cards (%i) (%i unique)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(), + sprintf(GameApp::mynbcardsStr, _("%s: %i cards (%i) (%i unique)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(), playerdata->collection->totalCards(), totalPrints,totalUnique); else - sprintf(nbcardsStr, _("%i cards (%i unique)").c_str(),totalPrints,totalUnique); + sprintf(GameApp::mynbcardsStr, _("%i cards (%i unique)").c_str(),totalPrints,totalUnique); } else { if (playerdata && !options[Options::ACTIVE_PROFILE].isDefault()) - sprintf(nbcardsStr, _("%s: %i cards (%i)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(), + sprintf(GameApp::mynbcardsStr, _("%s: %i cards (%i)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(), playerdata->collection->totalCards(), totalPrints); else - sprintf(nbcardsStr, _("%i cards").c_str(),totalPrints); + sprintf(GameApp::mynbcardsStr, _("%i cards").c_str(),totalPrints); } SAFE_DELETE(playerdata); @@ -726,7 +735,7 @@ void GameStateMenu::RenderTopMenu() mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); mFont->SetColor(ARGB(128,255,255,255)); mFont->DrawString(GAME_VERSION, rightTextPos, 5, JGETEXT_RIGHT); - mFont->DrawString(nbcardsStr, leftTextPos, 5); + mFont->DrawString(GameApp::mynbcardsStr, leftTextPos, 5); renderer->FillRect(leftTextPos, 26, 104, 8, ARGB(255, 100, 90, 60)); renderer->FillRect(leftTextPos + 2, 28, (float)(gamePercentComplete()), 4, ARGB(255,220,200, 125)); char buf[512]; @@ -790,7 +799,7 @@ void GameStateMenu::Render() scroller->Render(); if (mBg.get()) - renderer->RenderQuad(mBg.get(), SCREEN_WIDTH / 2, 50); + renderer->RenderQuad(mBg.get(), (SCREEN_WIDTH/4)-6, 2, 0, 256 / mBg->mWidth, 166 / mBg->mHeight); RenderTopMenu(); @@ -960,7 +969,6 @@ ostream& GameStateMenu::toString(ostream& out) const << " ; mCreditsYPos : " << mCreditsYPos << " ; currentState : " << currentState << " ; mVolume : " << mVolume - << " ; nbcardsStr : " << nbcardsStr << " ; mCurrentSetName : " << mCurrentSetName << " ; mCurrentSetFileName : " << mCurrentSetFileName << " ; mReadConf : " << mReadConf diff --git a/projects/mtg/src/GameStateOptions.cpp b/projects/mtg/src/GameStateOptions.cpp index 5817744fe..95d4856c9 100644 --- a/projects/mtg/src/GameStateOptions.cpp +++ b/projects/mtg/src/GameStateOptions.cpp @@ -1,6 +1,7 @@ #include "PrecompiledHeader.h" #include "GameStateOptions.h" +#include "GameStateMenu.h" #include "GameApp.h" #include "OptionItem.h" #include "SimpleMenu.h" @@ -167,6 +168,7 @@ void GameStateOptions::Update(float dt) JSoundSystem::GetInstance()->SetMusicVolume(options[Options::MUSICVOLUME].number); mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU); mState = SHOW_OPTIONS; + GameStateMenu::genNbCardsStr(); break; case WGuiBase::CONFIRM_NEED: optionsTabs->yieldFocus(); diff --git a/projects/mtg/src/GameStateShop.cpp b/projects/mtg/src/GameStateShop.cpp index 84ca3f6e4..d7f6f76b5 100644 --- a/projects/mtg/src/GameStateShop.cpp +++ b/projects/mtg/src/GameStateShop.cpp @@ -5,6 +5,7 @@ #include #include "GameStateShop.h" +#include "GameStateMenu.h" #include "GameApp.h" #include "MTGDeck.h" #include "MTGPack.h" @@ -840,6 +841,7 @@ void GameStateShop::ButtonPressed(int controllerId, int controlId) mStage = STAGE_SHOP_SHOP; mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU); save(); + GameStateMenu::genNbCardsStr(); break; case 14: mStage = STAGE_SHOP_TASKS; diff --git a/projects/mtg/src/GuiBackground.cpp b/projects/mtg/src/GuiBackground.cpp index dfcbfe232..fba1877d6 100644 --- a/projects/mtg/src/GuiBackground.cpp +++ b/projects/mtg/src/GuiBackground.cpp @@ -30,6 +30,8 @@ void GuiBackground::Render() } if (quad.get()) { - renderer->RenderQuad(quad.get(), 0, 18); + quad->mWidth = 480.f; + quad->mHeight = 272.f; + renderer->RenderQuad(quad.get(), 0, 0); } } diff --git a/projects/mtg/src/GuiCombat.cpp b/projects/mtg/src/GuiCombat.cpp index 129352d59..ad9a05a98 100644 --- a/projects/mtg/src/GuiCombat.cpp +++ b/projects/mtg/src/GuiCombat.cpp @@ -483,6 +483,8 @@ void GuiCombat::Render() } else { + observer->opponent()->getIcon()->mHeight = 50.f; + observer->opponent()->getIcon()->mWidth = 35.f; observer->opponent()->getIcon()->SetHotSpot(18, 25); enemy_avatar.Render(observer->opponent()->getIcon().get()); } @@ -502,7 +504,7 @@ void GuiCombat::Render() ok_quad->SetHotSpot(28, 22); ok.Render(ok_quad.get()); } - renderer->DrawLine(0, SCREEN_HEIGHT / 2 + 10, SCREEN_WIDTH, SCREEN_HEIGHT / 2 + 10, ARGB(255, 255, 64, 0)); + renderer->DrawLine(0, SCREEN_HEIGHT / 2, SCREEN_WIDTH, SCREEN_HEIGHT / 2, ARGB(255, 255, 64, 0)); if (FIRST_STRIKE == step) { WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); diff --git a/projects/mtg/src/GuiFrame.cpp b/projects/mtg/src/GuiFrame.cpp index e4f764fe9..89f49b64f 100644 --- a/projects/mtg/src/GuiFrame.cpp +++ b/projects/mtg/src/GuiFrame.cpp @@ -6,16 +6,20 @@ GuiFrame::GuiFrame(GameObserver* observer) : GuiLayer(observer) { - if (observer->getResourceManager()) - { - if (observer->getResourceManager()->GetTexture("wood.png")) - wood = observer->getResourceManager()->RetrieveQuad("wood.png", 0, 0, SCREEN_WIDTH, 28); + //if (observer->getResourceManager()) + //{ + /*if (observer->getResourceManager()->GetTexture("wood.png")) + { + wood = observer->getResourceManager()->RetrieveQuad("wood.png", 0, 0, 0, 0); + wood->mHeight = 32.f; + wood->mWidth = 480.f; + } else { GameApp::systemError += "Can't load wood texture : " __FILE__ "\n"; - } + }*/ - if (observer->getResourceManager()->GetTexture("gold.png")) + /*if (observer->getResourceManager()->GetTexture("gold.png")) { gold1 = observer->getResourceManager()->RetrieveQuad("gold.png", 0, 0, SCREEN_WIDTH, 6, "gold1"); gold2 = observer->getResourceManager()->RetrieveQuad("gold.png", 0, 6, SCREEN_WIDTH, 6, "gold2"); @@ -26,9 +30,9 @@ GuiFrame::GuiFrame(GameObserver* observer) gold2->SetColor(ARGB(127, 255, 255, 255)); gold2->SetHFlip(true); } - } - } - step = 0.0; + }*/ + //} + //step = 0.0; } @@ -38,12 +42,12 @@ GuiFrame::~GuiFrame() void GuiFrame::Render() { - JRenderer* renderer = JRenderer::GetInstance(); + /*JRenderer* renderer = JRenderer::GetInstance(); float sized = step / 4; if (sized > SCREEN_WIDTH) sized -= SCREEN_WIDTH; - renderer->RenderQuad(wood.get(), 0, 0); - if (gold1.get()) + renderer->RenderQuad(wood.get(), 0, 0);*/ + /*if (gold1.get()) { renderer->RenderQuad(gold1.get(), -sized, 16); renderer->RenderQuad(gold1.get(), -sized + 479, 16); @@ -60,12 +64,12 @@ void GuiFrame::Render() renderer->RenderQuad(gold2.get(), step / 2, 16); renderer->RenderQuad(gold2.get(), step / 2 - 479, 16); } - } + }*/ } void GuiFrame::Update(float dt) { - step += dt * 5; + /*step += dt * 5; if (step > 2 * SCREEN_WIDTH) - step -= 2 * SCREEN_WIDTH; + step -= 2 * SCREEN_WIDTH;*/ } diff --git a/projects/mtg/src/GuiMana.cpp b/projects/mtg/src/GuiMana.cpp index c4ca3d257..e5ab1145c 100644 --- a/projects/mtg/src/GuiMana.cpp +++ b/projects/mtg/src/GuiMana.cpp @@ -262,7 +262,7 @@ void GuiMana::RenderStatic() float x0 = x - 20 * totalColors; x0 = max(40.f, x0); float xEnd = x0 + 20 * totalColors; - r->FillRoundRect(x0, y - 5, static_cast (20 * totalColors + 5), 20, 2, ARGB(128,0,0,0)); + r->FillRoundRect(x0, y - 8, static_cast (20 * totalColors + 5), 20, 2, ARGB(128,0,0,0)); int offset = 0; for (int i = 0; i < Constants::NB_Colors; ++i) @@ -270,10 +270,10 @@ void GuiMana::RenderStatic() if (values[i]) { offset -= 20; - r->RenderQuad(manaIcons[i].get(), xEnd + 15 + offset, y + 5, 0, 0.7f, 0.7f); + r->RenderQuad(manaIcons[i].get(), xEnd + 15 + offset, y + 3, 0, 0.65f, 0.65f); } } - r->FillRoundRect(x0, y, static_cast (20 * totalColors + 5), 8, 2, ARGB(100,0,0,0)); + //r->DrawRoundRect(x0, y - 8, static_cast (20 * totalColors + 5), 20, 2, ARGB(128,255,255,255)); offset = 0; for (int i = 0; i < Constants::NB_Colors; ++i) { @@ -283,7 +283,7 @@ void GuiMana::RenderStatic() char buf[4]; sprintf(buf, "%i", values[i]); mFont->SetColor(ARGB(255,255,255,255)); - mFont->DrawString(buf, xEnd + offset + 9, y); + mFont->DrawString(buf, xEnd + offset + 18, y + 5); } } } diff --git a/projects/mtg/src/GuiPhaseBar.cpp b/projects/mtg/src/GuiPhaseBar.cpp index f782c6518..7d774f44a 100644 --- a/projects/mtg/src/GuiPhaseBar.cpp +++ b/projects/mtg/src/GuiPhaseBar.cpp @@ -24,7 +24,7 @@ }; */ -const float GuiPhaseBar::zoom_big = (float)(1.5 * 1.4); +const float GuiPhaseBar::zoom_big = (float)(1.5 * 1.25); const float GuiPhaseBar::zoom_small = 1.5; const float GuiPhaseBar::step = M_PI/6.0f; @@ -36,9 +36,9 @@ namespace const unsigned kPhases = NB_MTG_PHASES - 2; //there are two phases we do not show } -void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale) +void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale, float z) { - inQuad->SetTextureRect(phaseId * (kWidth + 1), 0, kWidth, kHeight); + inQuad->SetTextureRect(phaseId * (kWidth + 1), z, kWidth, kHeight); JRenderer::GetInstance()->RenderQuad(inQuad, x, y - scale * kWidth/2, 0.0f, scale, scale); } @@ -110,7 +110,10 @@ void GuiPhaseBar::Render() //hint: sin(circPos + PI/2) = cos(circPos) const float glyphScale = float(zoomFactor * cosf(circPos) * 0.5f); - DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale); + if (observer->currentPlayer && observer->currentPlayer->isAI() && !observer->currentPlayer->opponent()->isAI()) + DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale, 29); + else + DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale, 0); } //print phase name diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index 4fdc1fde4..eee380023 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -106,7 +106,7 @@ GuiPlay::BattleField::BattleField() : attackers(0), height(0.0), red(0), colorFlow(0) { } -const float GuiPlay::BattleField::HEIGHT = 80.0f; +const float GuiPlay::BattleField::HEIGHT = 146.0f; void GuiPlay::BattleField::addAttacker(MTGCardInstance*) { ++attackers; @@ -160,7 +160,11 @@ void GuiPlay::BattleField::Update(float dt) void GuiPlay::BattleField::Render() { if (height > 3) - JRenderer::GetInstance()->FillRect(44, SCREEN_HEIGHT / 2 + 10 - height / 2, 318, height, ARGB(127, red, 0, 0)); + { + JRenderer::GetInstance()->FillRect(0, SCREEN_HEIGHT / 2 + 8.5f - height / 2, 480, height, ARGB(127, red, 0, 0)); + if(red > 1) + JRenderer::GetInstance()->DrawRect(-2, SCREEN_HEIGHT / 2 + 8.5f - height / 2, 484, height, ARGB(255, 255, 165, 0)); + } } GuiPlay::GuiPlay(DuelLayers* view) : @@ -270,7 +274,7 @@ void GuiPlay::Replace() //rerun the iter reattaching planes walkers to the back of the lands. for (iterator it = end_spells; it != cards.end(); ++it) { - if ((*it)->card->hasType(Subtypes::TYPE_PLANESWALKER)) + if ((*it)->card->hasType(Subtypes::TYPE_PLANESWALKER) && !(*it)->card->isCreature()) { if (mpDuelLayers->getRenderedPlayer() == (*it)->card->controller()) selfLands.Enstack(*it); @@ -408,6 +412,8 @@ int GuiPlay::receiveEventPlus(WEvent * e) Replace(); else if (dynamic_cast (e)) Replace(); + else if (dynamic_cast (e)) + Replace(); Replace(); return 0; } diff --git a/projects/mtg/src/GuiStatic.cpp b/projects/mtg/src/GuiStatic.cpp index 4269577c9..28e00ec2d 100644 --- a/projects/mtg/src/GuiStatic.cpp +++ b/projects/mtg/src/GuiStatic.cpp @@ -60,8 +60,8 @@ void GuiAvatar::Render() { if (corner == BOTTOM_RIGHT) { - x0 -= player->getIcon()->mWidth * actZ; - y0 -= player->getIcon()->mHeight * actZ; + x0 -= Width * actZ; + y0 -= Height * actZ; } switch (corner) { @@ -69,14 +69,14 @@ void GuiAvatar::Render() player->getIcon()->SetHotSpot(0, 0); break; case BOTTOM_RIGHT: - player->getIcon()->SetHotSpot(35, 50); + player->getIcon()->SetHotSpot(player->getIcon()->mWidth, player->getIcon()->mHeight); break; } player->getIcon()->SetColor(ARGB((int)actA, 255, avatarRed, avatarRed)); - r->RenderQuad(player->getIcon().get(), actX, actY, actT, actZ, actZ); + r->RenderQuad(player->getIcon().get(), actX, actY, actT, Width/player->getIcon()->mWidth*actZ, Height/player->getIcon()->mHeight*actZ); if (mHasFocus) { - r->FillRect(x0, x0, player->getIcon()->mWidth * actZ, player->getIcon()->mHeight * actZ, ARGB(abs(128 - wave),255,255,255)); + r->FillRect(x0, x0, Width/player->getIcon()->mWidth * actZ, Height/player->getIcon()->mHeight * actZ, ARGB(abs(128 - wave),255,255,255)); } } @@ -96,18 +96,29 @@ void GuiAvatar::Render() //Life char buffer[10]; + int lx = 255, ly = 255, lz = 255; + if(life > 24) { lx = 127; ly = 255; lz = 212; } + if(life > 16 && life < 24) { lx = 255; ly = 255; lz = 255; } + if(life > 12 && life < 17) { lx = 255; ly = 255; lz = 105; } + if(life > 8 && life < 13) { lx = 255; ly = 255; lz = 13; } + if(life > 4 && life < 9) { lx = 255; ly = 166; lz = 0; } + if(life < 5) { lx = 255; ly = 40; lz = 0; } sprintf(buffer, "%i", life); switch (corner) { case TOP_LEFT: mFont->SetColor(ARGB((int)actA / 4, 0, 0, 0)); mFont->DrawString(buffer, actX + 2, actY + 2); - mFont->SetColor(ARGB((int)actA, 255, 255, 255)); + mFont->SetScale(1.3f); + mFont->SetColor(ARGB((int)actA, lx, ly, lz)); mFont->DrawString(buffer, actX + 1, actY + 1); + mFont->SetScale(1); break; case BOTTOM_RIGHT: - mFont->SetColor(ARGB((int)actA, 255, 255, 255)); - mFont->DrawString(buffer, actX, actY - 10, JGETEXT_RIGHT); + mFont->SetScale(1.3f); + mFont->SetColor(ARGB((int)actA, lx, ly, lz)); + mFont->DrawString(buffer, actX, actY - 14, JGETEXT_RIGHT); + mFont->SetScale(1); break; } //poison diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 122553f4e..92007d42a 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -411,6 +411,20 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe } } + check = restriction[i].find("discarded"); + if(check != string::npos) + { + if(!card->discarded) + return 0; + } + + check = restriction[i].find("raid"); + if(check != string::npos) + { + if(card->controller()->raidcount < 1) + return 0; + } + check = restriction[i].find("ownerscontrol"); if(check != string::npos) { @@ -811,7 +825,16 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell attackingTrigger,attackedAloneTrigger,notBlockedTrigger,attackBlockedTrigger,blockingTrigger); } - //Card card is drawn + + //drawn player - controller of card - dynamic version drawof(player) -> returns current controller even with exchange of card controller + if (TargetChooser * tc = parseSimpleTC(s, "drawof", card)) + return NEW TrcardDrawn(observer, id, card, tc,once,true,false); + + //drawn player - opponent of card controller - dynamic version drawfoeof(player) -> returns current opponent even with exchange of card controller + if (TargetChooser * tc = parseSimpleTC(s, "drawfoeof", card)) + return NEW TrcardDrawn(observer, id, card, tc,once,false,true); + + //Card card is drawn - static version - drawn(player) - any player; drawn(controller) - owner forever; drawn(opponent) - opponent forever if (TargetChooser * tc = parseSimpleTC(s, "drawn", card)) return NEW TrcardDrawn(observer, id, card, tc,once); @@ -827,35 +850,105 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell if (TargetChooser * tc = parseSimpleTC(s, "cycled", card)) return NEW TrCardDiscarded(observer, id, card, tc,once,true); - //Card Damaging non combat + //Card Damaging non combat current controller + if (TargetChooser * tc = parseSimpleTC(s, "noncombatdamageof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrDamaged(observer, id, card, tc, fromTc, 2,false,false,once,true,false); + } + + //Card Damaging non combat current opponent + if (TargetChooser * tc = parseSimpleTC(s, "noncombatdamagefoeof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrDamaged(observer, id, card, tc, fromTc, 2,false,false,once,false,true); + } + + //Card Damaging non combat static if (TargetChooser * tc = parseSimpleTC(s, "noncombatdamaged", card)) { TargetChooser *fromTc = parseSimpleTC(s, "from", card); return NEW TrDamaged(observer, id, card, tc, fromTc, 2,once); } - //Card Damaging combat + //Card Damaging combat current controller + if (TargetChooser * tc = parseSimpleTC(s, "combatdamageof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrDamaged(observer, id, card, tc, fromTc, 1,sourceUntapped,limitOnceATurn,once,true,false); + } + + //Card Damaging combat current opponent + if (TargetChooser * tc = parseSimpleTC(s, "combatdamagefoeof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrDamaged(observer, id, card, tc, fromTc, 1,sourceUntapped,limitOnceATurn,once,false,true); + } + + //Card Damaging combat static if (TargetChooser * tc = parseSimpleTC(s, "combatdamaged", card)) { TargetChooser *fromTc = parseSimpleTC(s, "from", card); return NEW TrDamaged(observer, id, card, tc, fromTc, 1,sourceUntapped,limitOnceATurn,once); } - //Card Damaging + //Card Damaging current controller + if (TargetChooser * tc = parseSimpleTC(s, "damageof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrDamaged(observer, id, card, tc, fromTc, 0,sourceUntapped,limitOnceATurn,once,true,false); + } + + //Card Damaging current opponent + if (TargetChooser * tc = parseSimpleTC(s, "damagefoeof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrDamaged(observer, id, card, tc, fromTc, 0,sourceUntapped,limitOnceATurn,once,false,true); + } + + //Card Damaging static if (TargetChooser * tc = parseSimpleTC(s, "damaged", card)) { TargetChooser *fromTc = parseSimpleTC(s, "from", card); return NEW TrDamaged(observer, id, card, tc, fromTc, 0,sourceUntapped,limitOnceATurn,once); } - //Lifed + //Lifed current controller + if (TargetChooser * tc = parseSimpleTC(s, "lifeof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrLifeGained(observer, id, card, tc, fromTc, 0,sourceUntapped,once,true,false); + } + + //Lifed current opponent + if (TargetChooser * tc = parseSimpleTC(s, "lifefoeof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrLifeGained(observer, id, card, tc, fromTc, 0,sourceUntapped,once,false,true); + } + + //Lifed static if (TargetChooser * tc = parseSimpleTC(s, "lifed", card)) { TargetChooser *fromTc = parseSimpleTC(s, "from", card); return NEW TrLifeGained(observer, id, card, tc, fromTc, 0,sourceUntapped,once); } - //Life Loss + //Life Loss current player + if (TargetChooser * tc = parseSimpleTC(s, "lifelostof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrLifeGained(observer, id, card, tc, fromTc,1,sourceUntapped,once,true,false); + } + + //Life Loss current opponent + if (TargetChooser * tc = parseSimpleTC(s, "lifelostfoeof", card)) + { + TargetChooser *fromTc = parseSimpleTC(s, "from", card); + return NEW TrLifeGained(observer, id, card, tc, fromTc,1,sourceUntapped,once,false,true); + } + + //Life Loss static if (TargetChooser * tc = parseSimpleTC(s, "lifeloss", card)) { TargetChooser *fromTc = parseSimpleTC(s, "from", card); @@ -2652,6 +2745,24 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return NEW AEvolveAbility(observer, id, card); } + //produce additional mana when tapped for mana + if (s.find("produceextra:") != string::npos) + { + return NEW AProduceMana(observer, id, card,s.substr(13)); + } + + //produce additional mana when a mana is engaged + if (s.find("producecolor:") != string::npos) + { + return NEW AEngagedManaAbility(observer, id, card,s.substr(13)); + } + + //reducelife to specific value + if (s.find("reduceto:") != string::npos) + { + return NEW AReduceToAbility(observer, id, card,s.substr(9)); + } + //flanking if (s.find("flanker") != string::npos) { @@ -3083,7 +3194,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return a; } - //get a new target + //get a new target - retarget and newtarget makes the card refreshed - from exile to play... if ((s.find("retarget") != string::npos) || s.find("newtarget") != string::npos) { MTGAbility * a = NEW AANewTarget(observer, id, card,target, (s.find("retarget") != string::npos)); @@ -3091,6 +3202,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return a; } + //get a new target for puresteel paladin...etc for equipments inplay only.. newhook & rehook supports stone hewer basic... the card is reequipped + if ((s.find("rehook") != string::npos) || s.find("newhook") != string::npos) + { + MTGAbility * a = NEW AANewTarget(observer, id, card,target, false,NULL,true,(s.find("newhook") != string::npos)); + a->oneShot = 1; + return a; + } + //morph found = s.find("morph"); if (found != string::npos) @@ -3542,6 +3661,9 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ badAbilities[(int)Constants::WEAK] = true; badAbilities[(int)Constants::NOLIFEGAIN] = true; badAbilities[(int)Constants::NOLIFEGAINOPPONENT] = true; + badAbilities[(int)Constants::CANTLOSE] = false; + badAbilities[(int)Constants::CANTLIFELOSE] = false; + badAbilities[(int)Constants::CANTMILLLOSE] = false; if (AInstantBasicAbilityModifierUntilEOT * abi = dynamic_cast(a)) { @@ -4249,7 +4371,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell) if (current->hasType(Subtypes::TYPE_CREATURE)) { card->controller()->game->putInGraveyard(current); - damage += current->power; + damage += current->getCurrentPower(); } } observer->mLayers->stackLayer()->addDamage(card, target, damage); @@ -4578,6 +4700,8 @@ int ActivatedAbility::isReactingToClick(MTGCardInstance * card, ManaCost * mana) return 0; if (cPhase != MTG_PHASE_FIRSTMAIN && cPhase != MTG_PHASE_SECONDMAIN) return 0; + if (player->opponent()->getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0||game->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0||player->getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0) + return 0; break; } if (restrictions >= MY_BEFORE_BEGIN && restrictions <= MY_AFTER_EOT) @@ -5000,30 +5124,6 @@ int TriggeredAbility::receiveEvent(WEvent * e) resolve(); return 1; } - if(dynamic_cast(e)) - { - //check life state on life triger - WEventLife * lifecheck = dynamic_cast(e); - if (lifecheck->player->DeadLifeState()) - { - return 0; - } - fireAbility(); - return 1; - } - if(dynamic_cast(e)) - { - //check life state on damage trigger - WEventDamage * lifecheck = dynamic_cast(e); - if (lifecheck->damage->target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER) - { - Player * triggerPlayer = (Player *) lifecheck->damage->target; - if(triggerPlayer->DeadLifeState()) - return 0; - } - fireAbility(); - return 1; - } WEventZoneChange * stackCheck = dynamic_cast(e); if(stackCheck && (stackCheck->to == game->currentPlayer->game->stack||stackCheck->to == game->currentPlayer->opponent()->game->stack)) { diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index b40c368e4..140c4f5cf 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -58,6 +58,13 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to isSwitchedPT = false; isACopier = false; bypassTC = false; + discarded = false; + copiedID = getId(); + modifiedbAbi = 0; + LKIpower = power; + LKItoughness = toughness; + cardistargetted = 0; + cardistargetter = 0; } MTGCardInstance * MTGCardInstance::createSnapShot() @@ -75,6 +82,8 @@ void MTGCardInstance::copy(MTGCardInstance * card) CardPrimitive * data = source->data; basicAbilities = card->basicAbilities; + origbasicAbilities = card->origbasicAbilities; + modifiedbAbi = card->modifiedbAbi; for (size_t i = 0; i < data->types.size(); i++) { types.push_back(data->types[i]); @@ -574,11 +583,13 @@ Player * MTGCardInstance::controller() int MTGCardInstance::canAttack() { + if (basicAbilities[(int)Constants::CANTATTACK]) + return 0; if (tapped) return 0; if (hasSummoningSickness()) return 0; - if ((basicAbilities[(int)Constants::DEFENSER] || basicAbilities[(int)Constants::CANTATTACK]) && !basicAbilities[(int)Constants::CANATTACK]) + if (basicAbilities[(int)Constants::DEFENSER] && !basicAbilities[(int)Constants::CANATTACK]) return 0; if (!isCreature()) return 0; @@ -718,6 +729,84 @@ void MTGCardInstance::switchPT(bool apply) } } +int MTGCardInstance::getCurrentPower() +{ + if(!isInPlay(observer)) + return LKIpower; + return power; +} + +int MTGCardInstance::getCurrentToughness() +{ + if(!isInPlay(observer)) + return LKItoughness; + return toughness; +} + +//check stack +bool MTGCardInstance::StackIsEmptyandSorcerySpeed() +{ + if((getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0) && + (getObserver()->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || + getObserver()->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN) && + controller() == getObserver()->currentPlayer && + !getObserver()->isInterrupting) + { + return true; + } + return false; +} + +//check targetted? +bool MTGCardInstance::isTargetted() +{ + if(getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0) + { + ActionStack * stack = observer->mLayers->stackLayer(); + for (int i = stack->mObjects.size() - 1; i >= 0; i--) + { + Interruptible * current = ((Interruptible *) stack->mObjects[i]); + if ((current->type == ACTION_SPELL || current->type == ACTION_ABILITY) && current->state == NOT_RESOLVED) + { + if(current->type == ACTION_SPELL) + { + Spell * spell = (Spell *) current; + if(spell->getNextTarget() && spell->getNextTarget() == (Targetable*)this) + return true; + } + } + } + } + if(cardistargetted) + return true; + return false; +} + +//check targetter? +bool MTGCardInstance::isTargetter() +{ + if(getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0) + { + ActionStack * stack = observer->mLayers->stackLayer(); + for (int i = stack->mObjects.size() - 1; i >= 0; i--) + { + Interruptible * current = ((Interruptible *) stack->mObjects[i]); + if ((current->type == ACTION_SPELL || current->type == ACTION_ABILITY) && current->state == NOT_RESOLVED) + { + if(current->type == ACTION_SPELL) + { + Spell * spell = (Spell *) current; + if(spell && spell->source == this) + return true; + } + } + } + } + if(cardistargetter) + return true; + return false; +} + int MTGCardInstance::canBlock() { if (tapped) diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index ba7362fbb..0dd76ef59 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -143,7 +143,11 @@ const char* Constants::MTGBasicAbilities[] = { "spellmastery", "nolifegain", "nolifegainopponent", - "auraward" + "auraward", + "madness", + "protectionfromcoloredspells", + "mygcreatureexiler", + "oppgcreatureexiler" }; map Constants::MTGBasicAbilitiesMap; diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 04dd8d629..4cea41c66 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -322,9 +322,19 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone int doCopy = 1; bool shufflelibrary = card->basicAbilities[(int)Constants::SHUFFLELIBRARYDEATH]; + bool inplaytoinplay = false; bool ripToken = false; if (g->players[0]->game->battlefield->hasName("Rest in Peace")||g->players[1]->game->battlefield->hasName("Rest in Peace")) ripToken = true; + //Madness or Put in Play... + for(int i = 0; i < 2; ++i) + { + if (card->discarded && (to == g->players[i]->game->graveyard) && (from == g->players[i]->game->hand)) + { + if(card->basicAbilities[(int)Constants::MADNESS]) + to = g->players[i]->game->exile; + } + } //Darksteel Colossus, Legacy Weapon ... top priority since we replace destination directly automatically... for(int i = 0; i < 2; ++i) { @@ -339,6 +349,8 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone for(int i = 0; i < 2; ++i) { if ((to == g->players[i]->game->graveyard) && ( + (g->players[i]->game->battlefield->hasAbility(Constants::MYGCREATUREEXILER) && card->isCreature()) || + (g->players[i]->opponent()->game->battlefield->hasAbility(Constants::OPPGCREATUREEXILER) && card->isCreature())|| g->players[i]->game->battlefield->hasAbility(Constants::MYGRAVEEXILER) || g->players[i]->opponent()->game->battlefield->hasAbility(Constants::OPPGRAVEEXILER))) { @@ -353,6 +365,8 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone == g->players[1]->game->inPlay)) { doCopy = 0; + asCopy = true;//don't send zone change event so it will not destroy the GUI when multiple switching of control... + inplaytoinplay = true;//try sending different event... } if (!(copy = from->removeCard(card, doCopy))) @@ -361,6 +375,13 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone { copy->miracle = true; } + if (card->discarded) + {//set discarded for madness... + if(from == g->players[0]->game->hand || from == g->players[1]->game->hand) + copy->discarded = true; + else//turn off discarded if its previous zone is not in hand... + copy->discarded = false; + } if (options[Options::SFXVOLUME].number > 0) { if (to == g->players[0]->game->graveyard || to == g->players[1]->game->graveyard) @@ -417,6 +438,11 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone WEvent * e = NEW WEventZoneChange(copy, from, to); g->receiveEvent(e); } + if(inplaytoinplay) + { + WEvent * ep = NEW WEventCardControllerChange(copy); + g->receiveEvent(ep); + } return ret; } @@ -748,6 +774,18 @@ bool MTGGameZone::hasAbility(int ability) return false; } +bool MTGGameZone::hasAlias(int alias) +{ + for (int i = 0; i < (nb_cards); i++) + { + if (cards[i]->alias == alias) + { + return true; + } + } + return false; +} + int MTGGameZone::seenThisTurn(TargetChooser * tc, int castMethod, bool lastTurn) { //The following 2 lines modify the passed TargetChooser. Call this function with care :/ diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index b58090b21..458e63789 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -284,7 +284,6 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost *) { int cardsinhand = game->players[0]->game->hand->nb_cards; Player * player = game->currentlyActing(); - Player * currentPlayer = game->currentPlayer; if (!player->game->hand->hasCard(card)) return 0; if ((game->turn < 1) && (cardsinhand != 0) && (card->basicAbilities[(int)Constants::LEYLINE]) @@ -310,18 +309,12 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost *) { if (game->currentActionPlayer->game->playRestrictions->canPutIntoZone(card, game->currentActionPlayer->game->inPlay) == PlayRestriction::CANT_PLAY) return 0; - if (player == currentPlayer - && (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN) - ) - { + if (card->StackIsEmptyandSorcerySpeed()) return 1; - } + else + return 0; } - else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) - || (player == card->controller() && !game->isInterrupting - && (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN - || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN)) - ) + else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (card->StackIsEmptyandSorcerySpeed())) { if(card->controller()->epic) return 0; @@ -631,7 +624,6 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *, ManaCost *alternateManaCost) { Player * player = game->currentlyActing(); - Player * currentPlayer = game->currentPlayer; if (!alternateManaCost) return 0; @@ -645,17 +637,12 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * { if (game->currentActionPlayer->game->playRestrictions->canPutIntoZone(card, game->currentActionPlayer->game->inPlay) == PlayRestriction::CANT_PLAY) return 0; - if (player == currentPlayer - && (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN - || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN) - ) + if (card->StackIsEmptyandSorcerySpeed()) return 1; + else + return 0; } - else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::SPELLMASTERY) || card->has(Constants::OFFERING) - || (player == card->controller() && !game->isInterrupting - && (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN - || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN)) - ) + else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::SPELLMASTERY) || card->has(Constants::OFFERING) || (card->StackIsEmptyandSorcerySpeed())) { if(card->controller()->epic) return 0; @@ -1042,11 +1029,7 @@ int MTGMorphCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *) if(card->controller()->epic)//zoetic cavern... morph is casted for a cost... return 0; //note lands can morph too, this is different from other cost types. - if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (player == card->controller() - && !game->isInterrupting - && (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN - || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN)) - ) + if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (card->StackIsEmptyandSorcerySpeed())) { if (card->controller()->game->playRestrictions->canPutIntoZone(card, card->controller()->game->stack) == PlayRestriction::CANT_PLAY) return 0; @@ -1415,6 +1398,7 @@ int MTGCombatTriggersRule::receiveEvent(WEvent *e) if (card && card->isAttacker()) { card->eventattacked(); + card->controller()->raidcount += 1; } } } @@ -2293,6 +2277,10 @@ int MTGPersistRule::receiveEvent(WEvent * event) if (e->from == p->game->inPlay) ok = 1; } + if (card->owner->game->battlefield->hasAbility(Constants::MYGRAVEEXILER)||card->owner->opponent()->game->battlefield->hasAbility(Constants::OPPGRAVEEXILER)) + ok = 0; + if ((card->owner->game->battlefield->hasAbility(Constants::MYGCREATUREEXILER)||card->owner->opponent()->game->battlefield->hasAbility(Constants::OPPGCREATUREEXILER))&&(card->isCreature())) + ok = 0; if (!ok) return 0; @@ -2301,19 +2289,28 @@ int MTGPersistRule::receiveEvent(WEvent * event) Player * p = game->players[i]; if (e->to == p->game->graveyard) { - MTGCardInstance * copy = p->game->putInZone(e->card, p->game->graveyard, e->card->owner->game->temp); + MTGCardInstance * copy = e->card; if (!copy) { DebugTrace("MTGRULES: couldn't move card for persist/undying"); return 0; } - Spell * spell = NEW Spell(game, copy); - spell->resolve(); + string code = ""; + bool persist = false; + bool undying = false; if(card->basicAbilities[(int)Constants::PERSIST]) - spell->source->counters->addCounter(-1, -1); + { + code = "Persist"; + persist = true; + } else - spell->source->counters->addCounter(1,1); - delete spell; + { + code = "Undying"; + undying = true; + } + AAMover *putinplay = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), copy, copy,"ownerbattlefield",code,NULL,undying,persist); + putinplay->oneShot = true; + putinplay->fireAbility(); return 1; } } @@ -2535,20 +2532,18 @@ int MTGLegendRule::added(MTGCardInstance * card) MultiAbility * multi = NEW MultiAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card, NULL); for(unsigned int i = 0;i < oldCards.size();i++) { - AABuryCard *a = NEW AABuryCard(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i]); - a->menu = "Keep New"; + AAMover *a = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New"); a->oneShot = true; multi->Add(a); } multi->oneShot = 1; MTGAbility * a1 = multi; selection.push_back(a1); - AABuryCard *b = NEW AABuryCard(game, game->mLayers->actionLayer()->getMaxId(), card, card); - b->menu = "Keep Old"; + AAMover *b = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old"); b->oneShot = true; MTGAbility * b1 = b; selection.push_back(b1); - MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Choose Legend"); + MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule"); menuChoice->addToGame(); } return 1; @@ -2612,20 +2607,18 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card) MultiAbility * multi = NEW MultiAbility(game,game->mLayers->actionLayer()->getMaxId(), card, card, NULL); for(unsigned int i = 0;i < oldCards.size();i++) { - AABuryCard *a = NEW AABuryCard(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i]); - a->menu = "Keep New"; + AAMover *a = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New"); a->oneShot = true; multi->Add(a); } multi->oneShot = 1; MTGAbility * a1 = multi; selection.push_back(a1); - AABuryCard *b = NEW AABuryCard(game, game->mLayers->actionLayer()->getMaxId(), card, card); - b->menu = "Keep Old"; + AAMover *b = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old"); b->oneShot = true; MTGAbility * b1 = b; selection.push_back(b1); - MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Choose Planeswalker"); + MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Planeswalker Rule"); menuChoice->addToGame(); } return 1; @@ -2707,7 +2700,7 @@ int MTGLifelinkRule::receiveEvent(WEvent * event) WEventDamage * e = (WEventDamage *) event; Damage * d = e->damage; MTGCardInstance * card = d->source; - if (d->damage > 0 && card && card->basicAbilities[(int)Constants::LIFELINK]) + if (d->damage > 0 && card && (card->basicAbilities[(int)Constants::LIFELINK]||card->LKIbasicAbilities[(int)Constants::LIFELINK])) { card->controller()->gainLife(d->damage); return 1; @@ -2751,7 +2744,7 @@ int MTGDeathtouchRule::receiveEvent(WEvent * event) return 0; MTGCardInstance * _target = (MTGCardInstance *) (d->target); - if (card->basicAbilities[(int)Constants::DEATHTOUCH]) + if (card->basicAbilities[(int)Constants::DEATHTOUCH]||card->LKIbasicAbilities[(int)Constants::DEATHTOUCH]) { _target->destroy(); return 1; diff --git a/projects/mtg/src/Player.cpp b/projects/mtg/src/Player.cpp index 52d0e311b..cd1a2c77a 100644 --- a/projects/mtg/src/Player.cpp +++ b/projects/mtg/src/Player.cpp @@ -34,6 +34,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck * extraTurn = 0; drawCounter = 0; epic = 0; + raidcount = 0; prowledTypes.clear(); doesntEmpty = NEW ManaCost(); poolDoesntEmpty = NEW ManaCost(); @@ -89,7 +90,7 @@ bool Player::loadAvatar(string file, string resName) } mAvatarTex = rm->RetrieveTexture(file, RETRIEVE_LOCK, TEXTURE_SUB_AVATAR); if (mAvatarTex) { - mAvatar = rm->RetrieveQuad(file, 0, 0, 35, 50, resName, RETRIEVE_NORMAL, TEXTURE_SUB_AVATAR); + mAvatar = rm->RetrieveQuad(file, 0, 0, 0, 0, resName, RETRIEVE_NORMAL, TEXTURE_SUB_AVATAR); return true; } @@ -236,7 +237,7 @@ void Player::serumMulligan() //Draw hand no penalty } -bool Player::DeadLifeState() +bool Player::DeadLifeState(bool check) { if ((life <= 0)||(poisonCount >= 10)) { @@ -263,7 +264,21 @@ bool Player::DeadLifeState() } if (cantlosers < 1) { - getObserver()->setLoser(this); + if(!check) + { + ActionStack * stack = getObserver()->mLayers->stackLayer(); + for (int i = stack->mObjects.size() - 1; i >= 0; i--) + { + Interruptible * current = ((Interruptible *) stack->mObjects[i]); + Spell * spell = (Spell *) current; + if (current->type == ACTION_SPELL) + spell->source->controller()->game->putInGraveyard(spell->source); + + current->state = RESOLVED_NOK; + } + } + if(check) + game->owner->getObserver()->setLoser(this); return true; } } diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index 4191f1f7b..9d58f058d 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -859,6 +859,11 @@ bool TargetChooser::canTarget(Targetable * target, bool withoutProtections) if (card->protectedAgainst(targetter)) return targetter->bypassTC; if (card->CantBeTargetby(targetter)) return targetter->bypassTC; if ((targetter->controller() != card->controller()) && card->has(Constants::OPPONENTSHROUD)) return targetter->bypassTC; + if (card->has(Constants::PROTECTIONFROMCOLOREDSPELLS)) + {//a spell that has no target=criteria means it's not targetted unless its a workaround card... + if((targetter->spellTargetType.size()) && (targetter->hasColor(1)||targetter->hasColor(2)||targetter->hasColor(3)||targetter->hasColor(4)||targetter->hasColor(5))) + return targetter->bypassTC; + } } return true; } diff --git a/projects/mtg/src/WEvent.cpp b/projects/mtg/src/WEvent.cpp index df09f764c..4b1db1029 100644 --- a/projects/mtg/src/WEvent.cpp +++ b/projects/mtg/src/WEvent.cpp @@ -106,6 +106,7 @@ WEventCardSacrifice::WEventCardSacrifice(MTGCardInstance * card, MTGCardInstance WEventCardDiscard::WEventCardDiscard(MTGCardInstance * card) : WEventCardUpdate(card) { + card->discarded = true; } WEventCardCycle::WEventCardCycle(MTGCardInstance * card) : @@ -121,6 +122,8 @@ WEventVampire::WEventVampire(MTGCardInstance * card,MTGCardInstance * source,MTG WEventTarget::WEventTarget(MTGCardInstance * card,MTGCardInstance * source) : WEventCardUpdate(card),card(card),source(source) { + card->cardistargetted = 1; + source->cardistargetter = 1; } WEventCardChangeType::WEventCardChangeType(MTGCardInstance * card, int type, bool before, bool after) : @@ -162,6 +165,11 @@ WEventCardUnattached::WEventCardUnattached(MTGCardInstance * card) : { } +WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) : + WEventCardUpdate(card) +{ +} + WEventCombatStepChange::WEventCombatStepChange(CombatStep step) : WEvent(), step(step) { @@ -316,6 +324,12 @@ Targetable * WEventCardUnattached::getTarget(int target) return NULL; } +Targetable * WEventCardControllerChange::getTarget(int target) +{ + if (target) return card; + return NULL; +} + std::ostream& WEvent::toString(std::ostream& out) const { return out << "EVENT";