diff --git a/projects/mtg/bin/Res/sets/LTC/_cards.dat b/projects/mtg/bin/Res/sets/LTC/_cards.dat index abdb813d8..e74aae61c 100644 --- a/projects/mtg/bin/Res/sets/LTC/_cards.dat +++ b/projects/mtg/bin/Res/sets/LTC/_cards.dat @@ -374,7 +374,6 @@ primitive=Elf Warrior id=-112876 rarity=T [/card] -[/card] [card] primitive=Treefolk Syl id=-11287610 diff --git a/projects/mtg/bin/Res/sets/SIR/_cards.dat b/projects/mtg/bin/Res/sets/SIR/_cards.dat index a7ee48c13..f5bfaccde 100644 --- a/projects/mtg/bin/Res/sets/SIR/_cards.dat +++ b/projects/mtg/bin/Res/sets/SIR/_cards.dat @@ -761,7 +761,7 @@ rarity=C [/card] [card] primitive=Thing in the Ice -id=606719 +id=606710 rarity=R [/card] [card] diff --git a/projects/mtg/bin/Res/sets/primitives/_macros.txt b/projects/mtg/bin/Res/sets/primitives/_macros.txt index 8926232b7..a31accd04 100644 --- a/projects/mtg/bin/Res/sets/primitives/_macros.txt +++ b/projects/mtg/bin/Res/sets/primitives/_macros.txt @@ -57,6 +57,13 @@ # Amass, Set WAR #AUTO_DEFINE _AMASS_($c) if type(army|mybattlefield)~morethan~0 then counter(1/1.$c) notATarget(army|myBattlefield) else create(Zombie Army:creature Zombie Army:0/0:black) and!(counter(1/1.$c) notATarget(army|myBattlefield))! +# Amass Orc, Set LTR +#AUTO_DEFINE _AMASSORC1_ if type(army|mybattlefield)~morethan~0 then name(Put 1/1 counter) name(Put 1/1 counter) notatarget(army|myBattlefield) transforms((Orc,newability[counter(1/1)])) forever else name(Create Orc Army) token(Orc Army^Creature Orc Army^0/0^black) and!( name(Put 1/1 counter) counter(1/1) notatarget(army|myBattlefield) )! +#AUTO_DEFINE _AMASSORC2_ if type(army|mybattlefield)~morethan~0 then name(Put 1/1 counters) name(Put 1/1 counters) notatarget(army|myBattlefield) transforms((Orc,newability[counter(1/1.2)])) forever else name(Create Orc Army) token(Orc Army^Creature Orc Army^0/0^black) and!( name(Put 1/1 counters) counter(1/1.2) notatarget(army|myBattlefield) )! +#AUTO_DEFINE _AMASSORC3_ if type(army|mybattlefield)~morethan~0 then name(Put 1/1 counters) name(Put 1/1 counters) notatarget(army|myBattlefield) transforms((Orc,newability[counter(1/1.3)])) forever else name(Create Orc Army) token(Orc Army^Creature Orc Army^0/0^black) and!( name(Put 1/1 counters) counter(1/1.3) notatarget(army|myBattlefield) )! +#AUTO_DEFINE _AMASSORC4_ if type(army|mybattlefield)~morethan~0 then name(Put 1/1 counters) name(Put 1/1 counters) notatarget(army|myBattlefield) transforms((Orc,newability[counter(1/1.4)])) forever else name(Create Orc Army) token(Orc Army^Creature Orc Army^0/0^black) and!( name(Put 1/1 counters) counter(1/1.4) notatarget(army|myBattlefield) )! +#AUTO_DEFINE _AMASSORC5_ if type(army|mybattlefield)~morethan~0 then name(Put 1/1 counters) name(Put 1/1 counters) notatarget(army|myBattlefield) transforms((Orc,newability[counter(1/1.5)])) forever else name(Create Orc Army) token(Orc Army^Creature Orc Army^0/0^black) and!( name(Put 1/1 counters) counter(1/1.5) notatarget(army|myBattlefield) )! + # Scry, Evergreen #AUTO_DEFINE _SCRY_($c) scry:$c scrycore delayed dontshow donothing scrycoreend scryend #AUTO_DEFINE _SCRY1_ scry:1 scrycore delayed dontshow donothing scrycoreend scryend @@ -130,6 +137,9 @@ #AUTO_DEFINE _INITIATIVE_CONTROLLER_ if type(The Initiative|battlefield)~lessthan~1 then token(The Initiative) else all(The Initiative|battlefield) moveto(mybattlefield) and!( transforms((,newability[takesinitiative controller])) forever )! #AUTO_DEFINE _INITIATIVE_OPPONENT_ if type(The Initiative|battlefield)~lessthan~1 then token(The Initiative) opponent else all(The Initiative|battlefield) moveto(opponentbattlefield) and!( transforms((,newability[takesinitiative controller])) forever )! +# The Ring Tempts +#AUTO_DEFINE _RINGTEMPTS_ if type(The Ring|mybattlefield)~morethan~0 then all(The Ring|mybattlefield) transforms((,newability[theringtempts:1 controller],newability[name(Chose a ring bearer) target(creature|mybattlefield) becomesringbearer])) oneshot else token(The Ring) and!( theringtempts:1 controller and!( name(Choose a ring bearer) target(creature|myBattlefield) becomesringbearer )! )! + # Explore, not implemented #AUTO_DEFINE _EXPLORE_ reveal:1 optionone if type(land|reveal)~lessthan~1 then transforms((,newability[counter(1/1)])) optiononeend optiontwo if type(land|reveal)~morethan~0 then name(move to Hand) target(<1>*|reveal) moveto(myHand) else transforms((,newability[Choice name(back to library) target(<1>*|reveal) moveto(mylibrary)],newability[Choice name(put into Graveyard) target(<1>*|reveal) moveto(myGraveyard)])) optiontwoend revealend limit:1 diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 6c7c85c64..8f6aae167 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -1,7 +1,7 @@ grade=borderline #Bordeline Primitives Pack for Wagic the Homebrew. #Please keep these card alphabetized, and try to have the "name=" line at the top of each card -#I sorted this programmatically - Thanks to Vitty85 24-06-2023 +#I sorted this programmatically - Thanks to Vitty85 26-06-2023 [card] name=+2 Mace auto={3}:equip @@ -4514,6 +4514,14 @@ power=3 toughness=3 [/card] [card] +name=Arwen's Gift +anyzone=aslongas(creature[legendary]|mybattlefield) altercost(colorless,-1) >1 +auto=scry:2 scrycore delayed dontshow draw:2 controller scrycoreend scryend +text=This spell costs {1} less to cast if you control two or more legendary creatures. -- Scry 2, then draw two cards. +mana={3}{U} +type=Sorcery +[/card] +[card] name=Aryel, Knight of Windgrace abilities=vigilance auto={2}{W}{T}:create(knight:creature knight:2/2:white:vigilance) @@ -6494,6 +6502,17 @@ power=2 toughness=2 [/card] [card] +name=Banish from Edoras +other={2}{W} name(Target tapped creature) +otherrestriction=type(creature[tapped]|battlefield)~morethan~0 +restriction=type(creature[-tapped]|battlefield)~morethan~0 +auto=if paid(alternative) then name(Exile tapped creature) name(Exile tapped creature) target(creature[tapped]|battlefield) moveto(exile) +auto=ifnot paid(alternative) then name(Exile untapped creature) name(Exile untapped creature) target(creature[-tapped]|battlefield) moveto(exile) +text=This spell costs {2} less to cast if it targets a tapped creature. -- Exile target creature. +mana={4}{W} +type=Sorcery +[/card] +[card] name=Banish into Fable auto=if casted(this) restriction{type(artifact|myBattlefield)~morethan~0} then ability$!moveTo(ownerhand) target(*[-land])!$ controller && ability$!_KNIGHTTOKEN_ controller!$ controller auto=if casted(this) restriction{type(enchantment|myBattlefield)~morethan~0} then ability$!moveTo(ownerhand) target(*[-land])!$ controller && ability$!_KNIGHTTOKEN_ controller!$ controller @@ -7995,6 +8014,16 @@ power=1 toughness=1 [/card] [card] +name=Bill Ferny, Bree Swindler +auto=@combat(blocked) source(this):name(Choose one) transforms((,newability[choice name(Create treasure) token(Treasure)],newability[if type(horse|mybattlefield)~morethan~0 then choice name(Give control of horse) name(Give control of horse) target(horse|mybattlefield) moveto(opponentbattlefield) and!( removefromcombat all(this) && token(Treasure)*3 )! ])) oneshot +text=Whenever Bill Ferny, Bree Swindler becomes blocked, choose one -- Create a Treasure token. (It's an artifact with "{T}, Sacrifice this artifact: Add one mana of any color.") -- Target opponent gains control of target Horse you control. If they do, remove Bill Ferny from combat and create three Treasure tokens. +mana={1}{U} +type=Legendary Creature +subtype=Human Rogue +power=2 +toughness=1 +[/card] +[card] name=Bind the Monster target=creature auto=tap(noevent) @@ -8185,6 +8214,14 @@ power=3 toughness=3 [/card] [card] +name=Birthday Escape +auto=name(Draw a card) draw:1 controller +auto=_RINGTEMPTS_ +text=Draw a card. The Ring tempts you. +mana={U} +type=Sorcery +[/card] +[card] name=Birthing Boughs auto={4}{T}:token(Shapeshifter,creature Shapeshifter,2/2,changeling) text={4}, {T}: Create a 2/2 colorless Shapeshifter creature token with changeling. (It has every creature type.) @@ -10816,6 +10853,14 @@ type=Enchantment subtype=Aura [/card] [card] +name=Borne Upon a Wind +auto=emblem transforms((,newability[lord(*[-land]|mycastingzone) asflash])) ueot +auto=name(Draw a card) draw:1 controller +text=You may cast spells this turn as though they had flash. -- Draw a card. +mana={1}{U} +type=Instant +[/card] +[card] name=Boros Challenger abilities=mentor auto=_ATTACKING_name(Choose attacking creature) transforms((,newability[target(other creature[attacking;power<=pminus1minusend]|myBattlefield) counter(1/1)])) oneshot @@ -13199,6 +13244,16 @@ power=1 toughness=1 [/card] [card] +name=Captain of Umbar +auto={1}{T}:name(Draw and discard) draw:1 && ability$!name(Discard a card) name(Discard a card) reject notatarget(*|myhand)!$ controller +text={1}, {T}: Draw a card, then discard a card. +mana={2}{U} +type=Creature +subtype=Human Pirate +power=2 +toughness=3 +[/card] +[card] name=Captain's Hook auto={1}:equip auto=teach(creature) +2/+0 @@ -18512,6 +18567,14 @@ mana={1}{B}{S(artifact,creature)} type=Instant [/card] [card] +name=Council's Deliberation +auto=name(Draw a card) draw:1 controller +autograveyard=@scryed(*|mybattlefield,mystack) restriction{type(island|mybattlefield)~morethan~0}:may name(Exile and draw) name(Exile and draw) all(this|mygraveyard) moveto(myexile) and!( draw:1 controller )! +text=Draw a card. -- Whenever you scry, if you control an Island, you may exile Council's Deliberation from your graveyard. If you do, draw a card. +mana={1}{U} +type=Instant +[/card] +[card] name=Counterlash auto=if type(creature|opponentstack)~morethan~0 then choice name(Counter opponent creature) name(Counter opponent creature) target(creature|opponentstack) transforms((,newability[fizzle],newability[ability$!name(Cast a creature from hand) name(Cast a creature from hand) target(creature|myhand) activate castcard(normal)!$ opponent])) oneshot auto=if type(creature|mystack)~morethan~0 then choice name(Counter your creature) name(Counter your creature) target(creature|mystack) transforms((,newability[fizzle],newability[ability$!name(Cast a creature from hand) name(Cast a creature from hand) target(creature|myhand) activate castcard(normal)!$ controller])) oneshot @@ -21689,6 +21752,15 @@ mana={3} type=Artifact [/card] [card] +name=Deceive the Messenger +target=creature +auto=-3/0 ueot +auto=_AMASSORC1_ +text=Target creature gets -3/-0 until end of turn. -- Amass Orcs 1. (Put a +1/+1 counter on an Army you control. It's also an Orc. If you don't control an Army, create a 0/0 black Orc Army creature token first.) +mana={U} +type=Instant +[/card] +[card] name=Decimate auto=ability$!destroy target(artifact)!$ controller auto=ability$!destroy target(creature)!$ controller @@ -25930,6 +26002,16 @@ power=2 toughness=1 [/card] [card] +name=Dunedain Blade +auto=teach(creature) 2/1 +auto={1}:name(Equip human) rehook target(human|mybattlefield) +auto={3}:equip +text=Equipped creature gets +2/+1. -- Equip Human {1} -- Equip {3} ({3}: Attach to target creature you control. Equip only as a sorcery.) +mana={1}{W} +type=Artifact +subtype=Equipment +[/card] +[card] name=Dunes of the Dead auto={T}:Add{1} auto=_DIES_token(Zombie ,Creature Zombie,2/2,Black) @@ -26430,6 +26512,17 @@ power=5 toughness=5 [/card] [card] +name=East-Mark Cavalier +abilities=vigilance +auto=@combatdamaged(creature[orc;goblin]|battlefield) from(this):name(Destroy creature) all(trigger[to]) name(Destroy creature) destroy +text=Vigilance -- Whenever East-Mark Cavalier deals damage to a Goblin or Orc, destroy that creature. +mana={1}{W} +type=Creature +subtype=Human Knight +power=2 +toughness=2 +[/card] +[card] name=Easy Prey abilities=cycling target=creature[manacost<=2] @@ -27260,6 +27353,17 @@ power=4 toughness=4 [/card] [card] +name=Elrond, Lord of Rivendell +auto=name(Scry 1) _SCRY1_ +auto=@movedto(other creature|mybattlefield):name(Scry 1) _SCRY1_ +text=Whenever Elrond, Lord of Rivendell or another creature enters the battlefield under your control, scry 1. If this is the second time this ability has resolved this turn, the Ring tempts you. +mana={2}{U} +type=Legendary Creature +subtype=Elf Noble +power=3 +toughness=2 +[/card] +[card] name=Elsha of the Infinite abilities=prowess,showfromtoplibrary auto=this(variable{type:*[-land;-creature;zpos=1]:mylibrary}>0) lord(*[zpos=1]|mylibrary) flash @@ -28392,6 +28496,16 @@ type=Enchantment subtype=Aura [/card] [card] +name=Errand-Rider of Gondor +auto=draw:1 controller && if type(creature[legendary]|mybattlefield)~equalto~0 then name(Put card on bottom) name(Put card on bottom) target(*|myhand) bottomoflibrary +text=When Errand-Rider of Gondor enters the battlefield, draw a card. Then if you don't control a legendary creature, put a card from your hand on the bottom of your library. +mana={2}{W} +type=Creature +subtype=Human Soldier +power=3 +toughness=2 +[/card] +[card] name=Errant and Giada abilities=flash,flying,showfromtoplibrary auto=aslongas(*[flash&zpos=1]|mylibrary) canplayfromlibrarytop >0 @@ -28482,6 +28596,14 @@ type=Enchantment subtype=Aura [/card] [card] +name=Escape from Orthanc +target=creature +auto=transforms((,newability[untap],newability[flying],newability[1/3])) ueot +text=Target creature gets +1/+3 and gains flying until end of turn. Untap it. +mana={W} +type=Instant +[/card] +[card] name=Escape to the Wilds auto=all(*[zpos<=5]|mylibrary) moveto(exile) and!( transforms((,newability[canplayfromexile uent])) uent )! auto=maxPlay(land)+1 @@ -28584,6 +28706,17 @@ power=1 toughness=1 [/card] [card] +name=Esquire of the King +auto=this(variable{type:creature[legendary]:mybattlefield}=0) {4}{W}{T}:name(Creatures get 1/1) name(Creatures get 1/1) all(creature|myBattlefield) transforms((,newability[1/1])) ueot +auto=this(variable{type:creature[legendary]:mybattlefield}>0) {2}{W}{T}:name(Creatures get 1/1) name(Creatures get 1/1) all(creature|myBattlefield) transforms((,newability[1/1])) ueot +text={4}{W}, {T}: Creatures you control get +1/+1 until end of turn. This ability costs {2} less to activate if you control a legendary creature. +mana={W} +type=Creature +subtype=Human Soldier +power=1 +toughness=1 +[/card] +[card] name=Essence Capture target=creature|stack auto=fizzle @@ -33233,6 +33366,15 @@ mana={GW} type=Sorcery [/card] [card] +name=Flowering of the White Tree +auto=lord(creature[legendary]|myBattlefield) 2/1 +auto=lord(creature[-legendary]|myBattlefield) 1/1 +auto=@targeted(creature[legendary]|myBattlefield) from(*|opponentzones):choice name(This spell costs 1 more) name(This spell costs 1 more) target(*|opponentzones) transforms((,newability[pay[[{1}]] name(pay 1 mana) donothing?fizzle])) oneshot +text=Legendary creatures you control get +2/+1 and have ward {1}. -- Nonlegendary creatures you control get +1/+1. +mana={W}{W} +type=Legendary Enchantment +[/card] +[card] name=Flowstone Infusion target=creature auto=2/-2 @@ -33385,6 +33527,15 @@ mana={2}{G} type=Instant [/card] [card] +name=Fog on the Barrow-Downs +target=creature +auto=teach(creature) transforms((removecreaturesubtypes,newability[becomes(Spirit)],newability[cantattack],newability[cantpwattack],newability[cantblock])) +text=Enchant creature -- Enchanted creature is a Spirit and can't attack or block. (It loses all other creature types.) +mana={2}{W} +type=Enchantment +subtype=Aura +[/card] +[card] name=Folio of Fancies abilities=nomaxhand,oppnomaxhand auto={X}{X}{T}:name(Each player draws cards) name(Each player draws cards) draw:XX all(player) @@ -34972,6 +35123,18 @@ power=3 toughness=4 [/card] [card] +name=Gandalf, Friend of the Shire +abilities=flash +auto=lord(sorcery|mycastingzone) asflash +auto=@bearerchosen(other creature|mybattlefield):name(Draw a card) draw:1 controller +text=Flash -- You may cast sorcery spells as though they had flash. -- Whenever the Ring tempts you, if you chose a creature other than Gandalf, Friend of the Shire as your Ring-bearer, draw a card. +mana={3}{U} +type=Legendary Creature +subtype=Avatar Wizard +power=2 +toughness=4 +[/card] +[card] name=Gang Up target=creature[power<=prex] auto=destroy @@ -37222,6 +37385,15 @@ power=5 toughness=5 [/card] [card] +name=Glorious Gale +target=creature|stack +auto=fizzle +auto=if cantargetcard(*[legendary]|*) then name(The ring tempts you) ability$!name(The ring tempts you) _RINGTEMPTS_!$ controller +text=Counter target creature spell. If it was a legendary spell, the Ring tempts you. +mana={1}{U} +type=Instant +[/card] +[card] name=Glorious Protector abilities=foretell,flash,flying autohand=_FORETELL_ @@ -39477,6 +39649,17 @@ power=5 toughness=5 [/card] [card] +name=Grey Havens Navigator +abilities=flash +auto=_SCRY1_ +text=Flash -- When Grey Havens Navigator enters the battlefield, scry 1. +mana={2}{U} +type=Creature +subtype=Elf Pilot +power=3 +toughness=2 +[/card] +[card] name=Grief abilities=menace other={E(*[black]|myhand)} name(Evoke) @@ -43067,6 +43250,16 @@ mana={1}{B}{R} type=Instant [/card] [card] +name=Hithlain Knots +target=creature +auto=_SCRY1_ +auto=tap +auto=draw:1 controller +text=Tap target creature. Scry 1. -- Draw a card. +mana={1}{U} +type=Instant +[/card] +[card] name=Hive Mind auto=@movedto(*[instant;sorcery]|mystack):ability$!name(Copy spell) name(Copy spell) all(*[instant;sorcery]|opponentstack) activate castcard(copied noevent)!$ opponent auto=@movedto(*[instant;sorcery]|opponentstack):ability$!name(Copy spell) name(Copy spell) all(*[instant;sorcery]|opponentstack) activate castcard(copied noevent)!$ controller @@ -43149,6 +43342,14 @@ power=2 toughness=3 [/card] [card] +name=Hobbit's Sting +target=creature +auto=damage:type:creature:mybattlefieldplustype:food:mybattlefieldplusend +text=Hobbit's Sting deals X damage to target creature, where X is the number of creatures you control plus the number of Foods you control. +mana={1}{W} +type=Instant +[/card] +[card] name=Hobblefiend abilities=trample auto={1}{S(other creature|myBattlefield)}:counter(1/1) all(this) @@ -43713,6 +43914,15 @@ power=4 toughness=4 [/card] [card] +name=Horses of the Bruinen +auto=choice name(Don't return any creature) scry:1 scrycore delayed dontshow ability$!name(The ring tempts you) _RINGTEMPTS_!$ controller scrycoreend scryend +auto=if type(creature|battlefield)~morethan~0 then choice name(Return 1 creature) name(Return 1 creature) target(creature|battlefield) moveTo(ownerHand) and!( name(Scry 1) scry:1 scrycore delayed dontshow ability$!name(The ring tempts you) _RINGTEMPTS_!$ controller scrycoreend scryend )! +auto=if type(creature|battlefield)~morethan~1 then choice name(Return 2 creatures) name(Return 2 creaturs) target(creature|battlefield) moveTo(ownerHand) and!( name(Return second creature) target(creature|battlefield) moveTo(ownerHand) and!( name(Scry 1) scry:1 scrycore delayed dontshow ability$!name(The ring tempts you) _RINGTEMPTS_!$ controller scrycoreend scryend )! )! +text=Return up to two target creatures to their owners' hands. Scry 1. The Ring tempts you. +mana={3}{U}{U} +type=Sorcery +[/card] +[card] name=Hostage Taker auto=if type(*[creature;artifact]|opponentbattlefield)~morethan~0 then choice name(Exile opponent creature or artifact) name(Exile opponent creature or artifact) target(*[creature;artifact]|opponentbattlefield) imprint auto=if type(*[creature;artifact]|opponentbattlefield)~morethan~0 then name(Exile your creature or artifact) name(Exile your creature or artifact) target(other *[creature;artifact]|battlefield) imprint and!( transforms((,newability[canplayfromexile forever],newability[anytypeofmana forever])) forever )! @@ -47707,6 +47917,17 @@ mana={1}{U}{R} type=Instant [/card] [card] +name=Ioreth of the Healing House +auto={T}:name(Untap other permanent) target(other *|battlefield) untap +auto={T}:name(Untap other 2 legendary creatures) target(<2>creature[legendary]|battlefield) untap +text={T}: Untap another target permanent. -- {T}: Untap two other target legendary creatures. +mana={2}{U} +type=Legendary Creature +subtype=Human Cleric +power=1 +toughness=4 +[/card] +[card] name=Ipnu Rivulet auto={1}{U}{T}{S(desert|mybattlefield)}:deplete:4 target(player) auto={T}:Add{1} @@ -48006,6 +48227,14 @@ text={T}: Add {C}. -- {2}, {T}: Scry 1, then you may reveal the top card of your type=Land [/card] [card] +name=Isolation at Orthanc +target=creature +auto=placefromthetop(2) +text=Put target creature into its owner's library second from the top. +mana={3}{U} +type=Instant +[/card] +[card] name=Isu the Abominable abilities=showfromtoplibrary auto=aslongas(*[snow&zpos=1]|mylibrary) canplayfromlibrarytop >0 @@ -48026,6 +48255,17 @@ text=Hidden agenda (Start the game with this conspiracy face down in the command type=Conspiracy [/card] [card] +name=Ithilien Kingfisher +abilities=flying +auto=_DIES_name(Draw a card) draw:1 controller +text=Flying -- When Ithilien Kingfisher dies, draw a card. +mana={2}{U} +type=Creature +subtype=Bird +power=2 +toughness=1 +[/card] +[card] name=Itlimoc, Cradle of the Sun auto={T}:Add{G} auto={T}:name(Add G for each creature you control) foreach(creature|mybattlefield) add{G} @@ -51585,6 +51825,16 @@ power=2 toughness=2 [/card] [card] +name=Knights of Dol Amroth +auto=_SECOND_DRAW_name(Put 1/1 counter) counter(1/1) +text=Whenever you draw your second card each turn, put a +1/+1 counter on Knights of Dol Amroth. +mana={3}{U} +type=Creature +subtype=Human Knight +power=3 +toughness=3 +[/card] +[card] name=Knights of the Black Rose auto=_MONARCH_CONTROLLER_ auto=@becomesmonarchfoeof(player):life:-2 opponent && life:2 controller @@ -52644,6 +52894,17 @@ power=2 toughness=2 [/card] [card] +name=Landroval, Horizon Witness +abilities=flying +auto=@each blockers restriction{type(creature[attacking]|mybattlefield)~morethan~1}:name(Creature gains flying) name(Creature gains flying) target(creature[-flying&attacking]|mybattlefield) transforms((,newability[flying])) ueot +text=Flying -- Whenever two or more creatures you control attack a player, target attacking creature without flying gains flying until end of turn. +mana={4}{W} +type=Legendary Creature +subtype=Bird Noble +power=3 +toughness=4 +[/card] +[card] name=Landscaper Colos aicode=activate target(land[basic]|mylibrary) moveto(myhand) autohand={1}{W}{cycle}:name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>land[basic]|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend @@ -55167,6 +55428,14 @@ power=2 toughness=2 [/card] [card] +name=Lorien Revealed +auto=name(Draw 3 cards) draw:3 controller +autohand={1}{cycle}:name(Search island) target(island|myLibrary) moveTo(myHand) and!( shuffle )! +text=Draw three cards. -- Islandcycling {1} ({1}, Discard this card: Search your library for an Island card, reveal it, put it into your hand, then shuffle.) +mana={3}{U}{U} +type=Sorcery +[/card] +[card] name=Lose Focus target=*|stack kicker=multi{U} @@ -55231,6 +55500,15 @@ text=(Transforms from Dowsing Dagger.) -- {T}: Add three mana of any one color t type=Land [/card] [card] +name=Lost to Legend +auto=if type(*[-land&artifact]|battlefield)~morethan~0 then choice name(Put artifact on library) name(Put artifact on library) target(artifact[-land]|battlefield) placefromthetop(4) +auto=if type(*[-land&legendary]|battlefield)~morethan~0 then choice name(Put legendary card on library) name(Put legendary card on library) target(artifact[-land]|battlefield) placefromthetop(4) +auto=if type(*[-land&saga]|battlefield)~morethan~0 then choice name(Put saga on library) name(Put saga on library) target(artifact[-land]|battlefield) placefromthetop(4) +text=Put target nonland historic permanent into its owner's library fourth from the top. (Artifacts, legendaries, and Sagas are historic.) +mana={W}{W} +type=Instant +[/card] +[card] name=Lotleth Giant auto=damage:1 target(opponent) type:creature:card:mygraveyard text=Undergrowth - When Lotleth Giant enters the battlefield, it deals 1 damage to target opponent for each creature card in your graveyard. @@ -63252,6 +63530,16 @@ power=2 toughness=3 [/card] [card] +name=Nimble Hobbit +auto=_ATTACKING_name(Choose one) transforms((,newability[if type(food|mybattlefield)~morethan~0 then choice name(Sacrifice a food) name(Sacrifice a food) target(food|mybattlefield) sacrifice and!( name(Tap opponent creature) target(creature|opponentBattlefield) tap )!],newability[choice name(Pay mana) ability$!name(Pay and tap opponent creature) pay({2}{w}) name(Pay and tap opponent creature) target(creature|opponentBattlefield) tap!$ controller],newability[choice name(Don't pay or sacrifice) donothing])) oneshot +text=Whenever Nimble Hobbit attacks, you may sacrifice a Food or pay {2}{W}. When you do, tap target creature an opponent controls. +mana={1}{W} +type=Creature +subtype=Halfling Peasant +power=1 +toughness=3 +[/card] +[card] name=Nimble Larcenist abilities=flying auto=target(opponent) reveal:type:*:targetedpersonshand revealzone(targetedpersonshand) optionone name(choose card) notatarget(<1>*[artifact;instant;sorcery]|reveal) moveto(exile) optiononeend optiontwo all(*|reveal) moveto(ownerhand) optiontwoend revealend @@ -70721,6 +71009,16 @@ mana={4}{W} type=Enchantment [/card] [card] +name=Protector of Gondor +auto=name(Create soldier) token(Human Soldier,Creature Human Soldier,1/1,white) +text=When Protector of Gondor enters the battlefield, create a 1/1 white Human Soldier creature token. +mana={3}{W} +type=Creature +subtype=Human Soldier +power=3 +toughness=3 +[/card] +[card] name=Protector of the Crown abilities=cantlifelose auto=_MONARCH_CONTROLLER_ @@ -74646,6 +74944,15 @@ power=3 toughness=3 [/card] [card] +name=Reprieve +target=*|stack +auto=spellmover(hand) +auto=name(Draw a card) draw:1 controller +text=Return target spell to its owner's hand. -- Draw a card. +mana={1}{W} +type=Instant +[/card] +[card] name=Reprobation target=creature auto=loseabilities @@ -77003,6 +77310,17 @@ power=4 toughness=4 [/card] [card] +name=Rosie Cotton of South Lane +auto=token(Food) +auto=@tokencreated(*|myBattlefield):name(Put 1/1 counter) target(other creature|myBattlefield) counter(1/1) +text=When Rosie Cotton of South Lane enters the battlefield, create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") -- Whenever you create a token, put a +1/+1 counter on target creature you control other than Rosie. +mana={2}{W} +type=Legendary Creature +subtype=Halfling Peasant +power=1 +toughness=1 +[/card] +[card] name=Rosnakht, Heir of Rohgahh auto=_ATTACKING_all(other creature[attacking]) 1/0 ueot auto=_HEROIC_create(Kobolds of Kher Keep:creature kobold:0/1:red) @@ -80645,6 +80963,14 @@ text=As Secluded Courtyard enters the battlefield, choose a creature type. -- {T type=Land [/card] [card] +name=Second Breakfast +auto=may name(Tap 2 creatures) target(creature|battlefield) tap +auto=token(Food) +text=Up to two target creatures each get +2/+1 until end of turn. Create a Food token. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +mana={2}{W} +type=Instant +[/card] +[card] name=Second Sight aicode=name(look) activate name(look) transforms((,newability[foreach(*[zpos<=5]|mylibrary) moverandom(*[zpos<=5]) from(mylibrary) to(mylibrary)])) ueot aicode=name(look) activate name(look) transforms((,newability[foreach(*[zpos<=5]|opponentlibrary) moverandom(*[zpos<=5]) from(opponentlibrary) to(opponentlibrary)])) ueot @@ -82698,6 +83024,17 @@ power=1 toughness=2 [/card] [card] +name=Shire Shirriff +abilities=vigilance +auto=may name(Sacrifice a token) target(*[token]|mybattlefield) sacrifice and!( name(Exile creature) (blink)forsrc target(creature|opponentBattlefield) )! +text=Vigilance -- When Shire Shirriff enters the battlefield, you may sacrifice a token. When you do, exile target creature an opponent controls until Shire Shirriff leaves the battlefield. +mana={1}{W} +type=Creature +subtype=Halfling Soldier +power=2 +toughness=2 +[/card] +[card] name=Shirei, Shizo's Caretaker auto=@movedTo(creature[power<=1]|mygraveyard) from(battlefield):phaseaction[endofturn once] aslongas(Shirei, Shizo's Caretaker|mybattlefield) may moveto(mybattlefield) target(creature[power<=1]|mygraveyard) text=Whenever a creature with power 1 or less is put into your graveyard from the battlefield, you may return that card to the battlefield under your control at the beginning of the next end step if Shirei, Shizo's Caretaker is still on the battlefield. @@ -86007,6 +86344,17 @@ toughness=1 color=white [/card] [card] +name=Soldier of the Grey Host +abilities=flash,flying +auto=name(Creature gain 2/0) target(creature) transforms((,newability[2/0])) ueot +text=Flash -- Flying -- When Soldier of the Grey Host enters the battlefield, target creature gets +2/+0 until end of turn. +mana={3}{W} +type=Creature +subtype=Spirit Soldier +power=2 +toughness=2 +[/card] +[card] name=Solemn Doomguide abilities=flying auto=lord(*[cleric;rogue;warrior;wizard]|mygraveyard) {1}{B}:name(Unearth) moveto(mybattlefield) and!( transforms((,newability[haste],newability[unearth],newability[exiledeath])) forever )! asSorcery @@ -92205,6 +92553,18 @@ power=3 toughness=2 [/card] [card] +name=Tale of Tinuviel +auto=counter(0/0,1,Lore) +auto=name(Creature gains indestructible) target(creature|mybattlefield) transforms((,newability[aslongas(Tale of Tinuviel|myBattlefield) indestructible])) forever +auto=@each my firstmain:counter(0/0,1,Lore) +auto=@counteradded(0/0,1,Lore) from(this):this(counter{0/0.2.Lore}<=2) name(Return creature) name(Return creature) target(creature|mygraveyard) moveto(mybattlefield) +auto=@counteradded(0/0,1,Lore) from(this):this(counter{0/0.3.Lore}) may name(Creatures gain lifelink) target(creature|mybattlefield) transforms((,newability[lifelink])) ueot +text=(As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.) -- I - Target creature you control gains indestructible for as long as you control Tale of Tinuviel. -- II - Return target creature card from your graveyard to the battlefield. -- III - Up to two target creatures you control each gain lifelink until end of turn. +mana={3}{W}{W} +type=Enchantment +subtype=Saga +[/card] +[card] name=Tale's End target=*[legendary]|stack auto=fizzle @@ -93014,7 +93374,7 @@ type=Legendary Enchantment name=Teferi's Protection abilities=exiledeath auto=all(*|myBattlefield) phaseout -auto=token(Teferi's Protection,Emblem,0/0,indestructible,shroud,cantchangelife,controllershroud,notrigger) and!( transforms((,newability[@each my untap:sacrifice])) forever )! +auto=token(Teferi's Protection,Emblem,0/0,indestructible,shroud,cantchangelife,controllershroud,playershroud,notrigger) and!( transforms((,newability[@each my untap:sacrifice])) forever )! text=Until your next turn, your life total can't change and you gain protection from everything. All permanents you control phase out. (While they're phased out, they're treated as though they don't exist. They phase in before you untap during your untap step.) -- Exile Teferi's Protection. mana={2}{W} type=Instant @@ -93929,6 +94289,26 @@ type=Land subtype=Sphere [/card] [card] +name=The Bath Song +auto=counter(0/0,1,Lore) +auto=name(Draw and discard) draw:2 && transforms((,newability[target(*|myhand) reject])) forever +auto=@each my firstmain:counter(0/0,1,Lore) +auto=@counteradded(0/0,1,Lore) from(this):this(counter{0/0.2.Lore}<=2) name(Draw and discard) draw:2 && transforms((,newability[target(*|myhand) reject])) forever +auto=@counteradded(0/0,1,Lore) from(this):this(counter{0/0.3.Lore}) name(Shuffle cards and add mana) add{U}{U} && ability$!may name(Shuffle cards) target(*|mygraveyard) moveto(mylibrary) and!( shuffle )!!$ controller +text=(As this Saga enters and after your draw -- step, add a lore counter. Sacrifice after III.) -- I, II - Draw two cards, then discard a card. -- III - Shuffle any number of target cards from your graveyard into your library. Add {U}{U}. +mana={3}{U} +type=Enchantment +subtype=Saga +[/card] +[card] +name=The Battle of Bywater +auto=all(creature[power>=3]|battlefield) destroy +auto=ability$!name(Create food) all(mysource|mystack) transforms((,newability[token(Food)*type:creature:mybattlefield])) oneshot!$ controller +text=Destroy all creatures with power 3 or greater. Then create a Food token for each creature you control. (It's an artifact with "{2}, {T}, Sacrifice this artifact: You gain 3 life.") +mana={1}{W}{W} +type=Sorcery +[/card] +[card] name=The Bears of Littjara auto=counter(0/0,1,Lore) auto=@each my firstmain:counter(0/0,1,Lore) @@ -94620,6 +95000,16 @@ power=3 toughness=3 [/card] [card] +name=The One Ring +abilities=indestructible +auto=if casted(this) then name(Gain protection) name(Gain protection) transforms((,newability[controllershroud],newability[playershroud])) uynt +auto=@each my upkeep restriction{compare(hascntburden)~morethan~0}:name(Lose life) life:-hascntburden +auto={T}:name(Put burden counter) counter(0/0,1,Burden) && draw:hascntburden controller +text=Indestructible -- When The One Ring enters the battlefield, if you cast it, you gain protection from everything until your next turn. -- At the beginning of your upkeep, you lose 1 life for each burden counter on The One Ring. -- {T}: Put a burden counter on The One Ring, then draw a card for each burden counter on The One Ring. +mana={4} +type=Legendary Artifact +[/card] +[card] name=The Prismatic Bridge auto=@each my upkeep:name(Reveal cards) reveal:1 revealzone(mylibrary) revealuntil(*[creature;planeswalker]|mylibrary) optionone choice name(Put card onto the battlefield) target(*[creature;planeswalker]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo all(*|reveal) bottomoflibrary and!(shuffle)! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(moveTo(myBattlefield))! afterrevealedend revealend text=At the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature or planeswalker card. Put that card onto the battlefield and the rest on the bottom of your library in a random order. // {1}{G}{G} Esika, God of the Tree @@ -94702,6 +95092,17 @@ type=Enchantment subtype=Saga [/card] [card] +name=The Ring +abilities=shroud,indestructible,doublefacedeath,nofizzle +auto=this(variable{pringtemptations}>0) lord(creature[ringbearer]|mybattlefield) transforms((Legendary,newability[cantbeblockedby(creature[power>=pplus1plusend])])) +auto=@combat(attacking) source(mytgt) restriction{compare(pringtemptations)~morethan~1}:name(Draw and discard) name(Draw and discard) draw:1 controller && ability$!name(Discard a card) notatarget(*|myhand) reject!$ controller +auto=@combat(blocked) source(mytgt) from(creature) restriction{compare(pringtemptations)~morethan~2}:name(Creature will be sacrificed) name(Creature will be sacrificed) all(trigger[from]) name(Creature will be sacrificed) transforms((,newability[phaseaction[combatends once sourceinplay] sacrifice])) forever +auto=@combatdamaged(player) from(mytgt) restriction{compare(pringtemptations)~morethan~3}:name(Opponent loses life) name(Opponent loses life) life:-3 opponent +auto={9999}:equip +text=Your Ring-bearer is legendary and canâ??t be blocked by creatures with greater power. -- Whenever your Ring-bearer attacks, draw a card, then discard a card. -- Whenever your Ring-bearer becomes blocked by a creature, that creatureâ??s controller sacrifices it at end of combat. -- Whenever your Ring-bearer deals combat damage to a player, each opponent loses 3 life. +type=Emblem +[/card] +[card] name=The Ringhart Crest auto=chooseatype transforms((,newability[this(variable{type:creature[legendary;chosentype]:myrestrictedcastingzone}>0) {T}:add{W}],newability[this(variable{type:creature[legendary;chosentype]:myrestrictedcastingzone}>0) {T}:add{U}],newability[this(variable{type:creature[legendary;chosentype]:myrestrictedcastingzone}>0) {T}:add{R}],newability[this(variable{type:creature[legendary;chosentype]:myrestrictedcastingzone}>0) {T}:add{G}],newability[this(variable{type:creature[legendary;chosentype]:myrestrictedcastingzone}>0) {T}:add{B}])) chooseend text=As The Ringhart Crest enters the battlefield, choose a creature type. -- {T}: Add {G}. Spend this mana only to cast a creature spell of the chosen type or a legendary creature spell. // {2}{G}{G} Kolvori, God of Kinship @@ -94764,7 +95165,7 @@ subtype=Saga [/card] [card] name=The Stasis Coffin -auto={2}{T}{E}:name(Gain protection) token(Coffin Protection,Emblem,0/0,indestructible,shroud,controllershroud,notrigger) and!( transforms((,newability[preventalldamage to(controller) from(*|opponentzones)],newability[preventalldamage to(controller) from(*|myzones)],newability[@each my untap:sacrifice])) forever )! +auto={2}{T}{E}:name(Gain protection) token(Coffin Protection,Emblem,0/0,indestructible,shroud,controllershroud,playershroud,notrigger) and!( transforms((,newability[preventalldamage to(controller) from(*|opponentzones)],newability[preventalldamage to(controller) from(*|myzones)],newability[@each my untap:sacrifice])) forever )! text={2}, {T}, Exile The Stasis Coffin: You gain protection from everything until your next turn. mana={3} type=Legendary Artifact @@ -104422,6 +104823,16 @@ power=3 toughness=3 [/card] [card] +name=Westfold Rider +auto={S}:name(Destroy artifact or enchantment) destroy target(*[artifact;enchantment]|battlefield) asSorcery +text=Sacrifice Westfold Rider: Destroy target artifact or enchantment. Activate only as a sorcery. +mana={1}{W} +type=Creature +subtype=Human Knight +power=3 +toughness=1 +[/card] +[card] name=Westgate Regent abilities=flying auto=@targeted(this) from(*|opponentstack):choice name(Discard or counter) name(Discard or counter) target(*|opponentstack) transforms((,newability[if type(*|myhand)~equalto~0 then all(this|mystack) fizzle else name(Discard a card) pay[[{0}]] name(Discard a card) target(*|myhand) reject?fizzle])) oneshot @@ -106574,6 +106985,15 @@ mana={B} type=Instant [/card] [card] +name=You Cannot Pass! +target=creature[blocking;blocked] +restriction=type(legendary[blocking;blocked]|battlefield)~morethan~0 +auto=destroy +text=Destroy target creature that blocked or was blocked by a legendary creature this turn. +mana={W} +type=Instant +[/card] +[card] name=You Come to a River auto=choice name(Return non-land permanent) target(*[-land]|battlefield) moveTo(ownerhand) auto=choice name(Creature gets 1/0) target(creature|battlefield) transforms((,newability[1/0],newability[unblockable])) ueot diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 503776676..3096bc6c2 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -683,6 +683,35 @@ public: } }; +class TrplayerTempted: public Trigger +{ +public: + bool thiscontroller, thisopponent; + TrplayerTempted(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) + { + } + + int triggerOnEventImpl(WEvent * event) + { + WEventplayerTempted * 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; + } + + TrplayerTempted * clone() const + { + return NEW TrplayerTempted(*this); + } +}; + class TrplayerProliferated: public Trigger { public: @@ -863,6 +892,37 @@ public: } }; +class TrCardBearerChosen: public Trigger +{ +public: + bool limitOnceATurn; + int triggeredTurn; + bool checkBearerChanged; + TrCardBearerChosen(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false, bool limitOnceATurn = false, bool checkBearerChanged = false) : + Trigger(observer, id, source, once, tc), limitOnceATurn(limitOnceATurn), checkBearerChanged(checkBearerChanged) + { + triggeredTurn = -1; + } + + int triggerOnEventImpl(WEvent * event) + { + WEventCardBearerChosen * e = dynamic_cast (event); + if (!e) return 0; + if (limitOnceATurn && triggeredTurn == game->turn) + return 0; + if (checkBearerChanged && !e->bearerChanged) + return 0; + if (!tc->canTarget(e->card)) return 0; + triggeredTurn = game->turn; + return 1; + } + + TrCardBearerChosen * clone() const + { + return NEW TrCardBearerChosen(*this); + } +}; + class TrCardBoasted: public Trigger { public: @@ -4685,6 +4745,18 @@ public: AAExploresEvent * clone() const; ~AAExploresEvent(); }; +//Ring bearer has been chosen +class AARingBearerChosen : public ActivatedAbility +{ +public: + MTGAbility * andAbility; + AARingBearerChosen(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL); + int resolve(); + + const string getMenuText(); + AARingBearerChosen * clone() const; + ~AARingBearerChosen(); +}; //Dungeon Completed class AAAlterDungeonCompleted: public ActivatedAbilityTP { @@ -4711,6 +4783,19 @@ public: AAAlterYidaroCount * clone() const; ~AAAlterYidaroCount(); }; +//Ring Temptations +class AAAlterRingTemptations: public ActivatedAbilityTP +{ +public: + int temptations; + MTGAbility * andAbility; + AAAlterRingTemptations(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int temptations = 1, ManaCost * _cost = NULL, + int who = TargetChooser::UNSET); + int resolve(); + const string getMenuText(); + AAAlterRingTemptations * clone() const; + ~AAAlterRingTemptations(); +}; //Monarch class AAAlterMonarch: public ActivatedAbilityTP { diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index dda3e6ecc..632a967bd 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -362,7 +362,8 @@ class Constants POISONEIGHTTOXIC = 234, POISONNINETOXIC = 235, POISONTENTOXIC = 236, - NB_BASIC_ABILITIES = 237, + RINGBEARER = 237, + NB_BASIC_ABILITIES = 238, RARITY_S = 'S', //Special Rarity RARITY_M = 'M', //Mythics diff --git a/projects/mtg/include/Player.h b/projects/mtg/include/Player.h index 0a4f31abc..458152419 100644 --- a/projects/mtg/include/Player.h +++ b/projects/mtg/include/Player.h @@ -45,6 +45,7 @@ public: int energyCount; int experienceCount; int yidaroCount; + int ringTemptations; int dungeonCompleted; int numOfCommandCast; int monarch; diff --git a/projects/mtg/include/WEvent.h b/projects/mtg/include/WEvent.h index 42bf66ec3..4df869d95 100644 --- a/projects/mtg/include/WEvent.h +++ b/projects/mtg/include/WEvent.h @@ -404,6 +404,14 @@ struct WEventplayerMonarch : public WEvent { virtual Targetable * getTarget(Player * player); }; +//ring tempts event +struct WEventplayerTempted : public WEvent { + WEventplayerTempted(Player * player); + Player * player; + using WEvent::getTarget; + virtual Targetable * getTarget(Player * player); +}; + //proliferate event struct WEventplayerProliferated : public WEvent { WEventplayerProliferated(Player * player); @@ -477,6 +485,13 @@ struct WEventCardExplored : public WEventCardUpdate { virtual Targetable * getTarget(int target); }; +//ring bearer event +struct WEventCardBearerChosen : public WEventCardUpdate { + bool bearerChanged; + WEventCardBearerChosen(MTGCardInstance * card); + virtual Targetable * getTarget(int target); +}; + //dungeon completed event struct WEventCardDungeonCompleted : public WEventCardUpdate { int totaldng; diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 25a7507e7..4aa3d1ba5 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1066,6 +1066,88 @@ AAAlterPoison::~AAAlterPoison() { } +//AA Bearer Chosen +AARingBearerChosen::AARingBearerChosen(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) : + ActivatedAbility(observer, _id, _source, _cost, 0) +{ + target = _target; + andAbility = NULL; +} + +int AARingBearerChosen::resolve() +{ + MTGCardInstance * _target = (MTGCardInstance *) target; + if(_target) + { + MTGCardInstance * currentBearer = NULL; + for (int j = _target->controller()->game->inPlay->nb_cards - 1; j >= 0; --j){ + if(_target->controller()->game->inPlay->cards[j]->basicAbilities[Constants::RINGBEARER] == 1){ + currentBearer = _target->controller()->game->inPlay->cards[j]; + _target->controller()->game->inPlay->cards[j]->basicAbilities[Constants::RINGBEARER] = 0; + break; + } + } + _target->basicAbilities[Constants::RINGBEARER] = 1; + bool bearerChanged = false; + if(currentBearer == NULL || currentBearer != _target){ + for (int j = _target->controller()->game->inPlay->nb_cards - 1; j >= 0; --j){ + if(_target->controller()->game->inPlay->cards[j]->name == "The Ring"){ + 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->controller()->game->inPlay->cards[j]) + { + ((AEquip*)a)->unequip(); + ((AEquip*)a)->equip(_target); + bearerChanged = true; + break; + } + } + break; + } + } + } + WEventCardBearerChosen * e = NEW WEventCardBearerChosen(_target); + e->bearerChanged = bearerChanged; + game->receiveEvent(e); + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = _target; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } + return 1; + } + return 0; +} + +const string AARingBearerChosen::getMenuText() +{ + return "The Ring bearer has been chosen"; +} + +AARingBearerChosen * AARingBearerChosen::clone() const +{ + AARingBearerChosen * a = NEW AARingBearerChosen(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AARingBearerChosen::~AARingBearerChosen() +{ + SAFE_DELETE(andAbility); +} + //AA Explores Event AAExploresEvent::AAExploresEvent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, int who) : @@ -1330,6 +1412,64 @@ AAAlterYidaroCount::~AAAlterYidaroCount() { } +//AA Ring Temptations +AAAlterRingTemptations::AAAlterRingTemptations(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int temptations, ManaCost * _cost, + int who) : + ActivatedAbilityTP(observer, _id, _source, _target, _cost, who), temptations(temptations) +{ + andAbility = NULL; +} + +int AAAlterRingTemptations::resolve() +{ + Damageable * _target = (Damageable *) getTarget(); + if (_target) + { + Player * pTarget = (Player*)_target; + if(pTarget) + { + pTarget->ringTemptations += temptations; + if(pTarget->ringTemptations < 0) + pTarget->ringTemptations = 0; + WEvent * e = NEW WEventplayerTempted(pTarget); + game->receiveEvent(e); + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = _target; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } + } + } + return 0; +} + +const string AAAlterRingTemptations::getMenuText() +{ + return "The Ring tempts you"; +} + +AAAlterRingTemptations * AAAlterRingTemptations::clone() const +{ + AAAlterRingTemptations * a = NEW AAAlterRingTemptations(*this); + if(andAbility) + a->andAbility = andAbility->clone(); + return a; +} + +AAAlterRingTemptations::~AAAlterRingTemptations() +{ + SAFE_DELETE(andAbility); +} + //AA Monarch AAAlterMonarch::AAAlterMonarch(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, int who) : diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 8694828b6..d369d12cc 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1527,6 +1527,14 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell return NEW TrplayerProliferated(observer, id, card, tc, once, false, true); } + //ring temptations - controller of card + if (TargetChooser * tc = parseSimpleTC(s, "ringtemptedof", card)) + return NEW TrplayerTempted(observer, id, card, tc, once, true, false); + + //ring temptations - opponent of card controller + if (TargetChooser * tc = parseSimpleTC(s, "ringtemptedfoeof", card)) + return NEW TrplayerTempted(observer, id, card, tc, once, false, true); + //becomes monarch - controller of card if (TargetChooser * tc = parseSimpleTC(s, "becomesmonarchof", card)) return NEW TrplayerMonarch(observer, id, card, tc, once, true, false); @@ -1540,7 +1548,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell return NEW TrplayerInitiative(observer, id, card, tc, once, true, false); //takes the initiative - opponent of card controller - if (TargetChooser * tc = parseSimpleTC(s, "takeninitiativeof", card)) + if (TargetChooser * tc = parseSimpleTC(s, "takeninitiativefoeof", card)) return NEW TrplayerInitiative(observer, id, card, tc, once, false, true); //shuffled library - controller of card @@ -1595,10 +1603,18 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell if (TargetChooser * tc = parseSimpleTC(s, "ninjutsued", card)) return NEW TrCardNinja(observer, id, card, tc, once, limitOnceATurn); - //Esplores has been performed from a cardr + //Explores has been performed from a card if (TargetChooser * tc = parseSimpleTC(s, "explored", card)) return NEW TrCardExplored(observer, id, card, tc, once, limitOnceATurn); + //A Ring bearer has been chosen + if (TargetChooser * tc = parseSimpleTC(s, "bearerchosen", card)) + return NEW TrCardBearerChosen(observer, id, card, tc, once, limitOnceATurn, false); + + //A different Ring bearer has been chosen + if (TargetChooser * tc = parseSimpleTC(s, "bearernewchosen", card)) + return NEW TrCardBearerChosen(observer, id, card, tc, once, limitOnceATurn, true); + //Dungeon has been completer from a card if (TargetChooser * tc = parseSimpleTC(s, "dungeoncompleted", card)){ int totaldng = 0; @@ -4293,6 +4309,28 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return a; } + //Ring temptations + vector splitRingTemptations = parseBetween(s, "theringtempts:", " ", false); + if (splitRingTemptations.size()) + { + int temptations = 1; + WParsedInt* parser = NEW WParsedInt(splitRingTemptations[1], card); + if(parser){ + temptations = parser->intValue; + SAFE_DELETE(parser); + } + Targetable * t = spell ? spell->getNextTarget() : NULL; + MTGAbility * a = NEW AAAlterRingTemptations(observer, id, card, t, temptations, NULL, who); + a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AAAlterRingTemptations*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } + return a; + } + //becomes monarch vector splitMonarch = parseBetween(s, "becomesmonarch", " ", false); if (splitMonarch.size()) @@ -4376,6 +4414,21 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return a; } + //becomes the Ring bearer + found = s.find("becomesringbearer"); + if (found != string::npos) + { + MTGAbility * a = NEW AARingBearerChosen(observer, id, card, target, NULL); + a->oneShot = 1; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AARingBearerChosen*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } + return a; + } + //set surveil offset of a player (eg. Enhanced Surveillance) vector splitSurveilOffset = parseBetween(s, "altersurvoffset:", " ", false); if (splitSurveilOffset.size()) diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 60d21bc10..34cecd325 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -267,7 +267,8 @@ const char* Constants::MTGBasicAbilities[] = { "poisonseventoxic", // Card has toxic 7 "poisoneighttoxic", // Card has toxic 8 "poisonninetoxic", // Card has toxic 9 - "poisontentoxic" // Card has toxic 10 + "poisontentoxic", // Card has toxic 10 + "ringbearer" // The creature is The Ring bearer. }; map Constants::MTGBasicAbilitiesMap; diff --git a/projects/mtg/src/Player.cpp b/projects/mtg/src/Player.cpp index 6c2376be7..a6b992a5a 100644 --- a/projects/mtg/src/Player.cpp +++ b/projects/mtg/src/Player.cpp @@ -37,6 +37,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck * energyCount = 0; experienceCount = 0; yidaroCount = 0; + ringTemptations = 0; dungeonCompleted = 0; numOfCommandCast = 0; monarch = 0; diff --git a/projects/mtg/src/Rules.cpp b/projects/mtg/src/Rules.cpp index b31a4614c..f82258b58 100644 --- a/projects/mtg/src/Rules.cpp +++ b/projects/mtg/src/Rules.cpp @@ -667,6 +667,7 @@ void Rules::initGame(GameObserver *g, bool currentPlayerSet) p->energyCount = initState.playerData[i].player->energyCount; p->experienceCount = initState.playerData[i].player->experienceCount; p->yidaroCount = initState.playerData[i].player->yidaroCount; + p->ringTemptations = initState.playerData[i].player->ringTemptations; p->dungeonCompleted = initState.playerData[i].player->dungeonCompleted; p->numOfCommandCast = initState.playerData[i].player->numOfCommandCast; p->monarch = initState.playerData[i].player->monarch; diff --git a/projects/mtg/src/WEvent.cpp b/projects/mtg/src/WEvent.cpp index dda563e40..738e42d23 100644 --- a/projects/mtg/src/WEvent.cpp +++ b/projects/mtg/src/WEvent.cpp @@ -317,6 +317,11 @@ WEventplayerMonarch::WEventplayerMonarch(Player * player) : { } +WEventplayerTempted::WEventplayerTempted(Player * player) : + player(player) +{ +} + WEventplayerProliferated::WEventplayerProliferated(Player * player) : player(player) { @@ -372,6 +377,11 @@ WEventCardExplored::WEventCardExplored(MTGCardInstance * card) : { } +WEventCardBearerChosen::WEventCardBearerChosen(MTGCardInstance * card) : + WEventCardUpdate(card) +{ +} + WEventCardDungeonCompleted::WEventCardDungeonCompleted(MTGCardInstance * card, int totaldng, string playerName) : WEventCardUpdate(card), totaldng(totaldng), playerName(playerName) { @@ -668,6 +678,12 @@ Targetable * WEventCardExplored::getTarget(int target) return NULL; } +Targetable * WEventCardBearerChosen::getTarget(int target) +{ + if (target) return card; + return NULL; +} + Targetable * WEventCardDungeonCompleted::getTarget(int target) { if (target) return card; @@ -716,6 +732,12 @@ Targetable * WEventplayerMonarch::getTarget(Player * player) return NULL; } +Targetable * WEventplayerTempted::getTarget(Player * player) +{ + if (player) return player; + return NULL; +} + Targetable * WEventplayerProliferated::getTarget(Player * player) { if (player) return player; diff --git a/projects/mtg/src/WParsedInt.cpp b/projects/mtg/src/WParsedInt.cpp index a4dd15be4..1f0e48ce2 100644 --- a/projects/mtg/src/WParsedInt.cpp +++ b/projects/mtg/src/WParsedInt.cpp @@ -1642,6 +1642,10 @@ void WParsedInt::extendedParse(string s, Spell * spell, MTGCardInstance * card) } } } + else if (s == "pringtemptations" || s == "oringtemptations") // How many times the player has been tempted by the Ring. + { + intValue = (s == "pringtemptations")?card->controller()->ringTemptations:card->controller()->opponent()->ringTemptations; + } else if(!intValue)//found nothing, try parsing a atoi { intValue = atoi(s.c_str());