Merge pull request #961 from kevlahnota/master

Totem Armor
This commit is contained in:
Anthony Calosa
2017-03-14 05:39:38 +08:00
committed by GitHub
15 changed files with 618 additions and 130 deletions
+140 -10
View File
@@ -10070,6 +10070,17 @@ power=2
toughness=2 toughness=2
[/card] [/card]
[card] [card]
name=Bear Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 2/2
auto=teach(creature) transforms((,newability[@combat(attacking) source(this):untap all(land|mybattlefield)]))
text=Enchant creature -- Enchanted creature gets +2/+2 and has "Whenever this creature attacks, untap all lands you control." -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={2}{G}{G}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Bearer of Overwhelming Truths name=Bearer of Overwhelming Truths
auto=@movedto(*[-creature|mystack):1/1 ueot auto=@movedto(*[-creature|mystack):1/1 ueot
auto=@combatdamaged(player) from(this):token(Clue,Artifact Clue,0/0) and!( transforms((,newability[{S}{2}:draw:1])) forever )! controller auto=@combatdamaged(player) from(this):token(Clue,Artifact Clue,0/0) and!( transforms((,newability[{S}{2}:draw:1])) forever )! controller
@@ -12980,6 +12991,16 @@ power=3
toughness=3 toughness=3
[/card] [/card]
[card] [card]
name=Boar Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 3/3
text=Enchant creature -- Enchanted creature gets +3/+3. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={2}{G}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Boartusk Liege name=Boartusk Liege
abilities=trample abilities=trample
auto=lord(other creature[red]|myBattlefield) 1/1 auto=lord(other creature[red]|myBattlefield) 1/1
@@ -23206,6 +23227,16 @@ power=6
toughness=6 toughness=6
[/card] [/card]
[card] [card]
name=Crab Umbra
abilities=totemarmor
target=creature
auto={2}{U}:untap(mytgt)
text=Enchant creature -- {2}{U}: Untap enchanted creature. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={U}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Crabapple Cohort name=Crabapple Cohort
auto=aslongas(other creature[green]|myBattlefield) 1/1 != 0 auto=aslongas(other creature[green]|myBattlefield) 1/1 != 0
text=Crabapple Cohort gets +1/+1 as long as you control another green creature. text=Crabapple Cohort gets +1/+1 as long as you control another green creature.
@@ -31510,6 +31541,17 @@ power=1
toughness=3 toughness=3
[/card] [/card]
[card] [card]
name=Drake Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 3/3
auto=teach(creature) flying
text=Enchant creature -- Enchanted creature gets +3/+3 and has flying. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={4}{U}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Drake-Skull Cameo name=Drake-Skull Cameo
auto={T}:Add{U} auto={T}:Add{U}
auto={T}:Add{B} auto={T}:Add{B}
@@ -34000,6 +34042,16 @@ power=2
toughness=2 toughness=2
[/card] [/card]
[card] [card]
name=Eel Umbra
abilities=flash,totemarmor
target=creature
auto=teach(creature) 1/1
text=Flash (You may cast this spell any time you could cast an instant.) -- Enchant creature -- Enchanted creature gets +1/+1. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={1}{U}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Eerie Interlude name=Eerie Interlude
target=<anyamount>creature|mybattlefield target=<anyamount>creature|mybattlefield
auto=(blink) auto=(blink)
@@ -34180,6 +34232,16 @@ mana={G}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
name=Eland Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 0/4
text=Enchant creature -- Enchanted creature gets +0/+4. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={1}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Elbrus, the Binding Blade name=Elbrus, the Binding Blade
auto={1}:equip auto={1}:equip
auto=teach(creature) 1/0 auto=teach(creature) 1/0
@@ -39643,6 +39705,17 @@ power=4
toughness=6 toughness=6
[/card] [/card]
[card] [card]
name=Felidar Umbra
abilities=totemarmor
target=creature
auto=teach(creature) lifelink
auto={1}{W}:rehook target(creature|mybattlefield)
text=Enchant creature -- Enchanted creature has lifelink. -- {1}{W}: Attach Felidar Umbra to target creature you control. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={1}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Fell Shepherd name=Fell Shepherd
auto=@combatdamaged(player) from(this):may name(Get All Creatures) moveto(myhand) all(creature[fresh]|mygraveyard) auto=@combatdamaged(player) from(this):may name(Get All Creatures) moveto(myhand) all(creature[fresh]|mygraveyard)
auto={b}{s(creature|mybattlefield)}:target(creature) -2/-2 ueot auto={b}{s(creature|mybattlefield)}:target(creature) -2/-2 ueot
@@ -48698,11 +48771,11 @@ type=Legendary Land
[card] [card]
name=Gods Willing name=Gods Willing
target=creature|mybattlefield target=creature|mybattlefield
auto=choice name(green) transforms((,newability[protection from green],newability[scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot auto=choice name(green) transforms((,newability[protection from green],newability[choice scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot
auto=choice name(red) transforms((,newability[protection from red],newability[scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot auto=choice name(red) transforms((,newability[protection from red],newability[choice scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot
auto=choice name(blue) transforms((,newability[protection from blue],newability[scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot auto=choice name(blue) transforms((,newability[protection from blue],newability[choice scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot
auto=choice name(black) transforms((,newability[protection from black],newability[scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot auto=choice name(black) transforms((,newability[protection from black],newability[choice scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot
auto=choice name(white) transforms((,newability[protection from white],newability[scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot auto=choice name(white) transforms((,newability[protection from white],newability[choice scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) ueot
text=Target creature you control gains protection from the color of your choice until end of turn. Scry 1. (Look at the top card of your library. You may put that card on the bottom of your library.) text=Target creature you control gains protection from the color of your choice until end of turn. Scry 1. (Look at the top card of your library. You may put that card on the bottom of your library.)
mana={W} mana={W}
type=Instant type=Instant
@@ -54244,6 +54317,7 @@ toughness=3
[card] [card]
name=Hero of Iroas name=Hero of Iroas
auto=lord(aura|mycastingzone) altercost(colorless,-1) auto=lord(aura|mycastingzone) altercost(colorless,-1)
auto=modbenchant(colorless:-1) controller
auto=@targeted(this) from(*[instant;sorcery;enchantment]|mycastingzone):counter(1/1,1) auto=@targeted(this) from(*[instant;sorcery;enchantment]|mycastingzone):counter(1/1,1)
text=Aura spells you cast cost 1 less to cast. -- Heroic -- Whenever you cast a spell that targets Hero of Iroas, put a +1/+1 counter on Hero of Iroas. text=Aura spells you cast cost 1 less to cast. -- Heroic -- Whenever you cast a spell that targets Hero of Iroas, put a +1/+1 counter on Hero of Iroas.
mana={1}{W} mana={1}{W}
@@ -56037,7 +56111,7 @@ toughness=3
[card] [card]
name=Hubris name=Hubris
target=creature|battlefield target=creature|battlefield
auto=transforms((,newability[moveto(ownerhand) all(children[aura]],newability[moveto(ownerhand)])) forever auto=transforms((,newability[moveto(ownerhand) all(mychild)],newability[moveto(ownerhand)])) forever
text=Return target creature and all Auras attached to it to their owners' hands. text=Return target creature and all Auras attached to it to their owners' hands.
mana={1}{U} mana={1}{U}
type=Instant type=Instant
@@ -56590,6 +56664,17 @@ mana={U}
type=Instant type=Instant
[/card] [/card]
[card] [card]
name=Hyena Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 1/1
auto=teach(creature) first strike
text=Enchant creature -- Enchanted creature gets +1/+1 and has first strike. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Hymn of Rebirth name=Hymn of Rebirth
target=creature|graveyard target=creature|graveyard
auto=moveTo(myBattlefield) auto=moveTo(myBattlefield)
@@ -57940,6 +58025,18 @@ power=4
toughness=4 toughness=4
[/card] [/card]
[card] [card]
name=Indrik Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 4/4
auto=teach(creature) first strike
auto=teach(creature) lure
text=Enchant creature -- Enchanted creature gets +4/+4 and has first strike, and all creatures able to block it do so. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={4}{G}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Induce Paranoia name=Induce Paranoia
target=*|stack target=*|stack
auto=if spent({B}) then transforms((,newability[deplete:manacost],newability[fizzle])) else fizzle auto=if spent({B}) then transforms((,newability[deplete:manacost],newability[fizzle])) else fizzle
@@ -70369,6 +70466,17 @@ type=Enchantment
subtype=Aura subtype=Aura
[/card] [/card]
[card] [card]
name=Mammoth Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 3/3
auto=teach(creature) vigilance
text=Enchant creature -- Enchanted creature gets +3/+3 and has vigilance. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={4}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Mana Bloom name=Mana Bloom
auto=counter(0/0,X,Charge) auto=counter(0/0,X,Charge)
auto={C(0/0,-1,Charge)}:Add{G} limit:1 auto={C(0/0,-1,Charge)}:Add{G} limit:1
@@ -80336,7 +80444,7 @@ subtype=Nissa
name=Nissa, Vastwood Seer name=Nissa, Vastwood Seer
aicode=activate target(forest[basic]|mylibrary) moveto(myhand) aicode=activate target(forest[basic]|mylibrary) moveto(myhand)
auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>forest[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 auto=name(search card) Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>forest[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
auto=@movedto(land|mybattlefield):moveto(exile) and!( moveto(ownerbattlefield) and!(flip(Nissa, Sage Animist) && counter(0/0,3,loyalty))! )! auto=@movedto(land|mybattlefield) restriction{type(land|mybattlefield)~morethan~6}:moveto(exile) and!( moveto(ownerbattlefield) and!(flip(Nissa, Sage Animist) && counter(0/0,3,loyalty))! )!
text=When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library. -- Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control. text=When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library. -- Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.
mana={2}{G} mana={2}{G}
type=Legendary Creature type=Legendary Creature
@@ -92319,7 +92427,7 @@ toughness=6
[/card] [/card]
[card] [card]
name=Raven Familiar name=Raven Familiar
abilities=hiddenface abilities=flying,hiddenface
auto=upcost[{2}{u};next upkeep] sacrifice auto=upcost[{2}{u};next upkeep] sacrifice
aicode=activate transforms((,newability[moveto(myhand) all(*[zpos=1]|mylibrary) && bottomoflibrary all(*[zpos<=2]|mylibrary)])) ueot aicode=activate transforms((,newability[moveto(myhand) all(*[zpos=1]|mylibrary) && bottomoflibrary all(*[zpos<=2]|mylibrary)])) ueot
auto=reveal:3 optionone name(Get a card) target(<1>*|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<3>*|reveal) bottomoflibrary optiontwoend revealend auto=reveal:3 optionone name(Get a card) target(<1>*|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<3>*|reveal) bottomoflibrary optiontwoend revealend
@@ -108617,6 +108725,17 @@ mana={3}{G}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
name=Snake Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 1/1
auto=teach(creature) transforms((,newability[@damagefoeof(player) from(this):may draw:1 controller]))
text=Enchant creature -- Enchanted creature gets +1/+1 and has "Whenever this creature deals damage to an opponent, you may draw a card." -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={2}{G}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Snakeform name=Snakeform
target=creature target=creature
auto=ueot loseabilities auto=ueot loseabilities
@@ -110991,6 +111110,17 @@ mana={4}{G}
type=Sorcery type=Sorcery
[/card] [/card]
[card] [card]
name=Spider Umbra
abilities=totemarmor
target=creature
auto=teach(creature) 1/1
auto=teach(creature) reach
text=Enchant creature -- Enchanted creature gets +1/+1 and has reach. (It can block creatures with flying.) -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={G}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Spidersilk Armor name=Spidersilk Armor
auto=lord(creature|myBattlefield) 0/1 auto=lord(creature|myBattlefield) 0/1
auto=lord(creature|myBattlefield) reach auto=lord(creature|myBattlefield) reach
@@ -114621,7 +114751,7 @@ type=Instant
[/card] [/card]
[card] [card]
name=Street Sweeper name=Street Sweeper
auto=@combat(attacking) source(this) restriction{type(land[enchanted]|battlefield)~morethan~0}:name(destroy auras) target(land[enchanted]|battlefield) transforms((,newability[destroy all(children[aura])])) auto=@combat(attacking) source(this) restriction{type(land[enchanted]|battlefield)~morethan~0}:name(destroy auras) target(land[enchanted]|battlefield) transforms((,newability[destroy all(mychild)]))
text=Whenever Street Sweeper attacks, destroy all Auras attached to target land. text=Whenever Street Sweeper attacks, destroy all Auras attached to target land.
mana={6} mana={6}
type=Artifact Creature type=Artifact Creature
@@ -122684,7 +122814,7 @@ toughness=5
[card] [card]
name=Tormented Hero name=Tormented Hero
auto=tap(noevent) auto=tap(noevent)
auto=@targeted(this) from(*|nonbattlezone):lifeleech:-1 opponent auto=@targeted(this) from(*|mycastingzone):lifeleech:-1 opponent
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. 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} mana={B}
type=Creature type=Creature
@@ -1018,13 +1018,6 @@ power=1
toughness=3 toughness=3
[/card] [/card]
[card] [card]
name=Bear Umbra
text=Enchant creature -- Enchanted creature gets +2/+2 and has "Whenever this creature attacks, untap all lands you control." -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={2}{G}{G}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Bearer of Silence name=Bearer of Silence
text=Devoid (This card has no color.) -- When you cast Bearer of Silence, you may pay {1}{C}. If you do, target opponent sacrifices a creature. ({C} represents colorless mana.) -- Flying -- Bearer of Silence can't block. text=Devoid (This card has no color.) -- When you cast Bearer of Silence, you may pay {1}{C}. If you do, target opponent sacrifices a creature. ({C} represents colorless mana.) -- Flying -- Bearer of Silence can't block.
mana={1}{B} mana={1}{B}
@@ -1294,13 +1287,6 @@ mana={2}{R}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
name=Boar Umbra
text=Enchant creature -- Enchanted creature gets +3/+3. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={2}{G}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Bog Hoodlums name=Bog Hoodlums
text=Bog Hoodlums can't block. -- When Bog Hoodlums enters the battlefield, clash with an opponent. If you win, put a +1/+1 counter on Bog Hoodlums. (Each clashing player reveals the top card of his or her library, then puts that card on the top or bottom. A player wins if his or her card had a higher converted mana cost.) text=Bog Hoodlums can't block. -- When Bog Hoodlums enters the battlefield, clash with an opponent. If you win, put a +1/+1 counter on Bog Hoodlums. (Each clashing player reveals the top card of his or her library, then puts that card on the top or bottom. A player wins if his or her card had a higher converted mana cost.)
mana={5}{B} mana={5}{B}
@@ -2864,13 +2850,6 @@ type=Enchantment
subtype=Aura subtype=Aura
[/card] [/card]
[card] [card]
name=Crab Umbra
text=Enchant creature -- {2}{U}: Untap enchanted creature. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={U}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Cragganwick Cremator name=Cragganwick Cremator
text=When Cragganwick Cremator enters the battlefield, discard a card at random. If you discard a creature card this way, Cragganwick Cremator deals damage equal to that card's power to target player. text=When Cragganwick Cremator enters the battlefield, discard a card at random. If you discard a creature card this way, Cragganwick Cremator deals damage equal to that card's power to target player.
mana={2}{R}{R} mana={2}{R}{R}
@@ -3978,13 +3957,6 @@ mana={U}{U}
type=Sorcery type=Sorcery
[/card] [/card]
[card] [card]
name=Drake Umbra
text=Enchant creature -- Enchanted creature gets +3/+3 and has flying. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={4}{U}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Dralnu, Lich Lord name=Dralnu, Lich Lord
text=If damage would be dealt to Dralnu, Lich Lord, sacrifice that many permanents instead. -- {T}: Target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (You may cast that card from your graveyard for its flashback cost. Then exile it.) text=If damage would be dealt to Dralnu, Lich Lord, sacrifice that many permanents instead. -- {T}: Target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (You may cast that card from your graveyard for its flashback cost. Then exile it.)
mana={3}{U}{B} mana={3}{U}{B}
@@ -4162,20 +4134,6 @@ type=Plane
subtype=Belenon subtype=Belenon
[/card] [/card]
[card] [card]
name=Eel Umbra
text=Flash (You may cast this spell any time you could cast an instant.) -- Enchant creature -- Enchanted creature gets +1/+1. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={1}{U}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Eland Umbra
text=Enchant creature -- Enchanted creature gets +0/+4. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={1}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Elderwood Scion name=Elderwood Scion
text=Trample, lifelink -- Spells you cast that target Elderwood Scion cost {2} less to cast. -- Spells your opponents cast that target Elderwood Scion cost {2} more to cast. text=Trample, lifelink -- Spells you cast that target Elderwood Scion cost {2} less to cast. -- Spells your opponents cast that target Elderwood Scion cost {2} more to cast.
mana={3}{G}{W} mana={3}{G}{W}
@@ -4803,13 +4761,6 @@ mana={R}
type=Instant type=Instant
[/card] [/card]
[card] [card]
name=Felidar Umbra
text=Enchant creature -- Enchanted creature has lifelink. -- {1}{W}: Attach Felidar Umbra to target creature you control. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={1}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Fell the Mighty name=Fell the Mighty
text=Destroy all creatures with power greater than target creature's power. text=Destroy all creatures with power greater than target creature's power.
mana={4}{W} mana={4}{W}
@@ -6943,13 +6894,6 @@ power=3
toughness=3 toughness=3
[/card] [/card]
[card] [card]
name=Hyena Umbra
text=Enchant creature -- Enchanted creature gets +1/+1 and has first strike. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Hymn of the Wilds name=Hymn of the Wilds
text=(Start the game with this conspiracy face up in the command zone.) -- The first creature spell you cast each turn costs {1} less to cast. -- You can't cast instant or sorcery spells. text=(Start the game with this conspiracy face up in the command zone.) -- The first creature spell you cast each turn costs {1} less to cast. -- You can't cast instant or sorcery spells.
type=Conspiracy type=Conspiracy
@@ -7253,13 +7197,6 @@ mana={3}{G}{G}
type=Sorcery type=Sorcery
[/card] [/card]
[card] [card]
name=Indrik Umbra
text=Enchant creature -- Enchanted creature gets +4/+4 and has first strike, and all creatures able to block it do so. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={4}{G}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Induce Despair name=Induce Despair
text=As an additional cost to cast Induce Despair, reveal a creature card from your hand. -- Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost. text=As an additional cost to cast Induce Despair, reveal a creature card from your hand. -- Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost.
mana={2}{B} mana={2}{B}
@@ -8966,13 +8903,6 @@ power=*
toughness=* toughness=*
[/card] [/card]
[card] [card]
name=Mammoth Umbra
text=Enchant creature -- Enchanted creature gets +3/+3 and has vigilance. -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={4}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Mana Cache name=Mana Cache
text=At the beginning of each player's end step, put a charge counter on Mana Cache for each untapped land that player controls. -- Remove a charge counter from Mana Cache: Add {1} to your mana pool. Any player may activate this ability but only during his or her turn before the end step. text=At the beginning of each player's end step, put a charge counter on Mana Cache for each untapped land that player controls. -- Remove a charge counter from Mana Cache: Add {1} to your mana pool. Any player may activate this ability but only during his or her turn before the end step.
mana={1}{R}{R} mana={1}{R}{R}
@@ -14358,13 +14288,6 @@ power=2
toughness=2 toughness=2
[/card] [/card]
[card] [card]
name=Snake Umbra
text=Enchant creature -- Enchanted creature gets +1/+1 and has "Whenever this creature deals damage to an opponent, you may draw a card." -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={2}{G}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Snow Mercy name=Snow Mercy
text=Whenever a creature deals damage to you, put a globe counter on it. -- {T}, {untap}, {T}, {untap}, {T}: Tap all creatures with globe counters on them. text=Whenever a creature deals damage to you, put a globe counter on it. -- {T}, {untap}, {T}, {untap}, {T}: Tap all creatures with globe counters on them.
mana={2}{W}{W} mana={2}{W}{W}
@@ -14811,13 +14734,6 @@ type=Enchantment
subtype=Aura subtype=Aura
[/card] [/card]
[card] [card]
name=Spider Umbra
text=Enchant creature -- Enchanted creature gets +1/+1 and has reach. (It can block creatures with flying.) -- Totem armor (If enchanted creature would be destroyed, instead remove all damage from it and destroy this Aura.)
mana={G}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Spike Cannibal name=Spike Cannibal
text=Spike Cannibal enters the battlefield with a +1/+1 counter on it. -- When Spike Cannibal enters the battlefield, move all +1/+1 counters from all creatures onto it. text=Spike Cannibal enters the battlefield with a +1/+1 counter on it. -- When Spike Cannibal enters the battlefield, move all +1/+1 counters from all creatures onto it.
mana={1}{B}{B} mana={1}{B}{B}
+101
View File
@@ -4539,6 +4539,23 @@ public:
} }
}; };
//Extra for Bestow cards
class AAuraIncreaseReduce: public AbilityTP
{
public:
MTGCardInstance * manaReducer;
int amount;
int color;
AAuraIncreaseReduce(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int amount, int color, int who = TargetChooser::UNSET);
int addToGame();
int destroy();
int testDestroy();
const string getMenuText();
AAuraIncreaseReduce * clone() const;
//~AAuraIncreaseReduce();
};
//Modify Hand //Modify Hand
class AModifyHand: public AbilityTP class AModifyHand: public AbilityTP
{ {
@@ -7236,6 +7253,90 @@ public:
} }
}; };
//------------------ //------------------
//trigger regen
class ATriggerRegen: public InstantAbility
{
public:
ATriggerRegen(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
InstantAbility(observer, _id, _source)
{
target = _target;
}
int resolve()
{
MTGCardInstance * card = (MTGCardInstance *) target;
if (card)
{
if (!card->regenerateTokens)
return 0;
if (card->has(Constants::CANTREGEN))
return 0;
card->regenerateTokens--;
card->tap();
if(card->isCreature())
{
card->life = card->toughness;
card->initAttackersDefensers();
if (card->life < 1)
return 0; //regeneration didn't work (wither ?)
}
}
return 1;
}
const string getMenuText()
{
return "Regenerate";
}
virtual ostream& toString(ostream& out) const
{
out << "AATriggerRegen ::: (";
return InstantAbility::toString(out) << ")";
}
ATriggerRegen * clone() const
{
return NEW ATriggerRegen(*this);
}
};
//trigger totem
class ATriggerTotem: public InstantAbility
{
public:
ATriggerTotem(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
InstantAbility(observer, _id, _source)
{
target = _target;
}
int resolve()
{
MTGCardInstance * card = (MTGCardInstance *) target;
if (card)
{
card->destroy();
if(source->isCreature())
{
source->life = source->toughness;
if (source->life < 1)
return 0; //regeneration didn't work (wither ?)
}
}
return 1;
}
const string getMenuText()
{
return "Totem Armor";
}
virtual ostream& toString(ostream& out) const
{
out << "AATriggerTotem ::: (";
return InstantAbility::toString(out) << ")";
}
ATriggerTotem * clone() const
{
return NEW ATriggerTotem(*this);
}
};
// utility functions // utility functions
void PopulateColorIndexVector(list<int>& colors, const string& colorsString, char delimiter = ','); void PopulateColorIndexVector(list<int>& colors, const string& colorsString, char delimiter = ',');
+6 -2
View File
@@ -128,6 +128,7 @@ public:
MTGCardInstance * tokCard; MTGCardInstance * tokCard;
MTGCardInstance * previous; MTGCardInstance * previous;
MTGCardInstance * next; MTGCardInstance * next;
MTGCardInstance * auraParent;
MTGAbility * TokenAndAbility; MTGAbility * TokenAndAbility;
MTGAbility * GrantedAndAbility; MTGAbility * GrantedAndAbility;
int doDamageTest; int doDamageTest;
@@ -138,6 +139,7 @@ public:
ManaCost * getReducedManaCost(); ManaCost * getReducedManaCost();
ManaCost * getIncreasedManaCost(); ManaCost * getIncreasedManaCost();
bool matchesCastFilter(int castMethod); bool matchesCastFilter(int castMethod);
bool hasTotemArmor();
// The recommended method to test for summoning Sickness ! // The recommended method to test for summoning Sickness !
int hasSummoningSickness(); int hasSummoningSickness();
@@ -202,8 +204,10 @@ public:
Player * controller(); Player * controller();
virtual ~MTGCardInstance(); virtual ~MTGCardInstance();
int bury(); int totem( bool noregen = false );
int toGrave( bool forced = false );
int destroy(); int destroy();
int destroyNoRegen();
int addToToughness(int value); int addToToughness(int value);
int setToughness(int value); int setToughness(int value);
@@ -276,7 +280,7 @@ public:
int forcedBorderA; int forcedBorderA;
int forcedBorderB; int forcedBorderB;
int myconvertedcost; int myconvertedcost;
ManaCost * computeNewCost(MTGCardInstance * card,ManaCost * oldCost, ManaCost * refCost,bool noTrinisphere = false); ManaCost * computeNewCost(MTGCardInstance * card,ManaCost * oldCost, ManaCost * refCost,bool noTrinisphere = false, bool bestow = false);
int countTrini; int countTrini;
bool anymanareplacement; bool anymanareplacement;
vector<MTGCardInstance*>imprintedCards; vector<MTGCardInstance*>imprintedCards;
+2 -1
View File
@@ -274,7 +274,8 @@ class Constants
CANPLAYINSTANTSORCERYTOPLIBRARY = 152,//instantorsorcery CANPLAYINSTANTSORCERYTOPLIBRARY = 152,//instantorsorcery
SHOWFROMTOPLIBRARY = 153, SHOWFROMTOPLIBRARY = 153,
SHOWOPPONENTTOPLIBRARY = 154, SHOWOPPONENTTOPLIBRARY = 154,
NB_BASIC_ABILITIES = 155, TOTEMARMOR = 155,
NB_BASIC_ABILITIES = 156,
RARITY_S = 'S', //Special Rarity RARITY_S = 'S', //Special Rarity
RARITY_M = 'M', //Mythics RARITY_M = 'M', //Mythics
+2
View File
@@ -87,6 +87,8 @@ public:
bool DeadLifeState(bool check = false); bool DeadLifeState(bool check = false);
ManaCost * doesntEmpty; ManaCost * doesntEmpty;
ManaCost * poolDoesntEmpty; ManaCost * poolDoesntEmpty;
ManaCost * AuraIncreased;
ManaCost * AuraReduced;
void cleanupPhase(); void cleanupPhase();
virtual int Act(float) virtual int Act(float)
{ {
+40
View File
@@ -357,4 +357,44 @@ public:
virtual bool equals(TargetChooser * tc); virtual bool equals(TargetChooser * tc);
~ParentChildChooser(); ~ParentChildChooser();
}; };
class ChildrenChooser: public TypeTargetChooser
{
public:
bool withoutProtections;
ChildrenChooser(GameObserver *observer, int * _zones, int _nbzones, MTGCardInstance * card = NULL, int _maxtargets = 1, bool other = false, bool targetMin = false) :
TypeTargetChooser(observer, "*",_zones, _nbzones, card, _maxtargets, other, targetMin)
{
}
;
ChildrenChooser(GameObserver *observer, MTGCardInstance * card = NULL, int _maxtargets = 1, bool other = false,bool targetMin = false) :
TypeTargetChooser(observer, "*", card, _maxtargets, other,targetMin)
{
}
;
virtual bool canTarget(Targetable * target, bool withoutProtections = false);
virtual ChildrenChooser * clone() const;
virtual bool equals(TargetChooser * tc);
~ChildrenChooser();
};
class TotemChooser: public TypeTargetChooser
{
public:
bool withoutProtections;
TotemChooser(GameObserver *observer, int * _zones, int _nbzones, MTGCardInstance * card = NULL, int _maxtargets = 1, bool other = false, bool targetMin = false) :
TypeTargetChooser(observer, "*",_zones, _nbzones, card, _maxtargets, other, targetMin)
{
}
;
TotemChooser(GameObserver *observer, MTGCardInstance * card = NULL, int _maxtargets = 1, bool other = false,bool targetMin = false) :
TypeTargetChooser(observer, "*", card, _maxtargets, other,targetMin)
{
}
;
virtual bool canTarget(Targetable * target, bool withoutProtections = false);
virtual TotemChooser * clone() const;
virtual bool equals(TargetChooser * tc);
~TotemChooser();
};
#endif #endif
+85 -1
View File
@@ -2855,7 +2855,13 @@ int AABuryCard::resolve()
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
if (_target) if (_target)
{ {
_target->bury(); //Bury (Obsolete)
//A term that meant “put [a permanent] into its owners graveyard.”
//In general, cards that were printed with the term “bury” have received errata
//in the Oracle card reference to read, “Destroy [a permanent]. It cant be regenerated,”
//or “Sacrifice [a permanent].”
//_target->bury();
_target->destroyNoRegen();//so totem armor will take effect on wrath effects since totem armor is not regeneration..
while(_target->next) while(_target->next)
_target = _target->next; _target = _target->next;
if(andAbility) if(andAbility)
@@ -3221,6 +3227,10 @@ int AANewTarget::resolve()
while (_target->next) while (_target->next)
_target = _target->next; _target = _target->next;
} }
if(_target->hasSubtype(Subtypes::TYPE_AURA))
{
_target->target = source;
}
if(_target->hasSubtype(Subtypes::TYPE_EQUIPMENT)) if(_target->hasSubtype(Subtypes::TYPE_EQUIPMENT))
{ {
for (size_t i = 1; i < game->mLayers->actionLayer()->mObjects.size(); i++) for (size_t i = 1; i < game->mLayers->actionLayer()->mObjects.size(); i++)
@@ -4044,6 +4054,80 @@ AALifer * AALifer::clone() const
return NEW AALifer(*this); return NEW AALifer(*this);
} }
//Extra for Bestow ... partial fix since there's no update when react to click for bestow cards...
//There should be no problem if the bestow cards has chosen mode then update its bestow code on react to click but
//I cant find alternate way... This Ability is general for enchantments since aura is an enchantment type however
//it can't target card specific attributes... This one adds on the players side...
AAuraIncreaseReduce::AAuraIncreaseReduce(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int amount, int color, int who) :
AbilityTP(observer, _id, _source, _target, who), amount(amount), color(color)
{
manaReducer = source;
}
int AAuraIncreaseReduce::addToGame()
{
Damageable * _target = (Damageable *) getTarget();
Player * p = getPlayerFromDamageable(_target);
if (!p)
return 0;
if (amount > 0)
{
p->AuraIncreased->add(color,amount);
}
else
{
p->AuraReduced->add(color,abs(amount));
}
return MTGAbility::addToGame();
}
int AAuraIncreaseReduce::destroy()
{
Damageable * _target = (Damageable *) getTarget();
Player * p = getPlayerFromDamageable(_target);
if (!p)
return 0;
if(!this->manaReducer->isInPlay(game))
{
if (amount > 0)
{
p->AuraIncreased->remove(color,amount);
}
else
{
p->AuraReduced->remove(color,abs(amount));
}
return MTGAbility::testDestroy();
}
return 0;
}
int AAuraIncreaseReduce::testDestroy()
{
if(!this->manaReducer->isInPlay(game))
{
return MTGAbility::testDestroy();
}
return 0;
}
const string AAuraIncreaseReduce::getMenuText()
{
return "Aura Increaser/Reducer";
}
AAuraIncreaseReduce * AAuraIncreaseReduce::clone() const
{
return NEW AAuraIncreaseReduce(*this);
}
//players modify hand size //players modify hand size
AModifyHand::AModifyHand(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, string hand, int who) : AModifyHand::AModifyHand(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, string hand, int who) :
AbilityTP(observer, _id, _source, _target, who), hand(hand) AbilityTP(observer, _id, _source, _target, who), hand(hand)
+20 -22
View File
@@ -1142,6 +1142,7 @@ void GameObserver::enchantmentStatus()
{ {
card->target->enchanted = true; card->target->enchanted = true;
card->target->auras += 1; card->target->auras += 1;
card->auraParent = card->target;
} }
} }
} }
@@ -1161,6 +1162,7 @@ void GameObserver::Affinity()
if (!card) if (!card)
continue; continue;
bool checkAuraP = false;
/////////////////////////// ///////////////////////////
//reset extracost shadows// //reset extracost shadows//
/////////////////////////// ///////////////////////////
@@ -1185,6 +1187,10 @@ void GameObserver::Affinity()
///we handle trisnisphere seperately because its a desaster. ///we handle trisnisphere seperately because its a desaster.
if(card->getManaCost())//make sure we check, abiliy$!/token dont have a mancost object. if(card->getManaCost())//make sure we check, abiliy$!/token dont have a mancost object.
{ {
if (card->controller()->AuraIncreased->getConvertedCost() || card->controller()->AuraReduced->getConvertedCost())
if(card->model->data->getManaCost()->getBestow())
checkAuraP = true;
//change cost to colorless for anytypeofmana ability //change cost to colorless for anytypeofmana ability
if(card->has(Constants::ANYTYPEOFMANA)) if(card->has(Constants::ANYTYPEOFMANA))
{ {
@@ -1246,7 +1252,7 @@ void GameObserver::Affinity()
card->has(Constants::CONDUITED) || card->has(Constants::CONDUITED) ||
card->getIncreasedManaCost()->getConvertedCost() || card->getIncreasedManaCost()->getConvertedCost() ||
card->getReducedManaCost()->getConvertedCost() || card->getReducedManaCost()->getConvertedCost() ||
NewAffinityFound) NewAffinityFound || checkAuraP)
&& &&
AffinityNeedsUpdate AffinityNeedsUpdate
) )
@@ -1258,59 +1264,51 @@ void GameObserver::Affinity()
//only do any of the following if a card with the stated ability is in your hand. //only do any of the following if a card with the stated ability is in your hand.
//kicker is an addon to normal cost, suspend is not casting. add cost as needed EXACTLY as seen below. //kicker is an addon to normal cost, suspend is not casting. add cost as needed EXACTLY as seen below.
card->getManaCost()->resetCosts(); card->getManaCost()->resetCosts();
ManaCost *newCost = NEW ManaCost(); ManaCost *newCost = NEW ManaCost(card->computeNewCost(card, card->getManaCost(), card->model->data->getManaCost()));
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost(), card->model->data->getManaCost()));
card->getManaCost()->changeCostTo(newCost); card->getManaCost()->changeCostTo(newCost);
SAFE_DELETE(newCost); SAFE_DELETE(newCost);
if (card->getManaCost()->getAlternative()) if (card->getManaCost()->getAlternative())
{ {
card->getManaCost()->getAlternative()->resetCosts(); card->getManaCost()->getAlternative()->resetCosts();
ManaCost * newCost = NEW ManaCost(); ManaCost *newCost = NEW ManaCost(card->computeNewCost(card, card->getManaCost()->getAlternative(), card->model->data->getManaCost()->getAlternative()));
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getAlternative(), card->model->data->getManaCost()->getAlternative()));
card->getManaCost()->getAlternative()->changeCostTo(newCost); card->getManaCost()->getAlternative()->changeCostTo(newCost);
SAFE_DELETE(newCost); SAFE_DELETE(newCost);
} }
if (card->getManaCost()->getBestow()) if (card->getManaCost()->getBestow())
{ {
card->getManaCost()->getBestow()->resetCosts(); card->getManaCost()->getBestow()->resetCosts();
ManaCost * newCost = NEW ManaCost(); ManaCost *newCost = NEW ManaCost(card->computeNewCost(card, card->getManaCost()->getBestow(), card->model->data->getManaCost()->getBestow(),false,true));
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getBestow(), card->model->data->getManaCost()->getBestow()));
card->getManaCost()->getBestow()->changeCostTo(newCost); card->getManaCost()->getBestow()->changeCostTo(newCost);
SAFE_DELETE(newCost); SAFE_DELETE(newCost);
} }
if (card->getManaCost()->getRetrace())
{
card->getManaCost()->getRetrace()->resetCosts();
ManaCost * newCost = NEW ManaCost();
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getRetrace(), card->model->data->getManaCost()->getRetrace()));
card->getManaCost()->getRetrace()->changeCostTo(newCost);
SAFE_DELETE(newCost);
}
if (card->getManaCost()->getBuyback()) if (card->getManaCost()->getBuyback())
{ {
card->getManaCost()->getBuyback()->resetCosts(); card->getManaCost()->getBuyback()->resetCosts();
ManaCost * newCost = NEW ManaCost(); ManaCost *newCost = NEW ManaCost(card->computeNewCost(card, card->getManaCost()->getBuyback(), card->model->data->getManaCost()->getBuyback()));
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getBuyback(), card->model->data->getManaCost()->getBuyback()));
card->getManaCost()->getBuyback()->changeCostTo(newCost); card->getManaCost()->getBuyback()->changeCostTo(newCost);
SAFE_DELETE(newCost); SAFE_DELETE(newCost);
} }
if (card->getManaCost()->getFlashback()) if (card->getManaCost()->getFlashback())
{ {
card->getManaCost()->getFlashback()->resetCosts(); card->getManaCost()->getFlashback()->resetCosts();
ManaCost * newCost = NEW ManaCost(); ManaCost *newCost = NEW ManaCost(card->computeNewCost(card, card->getManaCost()->getFlashback(), card->model->data->getManaCost()->getFlashback()));
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getFlashback(), card->model->data->getManaCost()->getFlashback()));
card->getManaCost()->getFlashback()->changeCostTo(newCost); card->getManaCost()->getFlashback()->changeCostTo(newCost);
SAFE_DELETE(newCost); SAFE_DELETE(newCost);
} }
if (card->getManaCost()->getMorph()) if (card->getManaCost()->getMorph())
{ {
card->getManaCost()->getMorph()->resetCosts(); card->getManaCost()->getMorph()->resetCosts();
ManaCost * newCost = NEW ManaCost(); ManaCost *newCost = NEW ManaCost(card->computeNewCost(card, card->getManaCost()->getMorph(), card->model->data->getManaCost()->getMorph()));
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getMorph(), card->model->data->getManaCost()->getMorph()));
card->getManaCost()->getMorph()->changeCostTo(newCost); card->getManaCost()->getMorph()->changeCostTo(newCost);
SAFE_DELETE(newCost); SAFE_DELETE(newCost);
} }
if (card->getManaCost()->getRetrace())
{
card->getManaCost()->getRetrace()->resetCosts();
ManaCost *newCost = NEW ManaCost(card->computeNewCost(card, card->getManaCost()->getRetrace(), card->model->data->getManaCost()->getRetrace()));
card->getManaCost()->getRetrace()->changeCostTo(newCost);
SAFE_DELETE(newCost);
}
}//end }//end
} }
+20
View File
@@ -3196,6 +3196,26 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a; return a;
} }
//Extra for Bestow
vector<string> splitAuraIncreaseReduce = parseBetween(s, "modbenchant(", ")", true);
if(splitAuraIncreaseReduce.size())
{
if(splitAuraIncreaseReduce[1].size())
{
Damageable * t = spell ? spell->getNextDamageableTarget() : NULL;
vector<string> ccParameters = split( splitAuraIncreaseReduce[1], ':');
int amount = atoi(ccParameters[1].c_str());
int color = Constants::GetColorStringIndex(ccParameters[0]);
if(ccParameters[0] == "colorless")
color = 0;
if(ccParameters[0].size() && ccParameters[1].size())
{
MTGAbility * a = NEW AAuraIncreaseReduce(observer, id, card, t, amount, color, who);
return a;
}
}
}
//set hand size //set hand size
vector<string> splitSetHand = parseBetween(s, "sethand:", " ", false); vector<string> splitSetHand = parseBetween(s, "sethand:", " ", false);
if (splitSetHand.size()) if (splitSetHand.size())
+96 -6
View File
@@ -303,6 +303,7 @@ void MTGCardInstance::initMTGCI()
tokCard = NULL; tokCard = NULL;
previous = NULL; previous = NULL;
next = NULL; next = NULL;
auraParent = NULL;
TokenAndAbility = NULL; TokenAndAbility = NULL;
GrantedAndAbility = NULL; GrantedAndAbility = NULL;
lastController = NULL; lastController = NULL;
@@ -444,7 +445,51 @@ int MTGCardInstance::afterDamage()
return 0; return 0;
} }
int MTGCardInstance::bury() int MTGCardInstance::totem(bool noregen)
{
int testToughness = toughness;
testToughness += tbonus;
if(testToughness < 1)
{
if(noregen)
return toGrave();
else if (!triggerRegenerate())
return toGrave();
return 0;
}
bool canregen = (regenerateTokens && !has(Constants::CANTREGEN) && !noregen);
vector<MTGAbility*>selection;
TargetChooserFactory tf(getObserver());
TargetChooser * tcb = tf.createTargetChooser("mytotem",this);
tcb->targetter = NULL;
tcb->maxtargets = 1;
MTGAbility * destroyTotem = NEW ATriggerTotem(getObserver(), getObserver()->mLayers->actionLayer()->getMaxId(),this,NULL);
destroyTotem->oneShot = true;
destroyTotem->canBeInterrupted = false;
MTGAbility * dtTarget = NEW GenericTargetAbility(getObserver(), "","",getObserver()->mLayers->actionLayer()->getMaxId(), this,tcb->clone(), destroyTotem->clone());
SAFE_DELETE(destroyTotem);
dtTarget->oneShot = true;
dtTarget->canBeInterrupted = false;
MTGAbility * addTotemtoGame = NEW GenericAddToGame(getObserver(), getObserver()->mLayers->actionLayer()->getMaxId(), this,NULL,dtTarget->clone());
SAFE_DELETE(dtTarget);
addTotemtoGame->oneShot = true;
addTotemtoGame->canBeInterrupted = false;
selection.push_back(addTotemtoGame->clone());
SAFE_DELETE(addTotemtoGame);
SAFE_DELETE(tcb);
if(canregen)
{
MTGAbility * triggerRegen = NEW ATriggerRegen(getObserver(), getObserver()->mLayers->actionLayer()->getMaxId(), this, this);
triggerRegen->oneShot = true;
triggerRegen->canBeInterrupted = false;
selection.push_back(triggerRegen->clone());
SAFE_DELETE(triggerRegen);
}
MTGAbility * menuChoice = NEW MenuAbility(getObserver(), getObserver()->mLayers->actionLayer()->getMaxId(), NULL, this,true,selection,this->controller(),"");
menuChoice->addToGame();
return 1;
}
int MTGCardInstance::toGrave( bool forced )
{ {
Player * p = controller(); Player * p = controller();
if (basicAbilities[(int)Constants::EXILEDEATH]) if (basicAbilities[(int)Constants::EXILEDEATH])
@@ -457,15 +502,29 @@ int MTGCardInstance::bury()
p->game->putInZone(this, p->game->inPlay, owner->game->graveyard); p->game->putInZone(this, p->game->inPlay, owner->game->graveyard);
return 1; return 1;
} }
if (forced)
{
p->game->putInZone(this, p->game->inPlay, owner->game->graveyard);
return 1;
}
return 0; return 0;
} }
int MTGCardInstance::destroy() int MTGCardInstance::destroy()
{ {
if (!triggerRegenerate()) if (hasTotemArmor())
return bury(); return totem();
else if (!triggerRegenerate())
return toGrave();
return 0;
}
int MTGCardInstance::destroyNoRegen()
{
if (hasTotemArmor())
return totem(true);
else
return toGrave();
return 0; return 0;
} }
MTGGameZone * MTGCardInstance::getCurrentZone() MTGGameZone * MTGCardInstance::getCurrentZone()
{ {
return currentZone; return currentZone;
@@ -1059,7 +1118,7 @@ JQuadPtr MTGCardInstance::getIcon()
return WResourceManager::Instance()->RetrieveCard(this, CACHE_THUMB); return WResourceManager::Instance()->RetrieveCard(this, CACHE_THUMB);
} }
ManaCost * MTGCardInstance::computeNewCost(MTGCardInstance * card,ManaCost * Cost, ManaCost * Data, bool noTrinisphere) ManaCost * MTGCardInstance::computeNewCost(MTGCardInstance * card,ManaCost * Cost, ManaCost * Data, bool noTrinisphere, bool bestow)
{ {
int color = 0; int color = 0;
string type = ""; string type = "";
@@ -1074,10 +1133,13 @@ ManaCost * MTGCardInstance::computeNewCost(MTGCardInstance * card,ManaCost * Cos
Cost->extraCosts->costs[i]->setSource(card); Cost->extraCosts->costs[i]->setSource(card);
} }
} }
if (card->getIncreasedManaCost()->getConvertedCost() || card->getReducedManaCost()->getConvertedCost()) if (card->getIncreasedManaCost()->getConvertedCost() || card->getReducedManaCost()->getConvertedCost()
|| card->controller()->AuraReduced->getConvertedCost() || card->controller()->AuraIncreased->getConvertedCost())
{//start1 {//start1
if (card->getIncreasedManaCost()->getConvertedCost()) if (card->getIncreasedManaCost()->getConvertedCost())
original->add(card->getIncreasedManaCost()); original->add(card->getIncreasedManaCost());
if(bestow && card->controller()->AuraIncreased->getConvertedCost())
original->add(card->controller()->AuraIncreased);
//before removing get the diff for excess //before removing get the diff for excess
if(card->getReducedManaCost()->getConvertedCost()) if(card->getReducedManaCost()->getConvertedCost())
{ {
@@ -1093,6 +1155,8 @@ ManaCost * MTGCardInstance::computeNewCost(MTGCardInstance * card,ManaCost * Cos
//apply reduced //apply reduced
if (card->getReducedManaCost()->getConvertedCost()) if (card->getReducedManaCost()->getConvertedCost())
original->remove(card->getReducedManaCost()); original->remove(card->getReducedManaCost());
if(bestow && card->controller()->AuraReduced->getConvertedCost())
original->remove(card->controller()->AuraReduced);
//try to reduce hybrid //try to reduce hybrid
if (excess->getConvertedCost()) if (excess->getConvertedCost())
{ {
@@ -1519,6 +1583,32 @@ bool MTGCardInstance::matchesCastFilter(int castFilter) {
return (castFilter == castMethod); return (castFilter == castMethod);
}; };
bool MTGCardInstance::hasTotemArmor()
{
int count = 0;
if(observer)
{
for (int i = 0; i < 2; i++)
{
int nb_cards = observer->players[i]->game->battlefield->nb_cards;
for(int x = 0; x < nb_cards; x++)
{
if(observer->players[i]->game->battlefield->cards[x]->auraParent)
{
if(observer->players[i]->game->battlefield->cards[x]->auraParent == this &&
observer->players[i]->game->battlefield->cards[x]->has(Constants::TOTEMARMOR))
count+=1;
}
}
}
}
if(count)
return true;
return false;
}
int MTGCardInstance::addProtection(TargetChooser * tc) int MTGCardInstance::addProtection(TargetChooser * tc)
{ {
tc->targetter = NULL; tc->targetter = NULL;
+2 -1
View File
@@ -185,7 +185,8 @@ const char* Constants::MTGBasicAbilities[] = {
"canplayartifactlibrarytop",//artifact "canplayartifactlibrarytop",//artifact
"canplayinstantsorcerylibrarytop",//instant or sorcery "canplayinstantsorcerylibrarytop",//instant or sorcery
"showfromtoplibrary", "showfromtoplibrary",
"showopponenttoplibrary" "showopponenttoplibrary",
"totemarmor"
}; };
map<string,int> Constants::MTGBasicAbilitiesMap; map<string,int> Constants::MTGBasicAbilitiesMap;
+6 -2
View File
@@ -939,7 +939,11 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alter
copy->alternateCostPaid[alternateCostType] = 1; copy->alternateCostPaid[alternateCostType] = 1;
game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, spellCost, alternateCostType, 0); game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, spellCost, alternateCostType, 0);
game->targetChooser = NULL; game->targetChooser = NULL;
if(alternateCostType == ManaCost::MANA_PAID_WITH_BESTOW)
{
copy->removeType("creature");
copy->addType("aura");
}
if (card->has(Constants::STORM)) if (card->has(Constants::STORM))
{ {
int storm = player->game->stack->seenThisTurn("*", Constants::CAST_ALL) + player->opponent()->game->stack->seenThisTurn("*", Constants::CAST_ALL); int storm = player->game->stack->seenThisTurn("*", Constants::CAST_ALL) + player->opponent()->game->stack->seenThisTurn("*", Constants::CAST_ALL);
@@ -3737,7 +3741,7 @@ int MTGPlaneswalkerDamage::receiveEvent(WEvent * event)
if(removel->removed && removel->targetCard && removel->targetCard->hasType(Subtypes::TYPE_PLANESWALKER)) if(removel->removed && removel->targetCard && removel->targetCard->hasType(Subtypes::TYPE_PLANESWALKER))
if(!removel->targetCard->counters->hasCounter("loyalty",0,0)) if(!removel->targetCard->counters->hasCounter("loyalty",0,0))
{ {
removel->targetCard->bury(); removel->targetCard->toGrave(true);
return 1; return 1;
} }
+4
View File
@@ -49,6 +49,8 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck *
prowledTypes.clear(); prowledTypes.clear();
doesntEmpty = NEW ManaCost(); doesntEmpty = NEW ManaCost();
poolDoesntEmpty = NEW ManaCost(); poolDoesntEmpty = NEW ManaCost();
AuraIncreased = NEW ManaCost();
AuraReduced = NEW ManaCost();
if (deck != NULL) if (deck != NULL)
{ {
game = NEW MTGPlayerCards(deck); game = NEW MTGPlayerCards(deck);
@@ -82,6 +84,8 @@ Player::~Player()
SAFE_DELETE(manaPool); SAFE_DELETE(manaPool);
SAFE_DELETE(doesntEmpty); SAFE_DELETE(doesntEmpty);
SAFE_DELETE(poolDoesntEmpty); SAFE_DELETE(poolDoesntEmpty);
SAFE_DELETE(AuraIncreased);
SAFE_DELETE(AuraReduced);
SAFE_DELETE(game); SAFE_DELETE(game);
if(mAvatarTex && observer->getResourceManager()) if(mAvatarTex && observer->getResourceManager())
observer->getResourceManager()->Release(mAvatarTex); observer->getResourceManager()->Release(mAvatarTex);
+93
View File
@@ -48,6 +48,20 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
return NEW CardTargetChooser(observer, target, card); return NEW CardTargetChooser(observer, target, card);
}; };
found = s.find("mychild");
if (found == 0)
{
int maxtargets = 1;
return NEW ChildrenChooser(observer, card, maxtargets);
};
found = s.find("mytotem");
if (found == 0)
{
int maxtargets = 1;
return NEW TotemChooser(observer, card, maxtargets);
};
found = s.find("targetedplayer"); found = s.find("targetedplayer");
if (found == 0) if (found == 0)
{ {
@@ -213,6 +227,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
zones[nbzones++] = MTGGameZone::MY_LIBRARY; zones[nbzones++] = MTGGameZone::MY_LIBRARY;
zones[nbzones++] = MTGGameZone::MY_HAND; zones[nbzones++] = MTGGameZone::MY_HAND;
zones[nbzones++] = MTGGameZone::MY_EXILE; zones[nbzones++] = MTGGameZone::MY_EXILE;
zones[nbzones++] = MTGGameZone::MY_SIDEBOARD;
} }
else if (zoneName.compare("opponentcastingzone") == 0) else if (zoneName.compare("opponentcastingzone") == 0)
{ {
@@ -2015,3 +2030,81 @@ ParentChildChooser::~ParentChildChooser()
{ {
SAFE_DELETE(deeperTargeting); SAFE_DELETE(deeperTargeting);
} }
//child only
bool ChildrenChooser::canTarget(Targetable * target,bool withoutProtections)
{
if (MTGCardInstance * card = dynamic_cast<MTGCardInstance*>(target))
{
if(card == source)
return false;
if(!card->isInPlay(observer))
return false;
if(card->auraParent)
{
if(card->auraParent == source)
return true;
}
return false;
}
return false;
}
ChildrenChooser* ChildrenChooser::clone() const
{
ChildrenChooser * a = NEW ChildrenChooser(*this);
return a;
}
bool ChildrenChooser::equals(TargetChooser * tc)
{
ChildrenChooser * dtc = dynamic_cast<ChildrenChooser *> (tc);
if (!dtc)
return false;
return TypeTargetChooser::equals(tc);
}
ChildrenChooser::~ChildrenChooser()
{
}
//totem armor chooser
bool TotemChooser::canTarget(Targetable * target,bool withoutProtections)
{
if (MTGCardInstance * card = dynamic_cast<MTGCardInstance*>(target))
{
if(card == source)
return false;
if(!card->isInPlay(observer))
return false;
if(card->auraParent)
{
if((card->auraParent) == source && (card->has(Constants::TOTEMARMOR)))
return true;
}
return false;
}
return false;
}
TotemChooser* TotemChooser::clone() const
{
TotemChooser * a = NEW TotemChooser(*this);
return a;
}
bool TotemChooser::equals(TargetChooser * tc)
{
TotemChooser * dtc = dynamic_cast<TotemChooser *> (tc);
if (!dtc)
return false;
return TypeTargetChooser::equals(tc);
}
TotemChooser::~TotemChooser()
{
}