diff --git a/projects/mtg/bin/Res/sets/BFZ/_cards.dat b/projects/mtg/bin/Res/sets/BFZ/_cards.dat index 625afae02..646185ee9 100644 --- a/projects/mtg/bin/Res/sets/BFZ/_cards.dat +++ b/projects/mtg/bin/Res/sets/BFZ/_cards.dat @@ -1505,3 +1505,4 @@ primitive=Zulaport Cutthroat id=402101 rarity=U [/card] + diff --git a/projects/mtg/bin/Res/sets/OGW/_cards.dat b/projects/mtg/bin/Res/sets/OGW/_cards.dat index 3290965bf..040755e61 100644 --- a/projects/mtg/bin/Res/sets/OGW/_cards.dat +++ b/projects/mtg/bin/Res/sets/OGW/_cards.dat @@ -935,3 +935,4 @@ primitive=Zulaport Chainmage id=407603 rarity=C [/card] + diff --git a/projects/mtg/bin/Res/sets/SOI/_cards.dat b/projects/mtg/bin/Res/sets/SOI/_cards.dat index 0a12fa8f1..94822e028 100644 --- a/projects/mtg/bin/Res/sets/SOI/_cards.dat +++ b/projects/mtg/bin/Res/sets/SOI/_cards.dat @@ -1655,3 +1655,4 @@ primitive=Woodland Stream id=410051 rarity=U [/card] + diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index a6adce1f8..574744bc9 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -318,6 +318,19 @@ mana={G}{W} type=Instant [/card] [card] +name=Silvergill Adept +otherrestriction=type(*[merfolk]|myhand)~lessthan~2 +other={4}{U} +restriction=type(*[merfolk]|myhand)~morethan~1 +auto=draw:1 +text=As an additional cost to cast Silvergill Adept, reveal a Merfolk card from your hand or pay {3}. -- When Silvergill Adept enters the battlefield, draw a card. +mana={1}{U} +type=Creature +subtype=Merfolk Wizard +power=2 +toughness=1 +[/card] +[card] name=Staggershock target=creature,player auto=damage:2 diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 4930d6239..45664ca62 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -2066,7 +2066,7 @@ toughness=3 [/card] [card] name=Alabaster Leech -auto=lord(*[white]|myhand,mylibrary,mygraveyard,myexile) altercost(white, +1) +auto=lord(*[white]|mycastingzone) altercost(white, +1) text=White spells you cast cost {W} more to cast. mana={W} type=Creature @@ -3222,7 +3222,7 @@ type=Land [/card] [card] name=Andradite Leech -auto=lord(*[black]|myhand,mylibrary,mygraveyard,myexile) altercost(black,+1) +auto=lord(*[black]|mycastingzone) altercost(black,+1) auto={B}:1/1 text=Black spells you cast cost {B} more to cast. -- {B}: Andradite Leech gets +1/+1 until end of turn. mana={2}{B} @@ -3708,7 +3708,7 @@ subtype=Aura name=Animar, Soul of Elements abilities=protection from white,protection from black auto=@movedTo(creature|mystack):counter(1/1,1) -auto=thisforeach(counter{1/1,1}) lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=thisforeach(counter{1/1,1}) lord(creature|mycastingzone) altercost(colorless, -1) text=Protection from white and from black -- Whenever you cast a creature spell, put a +1/+1 counter on Animar, Soul of Elements. -- Creature spells you cast cost 1 less to cast for each +1/+1 counter on Animar. mana={U}{R}{G} type=Legendary Creature @@ -4394,8 +4394,8 @@ type=Enchantment [/card] [card] name=Arcane Melee -auto=lord(instant|hand,library,graveyard,exile) altercost(colorless,-2) -auto=lord(sorcery|hand,library,graveyard,exile) altercost(colorless,-2) +auto=lord(instant|nonbattlezone) altercost(colorless,-2) +auto=lord(sorcery|nonbattlezone) altercost(colorless,-2) text=Instant and sorcery spells cost {2} less to cast. mana={4}{U} type=Enchantment @@ -6334,8 +6334,8 @@ subtype=Aura [/card] [card] name=Aura of Silence -auto=lord(artifact|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +2) -auto=lord(enchantment|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +2) +auto=lord(artifact|oppcastingzone) altercost(colorless, +2) +auto=lord(enchantment|oppcastingzone) altercost(colorless, +2) auto={S}:destroy target(artifact,enchantment) text=Artifact and enchantment spells your opponents cast cost {2} more to cast. -- Sacrifice Aura of Silence: Destroy target artifact or enchantment. mana={1}{W}{W} @@ -7731,7 +7731,7 @@ toughness=6 name=Balefire Liege auto=lord(other creature[red]|myBattlefield) 1/1 auto=lord(other creature[white]|myBattlefield) 1/1 -auto=@movedto(*[red]|mystack):damage:3 opponent +auto=@movedto(*[red]|mystack):damage:3 target(player) auto=@movedto(*[white]|mystack):life:3 controller text=Other red creatures you control get +1/+1. -- Other white creatures you control get +1/+1. -- Whenever you cast a red spell, Balefire Liege deals 3 damage to target player. -- Whenever you cast a white spell, you gain 3 life. mana={2}{RW}{RW}{RW} @@ -7829,7 +7829,7 @@ toughness=2 [/card] [card] name=Ballyrush Banneret -auto=lord(*[soldier;kithkin]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(*[soldier;kithkin]|mycastingzone) altercost(colorless, -1) text=Kithkin spells and Soldier spells you cast cost {1} less to cast. mana={1}{W} type=Creature @@ -12990,7 +12990,7 @@ toughness=7 [/card] [card] name=Bosk Banneret -auto=lord(*[treefolk;shaman]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(*[treefolk;shaman]|mycastingzone) altercost(colorless, -1) text=Treefolk spells and Shaman spells you cast cost {1} less to cast. mana={1}{G} type=Creature @@ -13780,7 +13780,7 @@ type=Enchantment [/card] [card] name=Brighthearth Banneret -auto=lord(*[elemental;warrior]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(*[elemental;warrior]|mycastingzone) altercost(colorless, -1) autohand={1}{R}{discard}:counter(1/1,1) target(creature) text=Elemental spells and Warrior spells you cast cost {1} less to cast. -- Reinforce 1 - {1}{R} ({1}{R}, Discard this card: Put a +1/+1 counter on target creature.) mana={1}{R} @@ -16777,7 +16777,7 @@ toughness=3 [/card] [card] name=Centaur Omenreader -auto=this(tapped) lord(*|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -2) ueot +auto=this(tapped) lord(*|mycastingzone) altercost(colorless, -2) ueot auto=@untapped(this):all(*|myhand) moveto(myhand) text=As long as Centaur Omenreader is tapped, creature spells you cast cost {2} less to cast. mana={3}{G} @@ -17898,8 +17898,8 @@ type=Instant [/card] [card] name=Chill -auto=lord(*[red]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, +2) -auto=lord(*[red]|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +2) +auto=lord(*[red]|mycastingzone) altercost(colorless, +2) +auto=lord(*[red]|oppcastingzone) altercost(colorless, +2) text=Red spells cost {2} more to cast. mana={1}{U} type=Enchantment @@ -19258,11 +19258,11 @@ auto=choice name(Creature) counter(0/0,1,CloudKeyC) all(this) auto=choice name(Enchantment) counter(0/0,1,CloudKeyE) all(this) auto=choice name(Instant) counter(0/0,1,CloudKeyI) all(this) auto=choice name(Sorcery) counter(0/0,1,CloudKeyS) all(this) -auto=this(counter{0/0.1.CloudKeyA}) lord(Artifact|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) -auto=this(counter{0/0.1.CloudKeyC}) lord(Creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) -auto=this(counter{0/0.1.CloudKeyE}) lord(Enchantment|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) -auto=this(counter{0/0.1.CloudKeyI}) lord(Instant|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) -auto=this(counter{0/0.1.CloudKeyS}) lord(Sorcery|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyA}) lord(Artifact|mycastingzone) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyC}) lord(Creature|mycastingzone) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyE}) lord(Enchantment|mycastingzone) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyI}) lord(Instant|mycastingzone) altercost(colorless,-1) +auto=this(counter{0/0.1.CloudKeyS}) lord(Sorcery|mycastingzone) altercost(colorless,-1) text=As Cloud Key enters the battlefield, choose artifact, creature, enchantment, instant, or sorcery. -- Spells you cast of the chosen type cost {1} less to cast. mana={3} type=Artifact @@ -24250,7 +24250,7 @@ toughness=1 [/card] [card] name=Daru Warchief -auto=lord(soldier|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(soldier|mycastingzone) altercost(colorless, -1) auto=lord(soldier|myBattlefield) 1/2 text=Soldier spells you cast cost {1} less to cast. -- Soldier creatures you control get +1/+2. mana={2}{W}{W} @@ -25029,8 +25029,11 @@ toughness=3 name=Deathbringer Liege auto=lord(other creature[black]|myBattlefield) 1/1 auto=lord(other creature[white]|myBattlefield) 1/1 -auto=@movedto(*[black]|mystack):may destroy target(creature[tapped]) -auto=@movedto(*[white]|mystack):may tap target(creature) +auto=@movedto(*[black;-white]|mystack):may destroy target(creature[tapped]) +auto=@movedto(*[white;-black]|mystack):may tap target(creature) +auto=@movedto(*[black&white]|mystack):may tap target(creature) +auto=@movedto(*[black&white]|mystack):may destroy target(creature[tapped]) +auto=@movedto(*[black&white]|mystack):may name(tap & destroy) target(creature) tap && activate destroy target(creature[tapped]) text=Other white creatures you control get +1/+1. -- Other black creatures you control get +1/+1. -- Whenever you cast a white spell, you may tap target creature. -- Whenever you cast a black spell, you may destroy target creature if it's tapped. mana={2}{WB}{WB}{WB} type=Creature @@ -26389,7 +26392,7 @@ toughness=1 [/card] [card] name=Derelor -auto=lord(*[black]|myhand,mylibrary,mygraveyard,myexile) altercost(black, +1) +auto=lord(*[black]|mycastingzone) altercost(black, +1) text=Black spells you cast cost {B} more to cast. mana={3}{B} type=Creature @@ -28810,7 +28813,7 @@ toughness=5 [/card] [card] name=Dragonlord's Servant -auto=lord(dragon|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(dragon|mycastingzone) altercost(colorless, -1) text=Dragon spells you cast cost {1} less to cast. mana={1}{R} type=Creature @@ -28914,7 +28917,7 @@ toughness=2 [/card] [card] name=Dragonspeaker Shaman -auto=lord(dragon|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=lord(dragon|mycastingzone) altercost(colorless,-2) text=Dragon spells you cast cost {2} less to cast. mana={1}{R}{R} type=Creature @@ -31332,8 +31335,8 @@ subtype=Aura [/card] [card] name=Edgewalker -auto=lord(cleric|myhand,mylibrary,mygraveyard,myexile) altercost(white,-1) -auto=lord(cleric|myhand,mylibrary,mygraveyard,myexile) altercost(black, -1) +auto=lord(cleric|mycastingzone) altercost(white,-1) +auto=lord(cleric|mycastingzone) altercost(black, -1) text=Cleric spells you cast cost {W}{B} less to cast. This effect reduces only the amount of colored mana you pay. (For example, if you cast a Cleric spell with mana cost {1}{W}, it costs {1} to cast.) mana={1}{W}{B} type=Creature @@ -32734,7 +32737,7 @@ toughness=1 [/card] [card] name=Emerald Medallion -auto=lord(*[green]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[green]|mycastingzone) altercost(colorless,-1) text=Green spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -34432,7 +34435,7 @@ type=Artifact [/card] [card] name=Etherium Sculptor -auto=lord(artifact|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(artifact|mycastingzone) altercost(colorless,-1) text=Artifact spells you cast cost {1} less to cast. mana={1}{U} type=Artifact Creature @@ -35219,7 +35222,7 @@ mana={3}{W} [/card] [card] name=Eye of Ugin -auto=lord(eldrazi[iscolorless]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=lord(eldrazi[colorless]|mycastingzone) altercost(colorless,-2) auto={7}{T}:moveTo(myhand) target(creature[iscolorless]|myLibrary) text=Colorless Eldrazi spells you cast cost {2} less to cast. -- {7}, {T}: Search your library for a colorless creature card, reveal it, and put it into your hand. Then shuffle your library. type=Legendary Land @@ -36736,7 +36739,7 @@ subtype=Aura [/card] [card] name=Feroz's Ban -auto=lord(creature|hand,library,graveyard,exile) altercost(colorless,+2) +auto=lord(creature|nonbattlezone) altercost(colorless,+2) text=Creature spells cost {2} more to cast. mana={6} type=Artifact @@ -40117,7 +40120,7 @@ toughness=2 [card] name=Frogtosser Banneret abilities=haste -auto=lord(*[goblin;rogue]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(*[goblin;rogue]|mycastingzone) altercost(colorless, -1) text=Haste -- Goblin spells and Rogue spells you cast cost {1} less to cast. mana={1}{B} type=Creature @@ -43442,8 +43445,8 @@ toughness=3 [/card] [card] name=Glowrider -auto=lord(*[-creature]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,+1) -auto=lord(*[-creature]|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +1) +auto=lord(*[-creature]|mycastingzone) altercost(colorless,+1) +auto=lord(*[-creature]|oppcastingzone) altercost(colorless, +1) text=Noncreature spells cost {1} more to cast. mana={2}{W} type=Creature @@ -43919,7 +43922,7 @@ toughness=4 [/card] [card] name=Goblin Electromancer -auto=lord(*[instant;sorcery]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[instant;sorcery]|mycastingzone) altercost(colorless,-1) text=Instant and sorcery spells you cast cost {1} less to cast. mana={U}{R} type=Creature @@ -44646,7 +44649,7 @@ toughness=3 [/card] [card] name=Goblin Warchief -auto=lord(goblin|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(goblin|mycastingzone) altercost(colorless,-1) auto=lord(goblin|myBattlefield) haste text=Goblin spells you cast cost {1} less to cast. -- Goblin creatures you control have haste. mana={1}{R}{R} @@ -45392,9 +45395,9 @@ toughness=2 [/card] [card] name=Grand Arbiter Augustin IV -auto=lord(*[white]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) -auto=lord(*[blue]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) -auto=lord(*|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost( colorless,+1) +auto=lord(*[white]|mycastingzone) altercost(colorless,-1) +auto=lord(*[blue]|mycastingzone) altercost(colorless,-1) +auto=lord(*|oppcastingzone) altercost( colorless,+1) text=White spells you cast cost {1} less to cast. -- Blue spells you cast cost {1} less to cast. -- Spells your opponents cast cost {1} more to cast. mana={2}{W}{U} type=Legendary Creature @@ -49006,7 +49009,7 @@ toughness=3 [card] name=Heartless Summoning auto=lord(creature|myBattlefield) -1/-1 -auto=lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost( colorless,-2) +auto=lord(creature|mycastingzone) altercost( colorless,-2) text=Creature spells you cast cost {2} less to cast. -- Creatures you control get -1/-1 mana={1}{B} type=Enchantment @@ -49640,7 +49643,7 @@ toughness=1 [/card] [card] name=Helm of Awakening -auto=lord(*|hand,library,graveyard,exile) altercost(colorless,-1) +auto=lord(*|nonbattlezone) altercost(colorless,-1) text=Spells cost {1} less to cast. mana={2} type=Artifact @@ -49782,7 +49785,7 @@ toughness=4 [/card] [card] name=Herald of the Pantheon -auto=lord(enchantment|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(enchantment|mycastingzone) altercost(colorless, -1) auto=@movedto(enchantment|mystack):choice life:1 controller text=Enchantment spells you cast cost {1} less to cast. -- Whenever you cast an enchantment spell, you gain 1 life. mana={1}{G} @@ -49810,7 +49813,7 @@ toughness=3 name=Herald of War abilities=flying auto=@combat(attacking) source(this):counter(1/1,1) -auto=thisforeach(counter{1/1,1}) lord(*[angel;human]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=thisforeach(counter{1/1,1}) lord(*[angel;human]|mycastingzone) altercost(colorless, -1) text=Flying -- Whenever Herald of War attacks, put a +1/+1 counter on it. -- Angel spells and Human spells you cast cost {1} less to cast for each +1/+1 counter on Herald of War. mana={3}{W}{W} type=Creature @@ -49913,7 +49916,7 @@ toughness=3 [/card] [card] name=Hero of Iroas -auto=lord(aura|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(aura|mycastingzone) altercost(colorless,-1) auto=@targeted(this) from(*[instant;sorcery;enchantment]|myhand,mygraveyard):counter(1/1,1) text=Aura spells you cast cost 1 less to cast. -- Heroic -- Whenever you cast a spell that targets Hero of Iroas, put a +1/+1 counter on Hero of Iroas. mana={1}{W} @@ -50179,7 +50182,7 @@ toughness=1 [/card] [card] name=High Seas -auto=lord(creature[red;green]|hand,library,graveyard,exile) altercost(colorless,+1) +auto=lord(creature[red;green]|nonbattlezone) altercost(colorless,+1) text=Red creature spells and green creature spells cost {1} more to cast. mana={2}{U} type=Enchantment @@ -54359,7 +54362,7 @@ toughness=2 [/card] [card] name=Irini Sengir -auto=lord(enchantment[white;green]|hand,library,graveyard,exile) altercost(colorless,+1) +auto=lord(enchantment[white;green]|nonbattlezone) altercost(colorless,+1) text=White enchantment spells and green enchantment spells cost {2} more to cast. mana={2}{B}{B} type=Legendary Creature @@ -55042,7 +55045,7 @@ type=Artifact [/card] [card] name=Jade Leech -auto=lord(*[green]|myhand,mylibrary,mygraveyard,myexile) altercost(green,+1) +auto=lord(*[green]|mycastingzone) altercost(green,+1) text=Green spells you cast cost {G} more to cast. mana={2}{G}{G} type=Creature @@ -55418,7 +55421,7 @@ type=Artifact [/card] [card] name=Jet Medallion -auto=lord(*[black]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[black]|mycastingzone) altercost(colorless,-1) text=Black spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -59520,7 +59523,7 @@ toughness=0 [/card] [card] name=Krallenhorde Howler -auto=lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(creature|mycastingzone) altercost(colorless, -1) auto=@each upkeep restriction{lastturn(*|stack)~morethan~1}:flip(Duskwatch Recruiter) text=Creature spells you cast cost {1} less to cast. -- At the beginning of each upkeep, if a player cast two or more spells last turn, transform Krallenhorde Howler. type=Creature @@ -59743,7 +59746,7 @@ toughness=2 [/card] [card] name=Krosan Drover -auto=lord(creature[manacost>=6]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=lord(creature[manacost>=6]|mycastingzone) altercost(colorless,-2) text=Creature spells you cast with converted mana cost 6 or more cost {2} less to cast. mana={3}{G} type=Creature @@ -59803,7 +59806,7 @@ toughness=5 [card] name=Krosan Warchief auto={1}{G}:regenerate target(beast) -auto=lord(beast|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(beast|mycastingzone) altercost(colorless,-1) text=Beast spells you cast cost {1} less to cast. -- {1}{G}: Regenerate target Beast. mana={2}{G} type=Creature @@ -62905,7 +62908,7 @@ type=Artifact [/card] [card] name=Lodestone Golem -auto=lord(*[-artifact]|hand,library,graveyard,exile) altercost(colorless,+1) +auto=lord(*[-artifact]|nonbattlezone) altercost(colorless,+1) text=Nonartifact spells cost {1} more to cast. mana={4} type=Artifact Creature @@ -62986,7 +62989,7 @@ toughness=2 [/card] [card] name=Long-Forgotten Gohei -auto=lord(arcane|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(arcane|mycastingzone) altercost(colorless,-1) auto=lord(spirit|myBattlefield) 1/1 text=Arcane spells you cast cost {1} less to cast. -- Spirit creatures you control get +1/+1. mana={3} @@ -65048,8 +65051,8 @@ toughness=1 [/card] [card] name=Mana Matrix -auto=lord(instant|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=lord(enchantment|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=lord(instant|mycastingzone) altercost(colorless,-2) +auto=lord(enchantment|mycastingzone) altercost(colorless,-2) text=Instant and enchantment spells you cast cost up to {2} less to cast. mana={6} type=Artifact @@ -69348,7 +69351,7 @@ toughness=4 [/card] [card] name=Mistform Warchief -auto=lord(creature[share!types!]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) chooseend +auto=lord(creature[share!types!]|mycastingzone) altercost(colorless,-1) chooseend auto={T}:activatechooseatype all(this) becomes(removecreaturesubtypes) && becomes(chosentype) ueot activatechooseend text=Creature spells you cast that share a creature type with Mistform Warchief cost {1} less to cast. -- {T}: Mistform Warchief becomes the creature type of your choice until end of turn. mana={2}{U} @@ -73744,7 +73747,7 @@ toughness=1 [/card] [card] name=Nightscape Familiar -auto=lord(*[blue;red]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[blue;red]|mycastingzone) altercost(colorless,-1) auto={1}{B}:regenerate text=Blue spells and red spells you cast cost {1} less to cast. -- {1}{B}: Regenerate Nightscape Familiar. mana={1}{B} @@ -78498,7 +78501,7 @@ toughness=7 [/card] [card] name=Pearl Medallion -auto=lord(*[white]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[white]|mycastingzone) altercost(colorless,-1) text=White spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -78915,23 +78918,23 @@ subtype=Trap [/card] [card] name=Pernicious Deed -auto={0}{S}:name(X = 0) destroy all(*[-land;manacost=0]) -auto={1}{S}:name(X = 1) destroy all(*[-land;manacost<=1]) -auto={2}{S}:name(X = 2) destroy all(*[-land;manacost<=2]) -auto={3}{S}:name(X = 3) destroy all(*[-land;manacost<=3]) -auto={4}{S}:name(X = 4) destroy all(*[-land;manacost<=4]) -auto={5}{S}:name(X = 5) destroy all(*[-land;manacost<=5]) -auto={6}{S}:name(X = 6) destroy all(*[-land;manacost<=6]) -auto={7}{S}:name(X = 7) destroy all(*[-land;manacost<=7]) -auto={8}{S}:name(X = 8) destroy all(*[-land;manacost<=8]) -auto={9}{S}:name(X = 9) destroy all(*[-land;manacost<=9]) -auto={10}{S}:name(X = 10) destroy all(*[-land;manacost<=10]) -auto={11}{S}:name(X = 11) destroy all(*[-land;manacost<=11]) -auto={12}{S}:name(X = 12) destroy all(*[-land;manacost<=12]) -auto={13}{S}:name(X = 13) destroy all(*[-land;manacost<=13]) -auto={14}{S}:name(X = 14) destroy all(*[-land;manacost<=14]) -auto={15}{S}:name(X = 15) destroy all(*[-land;manacost<=15]) -auto={16}{S}:name(X = 16) destroy all(*[-land;manacost<=16]) +auto={0}{S}:name(X = 0) destroy all(artifact,creature,enchantment[manacost=0]) +auto={1}{S}:name(X = 1) destroy all(artifact,creature,enchantment[manacost<=1]) +auto={2}{S}:name(X = 2) destroy all(artifact,creature,enchantment[manacost<=2]) +auto={3}{S}:name(X = 3) destroy all(artifact,creature,enchantment[manacost<=3]) +auto={4}{S}:name(X = 4) destroy all(artifact,creature,enchantment[manacost<=4]) +auto={5}{S}:name(X = 5) destroy all(artifact,creature,enchantment[manacost<=5]) +auto={6}{S}:name(X = 6) destroy all(artifact,creature,enchantment[manacost<=6]) +auto={7}{S}:name(X = 7) destroy all(artifact,creature,enchantment[manacost<=7]) +auto={8}{S}:name(X = 8) destroy all(artifact,creature,enchantment[manacost<=8]) +auto={9}{S}:name(X = 9) destroy all(artifact,creature,enchantment[manacost<=9]) +auto={10}{S}:name(X = 10) destroy all(artifact,creature,enchantment[manacost<=10]) +auto={11}{S}:name(X = 11) destroy all(artifact,creature,enchantment[manacost<=11]) +auto={12}{S}:name(X = 12) destroy all(artifact,creature,enchantment[manacost<=12]) +auto={13}{S}:name(X = 13) destroy all(artifact,creature,enchantment[manacost<=13]) +auto={14}{S}:name(X = 14) destroy all(artifact,creature,enchantment[manacost<=14]) +auto={15}{S}:name(X = 15) destroy all(artifact,creature,enchantment[manacost<=15]) +auto={16}{S}:name(X = 16) destroy all(artifact,creature,enchantment[manacost<=16]) text={X}, Sacrifice Pernicious Deed: Destroy each artifact, creature, and enchantment with converted mana cost X or less. mana={1}{B}{G} type=Enchantment @@ -80722,7 +80725,7 @@ type=Sorcery [/card] [card] name=Planar Gate -auto=lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=lord(creature|mycastingzone) altercost(colorless,-2) text=Creature spells you cast cost up to {2} less to cast. mana={6} type=Artifact @@ -84149,8 +84152,8 @@ toughness=3 [/card] [card] name=Ragemonger -auto=lord(minotaur|myhand,mylibrary,mygraveyard,myexile) altercost(black,-1) -auto=lord(minotaur|myhand,mylibrary,mygraveyard,myexile) altercost(red,-1) +auto=lord(minotaur|mycastingzone) altercost(black,-1) +auto=lord(minotaur|mycastingzone) altercost(red,-1) text=Minotaur spells you cast cost BlackRed less to cast. This effect reduces only the amount of colored mana you pay. (For example, if you cast a Minotaur spell with mana cost 2Red, it costs 2 to cast.) mana={1}{B}{R} type=Creature @@ -89753,7 +89756,7 @@ toughness=3 [card] name=Ruby Leech abilities=first strike -auto=lord(*[red]|myhand,mylibrary,mygraveyard,myexile) altercost(red,+1) +auto=lord(*[red]|mycastingzone) altercost(red,+1) text=First strike -- Red spells you cast cost {R} more to cast. mana={1}{R} type=Creature @@ -89763,7 +89766,7 @@ toughness=2 [/card] [card] name=Ruby Medallion -auto=lord(*[red]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[red]|mycastingzone) altercost(colorless,-1) text=Red spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -91583,7 +91586,7 @@ toughness=4 [card] name=Sapphire Leech abilities=flying -auto=lord(*[blue]|myhand,mylibrary,mygraveyard,myexile) altercost(blue,+1) +auto=lord(*[blue]|mycastingzone) altercost(blue,+1) text=Flying -- Blue spells you cast cost {U} more to cast. mana={1}{U} type=Creature @@ -91593,7 +91596,7 @@ toughness=2 [/card] [card] name=Sapphire Medallion -auto=lord(*[blue]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[blue]|mycastingzone) altercost(colorless,-1) text=Blue spells you cast cost {1} less to cast. mana={2} type=Artifact @@ -94515,20 +94518,20 @@ auto=choice name(Sorcery) moveTo(myexile) notatarget(sorcery|myhand) && counter( auto=choice name(Tribal Instant) moveTo(myexile) notatarget(instant[tribal]|myhand) && counter(0/0,1,TribalInstant) all(this) auto=choice name(Tribal Sorcery) moveTo(myexile) notatarget(sorcery[tribal]|myhand) && counter(0/0,1,TribalSorcery) all(this) auto=choice name(cancel) donothing -auto=this(counter{0/0.1.Artifact}) lord(artifact|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.ArtifactCreature}) lord(artifact[-creature]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.ArtifactCreature}) lord(creature[-artifact]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.ArtifactCreature}) lord(creature[artifact]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2 ) -auto=this(counter{0/0.1.Creature}) lord(creature|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.Enchantment}) lord(enchantment|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.Instant}) lord(instant|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.Sorcery}) lord(sorcery|myhand,mylibrary,mygraveyard,myexile) altercost( colorless, -2 ) -auto=this(counter{0/0.1.TribalInstant}) lord(tribal[-instant]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.TribalInstant}) lord(instant[-tribal]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.TribalInstant}) lord(instant[tribal]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2 ) -auto=this(counter{0/0.1.TribalSorcery}) lord(tribal[-sorcery]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.TribalSorcery}) lord(sorcery[-tribal]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) -auto=this(counter{0/0.1.TribalSorcery}) lord(sorcery[tribal]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=this(counter{0/0.1.Artifact}) lord(artifact|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.ArtifactCreature}) lord(artifact[-creature]|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.ArtifactCreature}) lord(creature[-artifact]|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.ArtifactCreature}) lord(creature[artifact]|mycastingzone) altercost(colorless,-2 ) +auto=this(counter{0/0.1.Creature}) lord(creature|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.Enchantment}) lord(enchantment|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.Instant}) lord(instant|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.Sorcery}) lord(sorcery|mycastingzone) altercost( colorless, -2 ) +auto=this(counter{0/0.1.TribalInstant}) lord(tribal[-instant]|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.TribalInstant}) lord(instant[-tribal]|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.TribalInstant}) lord(instant[tribal]|mycastingzone) altercost(colorless,-2 ) +auto=this(counter{0/0.1.TribalSorcery}) lord(tribal[-sorcery]|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.TribalSorcery}) lord(sorcery[-tribal]|mycastingzone) altercost(colorless,-2) +auto=this(counter{0/0.1.TribalSorcery}) lord(sorcery[tribal]|mycastingzone) altercost(colorless,-2) text=Imprint - When Semblance Anvil enters the battlefield, you may exile a nonland card from your hand. -- Spells you cast that share a card type with the exiled card cost {2} less to cast. mana={3} type=Artifact @@ -102668,7 +102671,7 @@ toughness=3 [/card] [card] name=Sphere of Resistance -auto=lord(*|hand,library,graveyard,exile) altercost(colorless,+1) +auto=lord(*|nonbattlezone) altercost(colorless,+1) text=Spells cost {1} more to cast. mana={2} type=Artifact @@ -104129,7 +104132,7 @@ type=Artifact [card] name=Squeeze text=Sorcery spells cost {3} more to cast. -auto=lord(sorcery|hand,library,graveyard,exile) altercost(colorless,+3) +auto=lord(sorcery|nonbattlezone) altercost(colorless,+3) mana={3}{U} type=Enchantment [/card] @@ -105226,7 +105229,7 @@ toughness=1 [/card] [card] name=Stinkdrinker Daredevil -auto=lord(giant|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) +auto=lord(giant|mycastingzone) altercost(colorless,-2) text=Giant spells you cast cost {2} less to cast. mana={2}{R} type=Creature @@ -105414,7 +105417,7 @@ type=Sorcery [/card] [card] name=Stone Calendar -auto=lord(*|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*|mycastingzone) altercost(colorless,-1) text=Spells you cast cost up to {1} less to cast. mana={5} type=Artifact @@ -105741,7 +105744,7 @@ toughness=2 [card] name=Stonybrook Banneret abilities=islandwalk -auto=lord(*[merfolk;wizard]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(*[merfolk;wizard]|mycastingzone) altercost(colorless, -1) text=Islandwalk -- Merfolk spells and Wizard spells you cast cost {1} less to cast. mana={1}{U} type=Creature @@ -105990,7 +105993,7 @@ toughness=1 [card] name=Stormscape Familiar abilities=flying -auto=lord(*[white;black]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[white;black]|mycastingzone) altercost(colorless,-1) text=Flying -- White spells and black spells you cast cost {1} less to cast. mana={1}{U} type=Creature @@ -107376,7 +107379,7 @@ toughness=1 [card] name=Sunscape Familiar abilities=defender -auto=lord(*[green;blue]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[green;blue]|mycastingzone) altercost(colorless,-1) text=Defender (This creature can't attack.) -- Green spells and blue spells you cast cost {1} less to cast. mana={1}{W} type=Creature @@ -110836,8 +110839,8 @@ toughness=2 [card] name=Thalia, Guardian of Thraben abilities=first strike -auto=lord(*[-creature]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,+1) -auto=lord(*[-creature]|opponenthand,opponentlibrary,opponentgraveyard,opponentexile) altercost(colorless, +1) +auto=lord(*[-creature]|mycastingzone) altercost(colorless,+1) +auto=lord(*[-creature]|oppcastingzone) altercost(colorless, +1) text=First Strike -- Noncreature spells cost {1} more to cast. mana={1}{W} type=Legendary Creature @@ -111413,7 +111416,7 @@ toughness=7 [/card] [card] name=Thorn of Amethyst -auto=lord(*[-creature]|hand,library,graveyard,exile) altercost(colorless,+1) +auto=lord(*[-creature]|nonbattlezone) altercost(colorless,+1) text=Noncreature spells cost {1} more to cast. mana={2} type=Artifact @@ -111495,7 +111498,7 @@ toughness=1 [/card] [card] name=Thornscape Familiar -auto=lord(*[red;white]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[red;white]|mycastingzone) altercost(colorless,-1) text=Red spells and white spells you cast cost {1} less to cast. mana={1}{G} type=Creature @@ -112442,7 +112445,7 @@ toughness=1 [card] name=Thunderscape Familiar abilities=first strike -auto=lord(*[black;green]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-1) +auto=lord(*[black;green]|mycastingzone) altercost(colorless,-1) text=First strike -- Black spells and green spells you cast cost {1} less to cast. mana={1}{R} type=Creature @@ -116587,7 +116590,7 @@ toughness=2 [card] name=Undead Warchief auto=lord(zombie|myBattlefield) 2/1 -auto=lord(zombie|myhand,mylibrary,mygraveyard,myexile) altercost( colorless,-1) +auto=lord(zombie|mycastingzone) altercost( colorless,-1) text=Zombie spells you cast cost {1} less to cast. -- Zombie creatures you control get +2/+1. mana={2}{B}{B} type=Creature @@ -117572,7 +117575,7 @@ subtype=Urza's [/card] [card] name=Urza's Filter -auto=lord(*[multicolor]|hand,library,graveyard,exile) altercost(colorless,-2) +auto=lord(*[multicolor]|nonbattlezone) altercost(colorless,-2) text=Multicolored spells cost up to {2} less to cast. mana={4} type=Artifact @@ -117586,7 +117589,7 @@ type=Sorcery [/card] [card] name=Urza's Incubator -auto=chooseatype lord(creature[chosentype]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless,-2) chooseend +auto=chooseatype lord(creature[chosentype]|mycastingzone) altercost(colorless,-2) chooseend text=As Urza's Incubator enters the battlefield, choose a creature type. -- Creature spells of the chosen type cost {2} less to cast. mana={3} type=Artifact @@ -121249,7 +121252,7 @@ subtype=Vraska [card] name=Vryn Wingmare abilities=flying -auto=lord(*[-creature]|hand,library,graveyard,exile) altercost(colorless, +1) +auto=lord(*[-creature]|nonbattlezone) altercost(colorless, +1) text=Flying -- Noncreature spells cost {1} more to cast. mana={2}{W} type=Creature @@ -122460,7 +122463,7 @@ toughness=2 [card] name=Warden of Evos Isle abilities=flying -auto=lord(creature[flying]|myhand,mylibrary,mygraveyard,myexile) altercost(colorless, -1) +auto=lord(creature[flying]|mycastingzone) altercost(colorless, -1) text=Flying. -- Creature spells with flying you cast cost 1 less to cast. mana={2}{U} type=Creature diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index a01b899e8..4669d6a8f 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1429,7 +1429,6 @@ public: if (!e) return 0; MTGCardInstance * check = e->cardAfter; MTGGameZone * oldZone = e->cardAfter->currentZone; - //MTGGameZone * currZone = check->currentZone; check->currentZone = check->previousZone; if (check->next && (check->next->currentZone|| check->isToken)) { @@ -1948,8 +1947,8 @@ public: class AACopier: public ActivatedAbility { public: - MTGAbility * andAbility; vector currentAbilities; + MTGAbility * andAbility; AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL); int resolve(); const string getMenuText(); @@ -2270,12 +2269,7 @@ public: assert(modifier < 2); ((MTGCardInstance *) target)->basicAbilities.set(ability, modifier > 0); - //---add or subtract so we can keep track - for future use - ((MTGCardInstance *) target)->modbasicAbilities[ability] += modifier; - //---make sure no negative values - if(((MTGCardInstance *) target)->modbasicAbilities[ability] < 0) - ((MTGCardInstance *) target)->modbasicAbilities[ability] = 0; - //---end add or subtract abilities + return MTGAbility::addToGame(); } diff --git a/projects/mtg/include/CardGui.h b/projects/mtg/include/CardGui.h index ab73fb6c4..4ef10700b 100644 --- a/projects/mtg/include/CardGui.h +++ b/projects/mtg/include/CardGui.h @@ -33,10 +33,10 @@ protected: /* ** Tries to render the Big version of a card picture, backups to text version in case of failure */ - static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false, bool smallerscale = false, bool ingame = false); + static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false); static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal); - static void AlternateRender(MTGCard * card, const Pos& pos, bool noborder = false, bool smallerscale = false); + static void AlternateRender(MTGCard * card, const Pos& pos); static void TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad); static string FormattedData (string data, string replace, string value); static bool FilterCard (MTGCard * card,string filter); @@ -54,10 +54,10 @@ public: CardGui(MTGCardInstance* card, const Pos& ref); virtual void Render(); virtual void Update(float dt); - bool isBlackBorder(string set); - void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool smallscale = false, bool ingame = false); - static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool smallscale = false, bool ingame = false); - static void DrawBorder(string setname, const Pos& inPosition, float x, bool noborder = false, bool smallscale = false); + + void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false); + static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false); + static JQuadPtr AlternateThumbQuad(MTGCard * card); virtual ostream& toString(ostream&) const; }; diff --git a/projects/mtg/include/CardPrimitive.h b/projects/mtg/include/CardPrimitive.h index 51f5dbcd0..15fec378f 100644 --- a/projects/mtg/include/CardPrimitive.h +++ b/projects/mtg/include/CardPrimitive.h @@ -57,7 +57,6 @@ public: uint8_t colors; typedef std::bitset BasicAbilitiesSet; - vector modbasicAbilities; BasicAbilitiesSet basicAbilities; BasicAbilitiesSet LKIbasicAbilities; diff --git a/projects/mtg/include/CarouselDeckView.h b/projects/mtg/include/CarouselDeckView.h index f5dce5fc5..7514ed62d 100644 --- a/projects/mtg/include/CarouselDeckView.h +++ b/projects/mtg/include/CarouselDeckView.h @@ -23,7 +23,7 @@ public: void renderCard(int index) { int alpha = (int) (255 * (mCards[index].scale + 1.0 - max_scale)); - DeckView::renderCard(index, alpha, false, true); + DeckView::renderCard(index, alpha); } void Render(); diff --git a/projects/mtg/include/DeckView.h b/projects/mtg/include/DeckView.h index 10ff6161b..7feec1226 100644 --- a/projects/mtg/include/DeckView.h +++ b/projects/mtg/include/DeckView.h @@ -207,7 +207,7 @@ protected: * * \see mCards */ - void renderCard(int index, int alpha, bool asThumbnail = false, bool addWHborder = false); + void renderCard(int index, int alpha, bool asThumbnail = false); /*! \brief Returns the index in mCards of the card that is nearest to the given point * diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index c8a3b8550..2f520043c 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -125,10 +125,7 @@ class GameObserver{ void enchantmentStatus(); void Affinity(); bool AffinityNeedsUpdate; - bool legendNeedUpdate; void addObserver(MTGAbility * observer); - void checkLegendary(MTGCardInstance * card); - map cards; bool removeObserver(ActionElement * observer); void startGame(GameType, Rules * rules); void untapPhase(); diff --git a/projects/mtg/include/GuiStatic.h b/projects/mtg/include/GuiStatic.h index db7c0505e..513d7848b 100644 --- a/projects/mtg/include/GuiStatic.h +++ b/projects/mtg/include/GuiStatic.h @@ -25,8 +25,8 @@ struct GuiAvatar: public GuiStatic BOTTOM_RIGHT } Corner; - static const unsigned Width = 32;//35 - static const unsigned Height = 45;//50 + static const unsigned Width = 35; + static const unsigned Height = 50; protected: int avatarRed; diff --git a/projects/mtg/include/ThisDescriptor.h b/projects/mtg/include/ThisDescriptor.h index 625f6c941..62d913d5d 100644 --- a/projects/mtg/include/ThisDescriptor.h +++ b/projects/mtg/include/ThisDescriptor.h @@ -61,6 +61,14 @@ class ThisControllerlife:public ThisDescriptor{ ThisControllerlife * clone() const; }; +class ThisCreatureSpells:public ThisDescriptor{ + public: + virtual int match(MTGCardInstance * card); + + ThisCreatureSpells(int count); + ThisCreatureSpells * clone() const; +}; + class ThisOpponentlife:public ThisDescriptor{ public: virtual int match(MTGCardInstance * card); diff --git a/projects/mtg/include/WEvent.h b/projects/mtg/include/WEvent.h index b4713c542..39ed06385 100644 --- a/projects/mtg/include/WEvent.h +++ b/projects/mtg/include/WEvent.h @@ -184,8 +184,7 @@ struct WEventCardBlocked : public WEventCardUpdate { //event when card is sacrificed. struct WEventCardSacrifice : public WEventCardUpdate { MTGCardInstance * cardAfter; - bool istoken; - WEventCardSacrifice(MTGCardInstance * card,MTGCardInstance * afterCard, bool token = false); + WEventCardSacrifice(MTGCardInstance * card,MTGCardInstance * afterCard); virtual Targetable * getTarget(int target); }; diff --git a/projects/mtg/include/WResourceManager.h b/projects/mtg/include/WResourceManager.h index d7f44c2a0..4abe05ed9 100644 --- a/projects/mtg/include/WResourceManager.h +++ b/projects/mtg/include/WResourceManager.h @@ -80,7 +80,6 @@ public: } }; virtual JQuadPtr RetrieveCard(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL) = 0; - virtual JQuadPtr RetrieveCardToken(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL, int tId = 0) = 0; virtual JSample * RetrieveSample(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL) = 0; virtual JTexture * RetrieveTexture(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL) = 0; virtual JQuadPtr RetrieveQuad(const string& filename, float offX=0.0f, float offY=0.0f, float width=0.0f, float height=0.0f, string resname="", int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL, int id = 0) = 0; diff --git a/projects/mtg/include/WResourceManagerImpl.h b/projects/mtg/include/WResourceManagerImpl.h index 05b18617c..d759f943f 100644 --- a/projects/mtg/include/WResourceManagerImpl.h +++ b/projects/mtg/include/WResourceManagerImpl.h @@ -141,7 +141,6 @@ public: bool IsThreaded(); JQuadPtr RetrieveCard(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL); - JQuadPtr RetrieveCardToken(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL, int tId = 0); JSample * RetrieveSample(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL); JTexture * RetrieveTexture(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL); JQuadPtr RetrieveQuad(const string& filename, float offX=0.0f, float offY=0.0f, float width=0.0f, float height=0.0f, string resname="", int style = RETRIEVE_LOCK, int submode = CACHE_NORMAL, int id = 0); diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index a702295a6..6d9620ec7 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -130,10 +130,8 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string if (bigQuad) { - Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 0.80f, 0.0, 220); - pos.actY = 142;//adjust y a little bit - bool ingame = observer?true:false; - CardGui::DrawCard(source, pos, observer->getCardSelector()->GetDrawMode(),false,false,false,ingame); + Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 1.0, 0.0, 220); + CardGui::DrawCard(source, pos, observer->getCardSelector()->GetDrawMode()); } if (targetQuad) diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 97c772451..a2c24e3e3 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -401,8 +401,8 @@ void MTGRevealingCards::Render() { if (!revealDisplay) return; - CheckUserInput(mEngine->ReadButton()); - revealDisplay->CheckUserInput(mEngine->ReadButton()); + CheckUserInput(mEngine->ReadButton()); + revealDisplay->CheckUserInput(mEngine->ReadButton()); revealDisplay->Render(); return; } @@ -1459,107 +1459,51 @@ AACopier::AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, M int AACopier::resolve() { bool tokencopied = false; + AbilityFactory af(game); MTGCardInstance * _target = (MTGCardInstance *) target; if (_target) { - MTGCard* clone; - AbilityFactory af(game); if(_target->isToken || (_target->isACopier && _target->hasCopiedToken)) - {//fix crash when copying token - clone = _target; tokencopied = true; - } - else - clone = MTGCollection()->getCardById(_target->copiedID); -/////////////////////////////////////////////////////////////////////// - MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game); - //source->copy(myClone); - if(source->controller()->playMode != Player::MODE_TEST_SUITE) - { - source->setMTGId(myClone->getMTGId()); - source->setId = myClone->setId; - source->setRarity(myClone->getRarity()); - } - source->name = myClone->name; - source->setName(myClone->name); - source->getManaCost()->resetCosts(); - if(myClone->getManaCost()) - source->getManaCost()->copy(myClone->getManaCost()); - source->colors = myClone->colors; - source->types = myClone->types; - source->text = myClone->text; - source->formattedText = myClone->formattedText; - source->basicAbilities = myClone->model->data->basicAbilities; - source->modbasicAbilities = myClone->modbasicAbilities; - for(unsigned int i = 0;i < source->cardsAbilities.size();i++) - { - MTGAbility * a = dynamic_cast(source->cardsAbilities[i]); - if(a) game->removeObserver(a); - } - source->cardsAbilities.clear(); - source->magicText = myClone->magicText; - af.getAbilities(¤tAbilities, NULL, source); - for (size_t i = 0; i < currentAbilities.size(); ++i) + if(tokencopied) + source->copy(_target->clone()); + else + { + source->copy(_target); + } + //abilities + for(unsigned int i = 0;i < source->cardsAbilities.size();i++) + { + MTGAbility * a = dynamic_cast(source->cardsAbilities[i]); + + if(a) game->removeObserver(a); + } + source->cardsAbilities.clear(); + af.getAbilities(¤tAbilities, NULL, source); + for (size_t i = 0; i < currentAbilities.size(); ++i) + { + MTGAbility * a = currentAbilities[i]; + a->source = (MTGCardInstance *) source; + if (a) { - MTGAbility * a = currentAbilities[i]; - a->source = (MTGCardInstance *) source; - if (a) + if (a->oneShot) { - if (a->oneShot) + a->resolve(); + SAFE_DELETE(a); + } + else + { + a->addToGame(); + MayAbility * dontAdd = dynamic_cast(a); + if(!dontAdd) { - a->resolve(); - SAFE_DELETE(a); - } - else - { - a->addToGame(); - MayAbility * dontAdd = dynamic_cast(a); - if(!dontAdd) - { - source->cardsAbilities.push_back(a); - } + source->cardsAbilities.push_back(a); } } } - //power - int powerMod = 0; - int toughMod = 0; - bool powerlessThanOriginal = false; - bool toughLessThanOriginal = false; - if(source->power < source->origpower) - { - powerMod = source->origpower - source->power; - powerlessThanOriginal = true; - } - else - { - powerMod =source->power - source->origpower; - } - //toughness - if(source->toughness <= source->origtoughness) - { - toughMod = source->origtoughness - source->toughness; - toughLessThanOriginal = true; - } - else - { - toughMod =source->toughness - source->origtoughness; - } - if(!source->isCDA) - { - source->power = powerlessThanOriginal?myClone->power - powerMod:myClone->power + powerMod; - source->life = toughLessThanOriginal?myClone->toughness - toughMod:myClone->toughness + toughMod; - source->toughness = toughLessThanOriginal?myClone->toughness - toughMod:myClone->toughness + toughMod; - source->origpower = myClone->origpower; - source->origtoughness = myClone->origtoughness; - } - else - {//pbonus & tbonus are already computed except damage taken... - source->life -= source->damageCount; - } - SAFE_DELETE(myClone); -/////////////////////////////////////////////////////////////////////// + } + // source->isACopier = true; source->hasCopiedToken = tokencopied; source->copiedID = _target->copiedID; @@ -1604,7 +1548,7 @@ int AACopier::resolve() andAbilityClone->addToGame(); } } - source->mPropertiesChangedSinceLastUpdate = true; + //source->mPropertiesChangedSinceLastUpdate = true; return 1; } return 0; @@ -1727,10 +1671,8 @@ AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, M { MTGCardInstance * _target = (MTGCardInstance *) target; if(_target->isFlipped && _target->hasType(Subtypes::TYPE_PLANESWALKER))//is flipping pw - { - this->forceDestroy = 1; return 0; - } + AbilityFactory af(game); if(counterstring.size()) { @@ -2847,12 +2789,10 @@ int AASacrificeCard::resolve() { Player * p = _target->controller(); MTGCardInstance * beforeCard = _target; - WEvent * e; p->game->putInGraveyard(_target); while(_target->next) _target = _target->next; - bool cardIsToken = _target->isToken ? true : false; - e = NEW WEventCardSacrifice(beforeCard, _target, cardIsToken); + WEvent * e = NEW WEventCardSacrifice(beforeCard,_target); game->receiveEvent(e); if(andAbility) { @@ -3293,15 +3233,10 @@ int AAFlip::resolve() game->removeObserver(this); return 0; } - - //701.25a Only permanents represented by double-faced cards can transform. - //(See rule 711, “Double-Faced Cards.”) If a spell or ability instructs a player - //to transform any permanent that isn’t represented by a double-faced card, nothing happens. - //***Copier and Tokens cannot transform but can be flip since flip cards are single sided*** MTGCardInstance * _target = (MTGCardInstance *) target; if (_target) { - if((_target->isACopier||_target->isToken||_target->has(Constants::CANTTRANSFORM)) && !isflipcard && !forcedcopy) + if(((_target->isACopier||_target->isToken) && !isflipcard) || _target->has(Constants::CANTTRANSFORM)) { game->removeObserver(this); return 0; @@ -3334,10 +3269,9 @@ int AAFlip::resolve() _target->text = myFlip->text; _target->formattedText = myFlip->formattedText; _target->basicAbilities = myFlip->model->data->basicAbilities; - _target->modbasicAbilities = myFlip->modbasicAbilities; cdaDamage = _target->damageCount; _target->copiedID = myFlip->getMTGId();//for copier - if(forcedcopy && _target->owner->playMode != Player::MODE_TEST_SUITE) + if(_target->owner->playMode != Player::MODE_TEST_SUITE) { _target->setMTGId(myFlip->getMTGId()); _target->setId = myFlip->setId; @@ -4064,10 +3998,10 @@ int AACloner::resolve() } } list::iterator it; - /*for (it = awith.begin(); it != awith.end(); it++) + for (it = awith.begin(); it != awith.end(); it++) {//there must be a layer of temporary abilities and original abilities spell->source->basicAbilities[*it] = 1; - }*/ + } for (it = colors.begin(); it != colors.end(); it++) { spell->source->setColor(*it); @@ -4076,11 +4010,6 @@ int AACloner::resolve() { spell->source->addType(*it); } - for(int k = 0; k < Constants::NB_BASIC_ABILITIES; k++) - { - if(_target->model->data->basicAbilities[k]) - spell->source->basicAbilities[k] = _target->model->data->basicAbilities[k]; - } if(_target->TokenAndAbility) {//the source copied a token with andAbility MTGAbility * andAbilityClone = _target->TokenAndAbility->clone(); @@ -7804,24 +7733,12 @@ int AACastCard::resolveSpell() if (game->targetChooser) { game->targetChooser->Owner = source->controller(); - if(putinplay) - { - spell = NEW Spell(game, 0,copy,game->targetChooser,NULL, 1); - spell->resolve(); - } - else - spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL, 1, 0); + spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL, 1, 0); game->targetChooser = NULL; } else { - if(putinplay) - { - spell = NEW Spell(game, 0,copy,NULL,NULL, 1); - spell->resolve(); - } - else - spell = game->mLayers->stackLayer()->addSpell(copy, NULL, NULL, 1, 0); + spell = game->mLayers->stackLayer()->addSpell(copy, NULL, NULL, 1, 0); } if (copy->has(Constants::STORM)) diff --git a/projects/mtg/src/CardDisplay.cpp b/projects/mtg/src/CardDisplay.cpp index eef02f78b..13c9f2fcd 100644 --- a/projects/mtg/src/CardDisplay.cpp +++ b/projects/mtg/src/CardDisplay.cpp @@ -263,16 +263,16 @@ void CardDisplay::Render() { mObjects[mCurr]->Render(); CardGui * cardg = ((CardGui *) mObjects[mCurr]); - Pos pos = Pos((CardGui::BigWidth / 2), CardGui::BigHeight / 2 - 10, 0.80f, 0.0, 220); - int drawMode = DrawMode::kNormal;//scale card display from 1.0f to 0.80f + Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 1.0, 0.0, 220); + int drawMode = DrawMode::kNormal; if (observer) { - pos.actY = 142;//reduce y a little + pos.actY = 145; if (x < (CardGui::BigWidth / 2)) pos.actX = SCREEN_WIDTH - 10 - CardGui::BigWidth / 2; drawMode = observer->getCardSelector()->GetDrawMode(); } - bool ingame = observer?true:false; - cardg->DrawCard(pos, drawMode, false, false, false,ingame); + + cardg->DrawCard(pos, drawMode); } } diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index cb8cf5954..ccbaa04d6 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -111,20 +111,20 @@ void CardGui::Update(float dt) PlayGuiObject::Update(dt); } -void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder, bool smallerscale, bool ingame) +void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder) { - DrawCard(card, inPosition, inMode, thumb, noborder, smallerscale, ingame); + DrawCard(card, inPosition, inMode, thumb, noborder); } -void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder, bool smallerscale, bool ingame) +void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder) { switch (inMode) { case DrawMode::kNormal: - RenderBig(inCard, inPosition, thumb, noborder, smallerscale, ingame); + RenderBig(inCard, inPosition, thumb, noborder); break; case DrawMode::kText: - AlternateRender(inCard, inPosition, noborder, smallerscale); + AlternateRender(inCard, inPosition); break; default: break; @@ -137,43 +137,29 @@ void CardGui::Render() WFont * mFont = game?game->getResourceManager()->GetWFont(Fonts::MAIN_FONT):WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); JRenderer * renderer = JRenderer::GetInstance(); TargetChooser * tc = NULL; - //fake border and mask... - JQuadPtr fakeborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); - JQuadPtr highlightborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); - JQuadPtr fakemask = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); if (game) tc = game->getCurrentTargetChooser(); bool alternate = true; JQuadPtr quad = game? game->getResourceManager()->RetrieveCard(card, CACHE_THUMB):WResourceManager::Instance()->RetrieveCard(card, CACHE_THUMB); - if(card && !card->hasCopiedToken && !card->isToken && card->name != card->model->data->name) + if(card && !card->isToken && card->name != card->model->data->name) { MTGCard * fcard = MTGCollection()->getCardByName(card->name); quad = game->getResourceManager()->RetrieveCard(fcard, CACHE_THUMB); } - if (card->hasCopiedToken && !quad.get()) - { - MTGCard * tcard = MTGCollection()->getCardById(abs(card->copiedID)); - quad = game->getResourceManager()->RetrieveCardToken(tcard, CACHE_THUMB, 1, abs(card->copiedID)); - } if (quad.get()) alternate = false; else quad = AlternateThumbQuad(card); - float cardScale = quad ? 37.f / quad->mHeight : 1; + float cardScale = quad ? 40 / quad->mHeight : 1; //I want the below for melded cards but I dont know how to adjust everything else //to look neat and clean. leaving this here incase someone else wants to pretty up the p/t box //and line up the position. - float zz = 0.99f; - float yy = 0.0f; - if (card->MeldedFrom.size()) - { - zz = 1.10f; - yy = 2.0f; - } - float scale = (actZ*zz) * cardScale; + /* if (card->MeldedFrom.size()) + cardScale = cardScale + (10 / quad->mHeight);*/ + float scale = actZ * cardScale; JQuadPtr shadow; if (actZ > 1) @@ -182,7 +168,7 @@ void CardGui::Render() if (shadow) { shadow->SetColor(ARGB(static_cast(actA)/2,255,255,255)); - renderer->RenderQuad(shadow.get(), actX + ((actZ*zz) - 1) * 15, (actY-yy) + ((actZ*zz) - 1) * 15, actT, 27 * (actZ*zz) / 16, 39 * (actZ*zz) / 16); + renderer->RenderQuad(shadow.get(), actX + (actZ - 1) * 15, actY + (actZ - 1) * 15, actT, 28 * actZ / 16, 40 * actZ / 16); } } @@ -193,7 +179,7 @@ void CardGui::Render() if (extracostshadow) { extracostshadow->SetColor(ARGB(static_cast(actA)/2,100,0,0)); - renderer->RenderQuad(extracostshadow.get(), actX + ((actZ*zz) - 1) * 15, (actY-yy) + ((actZ*zz) - 1) * 15, actT, 27 * (actZ*zz) / 16, 39 * (actZ*zz) / 16); + renderer->RenderQuad(extracostshadow.get(), actX + (actZ - 1) * 15, actY + (actZ - 1) * 15, actT, 28 * actZ / 16, 40 * actZ / 16); } } @@ -222,7 +208,7 @@ void CardGui::Render() if(white) { white->SetColor(ARGB(255,230,50,50)); - renderer->RenderQuad(white.get(), actX, (actY-yy), actT, 28 * (actZ*zz) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(white.get(), actX, actY, actT, 30 * actZ / 16, 42 * actZ / 16); } } @@ -249,22 +235,25 @@ void CardGui::Render() if(white) { white->SetColor(ARGB(255,0,0,255)); - renderer->RenderQuad(white.get(), actX, (actY-yy), actT, 28 * (actZ*zz) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(white.get(), actX, actY, actT, 30 * actZ / 16, 42 * actZ / 16); } } } if (quad) { quad->SetColor(ARGB(static_cast(actA),255,255,255)); + //fake border... + JQuadPtr fakeborder; + JQuadPtr highlightborder; + fakeborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); + highlightborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white"); if(fakeborder) { - int rgb = isBlackBorder(setlist[card->setId].c_str())?15:240; if(card->has(Constants::CANPLAYFROMGRAVEYARD)||card->has(Constants::CANPLAYFROMEXILE)||card->has(Constants::PAYZERO)) fakeborder->SetColor(ARGB((int)(actA),7,235,7));//green border else - fakeborder->SetColor(ARGB((int)(actA),rgb,rgb,rgb)); - renderer->RenderQuad(fakeborder.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16); - //renderer->DrawRect(actX, (actY-yy),((28 * (actZ*zz) + 1) / 16),(40 * (actZ*zz) / 16),ARGB((int)(actA),240,240,240)); + fakeborder->SetColor(ARGB((int)(actA),15,15,15)); + renderer->RenderQuad(fakeborder.get(), actX, actY, actT, (29 * actZ + 1) / 16, 42 * actZ / 16); } //draw border for highlighting if (game) @@ -272,26 +261,26 @@ void CardGui::Render() if (card && card->isTargetted() && highlightborder) { highlightborder->SetColor(ARGB(95,255,0,0)); - renderer->RenderQuad(highlightborder.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16); } if (card && card->isTargetter() && highlightborder) { highlightborder->SetColor(ARGB(95,0,245,0)); - renderer->RenderQuad(highlightborder.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16); } if(card->myPair && card->myPair->isInPlay(game) && highlightborder) { if(mHasFocus) { highlightborder->SetColor(ARGB(200,7,98,248)); - renderer->RenderQuad(highlightborder.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16); } if(CardView* cv = dynamic_cast(card->myPair->view)) { if(cv->mHasFocus) { highlightborder->SetColor(ARGB(200,57,28,248)); - renderer->RenderQuad(highlightborder.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16); } } } @@ -304,7 +293,7 @@ void CardGui::Render() else highlightborder->SetColor(ARGB(200,57,28,248)); - renderer->RenderQuad(highlightborder.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16); } if(CardView* cv = dynamic_cast(card->shackled->view)) { @@ -315,20 +304,20 @@ void CardGui::Render() else highlightborder->SetColor(ARGB(200,57,28,248)); - renderer->RenderQuad(highlightborder.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16); } } } } //draw the card image - renderer->RenderQuad(quad.get(), actX, (actY-yy), actT, scale, scale); + renderer->RenderQuad(quad.get(), actX, actY, actT, scale, scale); } if (alternate) { mFont->SetColor(ARGB(static_cast(actA), 0, 0, 0)); - mFont->SetScale(DEFAULT_MAIN_FONT_SCALE * 0.5f * (actZ*zz)); - mFont->DrawString(_(card->getName()), actX - (actZ*zz) * Width / 2 + 1, (actY-yy) - (actZ*zz) * Height / 2 + 1); + mFont->SetScale(DEFAULT_MAIN_FONT_SCALE * 0.5f * actZ); + mFont->DrawString(_(card->getName()), actX - actZ * Width / 2 + 1, actY - actZ * Height / 2 + 1); mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); JQuadPtr icon; @@ -345,7 +334,7 @@ void CardGui::Render() if (icon.get()) { icon->SetColor(ARGB(static_cast(actA),255,255,255)); - renderer->RenderQuad(icon.get(), actX, (actY-yy), actT); + renderer->RenderQuad(icon.get(), actX, actY, actT); icon->SetColor(ARGB(255,255,255,255)); //Putting color back as this quad is shared } @@ -357,7 +346,7 @@ void CardGui::Render() if (mor && mor->mTex) { mor->SetHotSpot(static_cast (mor->mTex->mWidth / 2), static_cast (mor->mTex->mHeight / 2)); mor->SetColor(ARGB(255,255,255,255)); - renderer->RenderQuad(mor.get(), actX, (actY-yy), actT,scale, scale); + renderer->RenderQuad(mor.get(), actX, actY, actT,scale, scale); } } @@ -369,24 +358,24 @@ void CardGui::Render() if(card->isTapped()) { if(mHasFocus) - renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,(actY-yy) - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0)); + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0)); else - renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,(actY-yy) - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0)); + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0)); } else - renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,(actY-yy) - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,255,0,0)); + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,255,0,0)); } if (card && card->isTargetter()) { if(card->isTapped()) { if(mHasFocus) - renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,(actY-yy) - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0)); + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0)); else - renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,(actY-yy) - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0)); + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0)); } else - renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,(actY-yy) - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,0,255,0)); + renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,0,255,0)); } } @@ -396,12 +385,9 @@ void CardGui::Render() mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); char buffer[200]; sprintf(buffer, "%i/%i", card->power, card->life); - //move up the p/t box by increasing ymody - float ymody = (card->isAttacker()||card->isDefenser())&&card->isTapped()?-5.0f:0.0f; - //float ymody = (card->getObserver()->getView()->getRenderedPlayer() == card->controller() ? - mody: +mody); - renderer->FillRect(actX - (13 * (actZ*zz)), (actY-yy+ymody) + 4 * (actZ*zz), 25.5f * (actZ*zz), 14 * (actZ*zz), + renderer->FillRect(actX - (13 * actZ), actY + 4 * actZ, 25.5f * actZ, 14 * actZ, ARGB(((static_cast(actA))/2),0,0,0)); - renderer->DrawRect(actX - (13 * (actZ*zz)), (actY-yy+ymody) + 4 * (actZ*zz), 25.5f * (actZ*zz), 14 * (actZ*zz), + renderer->DrawRect(actX - (13 * actZ), actY + 4 * actZ, 25.5f * actZ, 14 * actZ, ARGB(((static_cast(actA))),20,20,20)); //damaged or buffed or powered down if(card->wasDealtDamage && card->life <= 2) @@ -414,11 +400,10 @@ void CardGui::Render() mFont->SetColor(ARGB(static_cast(actA),238,130,238));//violet legendary eldrazi else mFont->SetColor(ARGB(static_cast(actA),255,255,255));//white default - mFont->SetScale((actZ*zz)); - mFont->SetScale((actZ*zz)); - //try to center p/t inside the p/t box + mFont->SetScale(actZ); + mFont->SetScale(actZ); float halfbufferW = (mFont->GetStringWidth(buffer))/2; - mFont->DrawString(buffer, actX - (halfbufferW), (actY-yy+ymody) + 5 * (actZ*zz)); + mFont->DrawString(buffer, actX - halfbufferW, actY + 7 * actZ); mFont->SetScale(1); } @@ -444,15 +429,14 @@ void CardGui::Render() else if(card->chooseacolor == 5) buff += "\n-White"; } - - if(buff != "")//enable indicator at all modes + if(!alternate && buff != "" && game->gameType() == GAME_TYPE_CLASSIC)//it seems that other game modes makes cards as tokens!!! hmmm... { mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); char buffer[200]; sprintf(buffer, "%s", buff.c_str()); mFont->SetColor(ARGB(static_cast(actA),255,215,0));//Gold indicator mFont->SetScale(0.8f); - mFont->DrawString(buffer, actX - 10 * (actZ*zz), (actY-yy) - (16 * (actZ*zz))); + mFont->DrawString(buffer, actX - 10 * actZ, actY - (16 * actZ)); mFont->SetScale(1); } @@ -471,8 +455,8 @@ void CardGui::Render() char buffer[200]; sprintf(buffer, "%i", card->counters->counters[0]->nb); mFont->SetColor(ARGB(static_cast(actA),255,255,255)); - mFont->SetScale((actZ*zz)); - mFont->DrawString(buffer, actX - 10 * (actZ*zz), (actY-yy) - (12 * (actZ*zz))); + mFont->SetScale(actZ); + mFont->DrawString(buffer, actX - 10 * actZ, actY - (12 * actZ)); mFont->SetScale(1); } } @@ -484,28 +468,34 @@ void CardGui::Render() if (shadow) { shadow->SetColor(ARGB(200,255,255,255)); - renderer->RenderQuad(shadow.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16); + renderer->RenderQuad(shadow.get(), actX, actY, actT, (28 * actZ + 1) / 16, 40 * actZ / 16); } } // Render a mask over the card, if set if (mask && quad) - JRenderer::GetInstance()->FillRect(actX - (scale * quad->mWidth / 2),(actY-yy) - (scale * quad->mHeight / 2), scale * quad->mWidth, scale* quad->mHeight, mask); + JRenderer::GetInstance()->FillRect(actX - (scale * quad->mWidth / 2),actY - (scale * quad->mHeight / 2), scale * quad->mWidth, scale* quad->mHeight, mask); if ((tc && tc->alreadyHasTarget(card)) || (game && card == game->mLayers->actionLayer()->currentActionCard))//paint targets red. { - if(fakemask) + if (card->isTapped()) { - fakemask->SetColor(ARGB(150,255,0,0)); - renderer->RenderQuad(fakemask.get(), actX, (actY-yy), actT, (26 * (actZ*zz) + 1) / 16, 38 * (actZ*zz) / 16); + renderer->FillRect(actX - (scale * quad->mWidth / 2)-7,actY - (scale * quad->mHeight / 2)+7,scale* quad->mHeight,scale * quad->mWidth, ARGB(128,255,0,0)); + } + else + { + renderer->FillRect(actX - (scale * quad->mWidth / 2),actY - (scale * quad->mHeight / 2), scale * quad->mWidth, scale* quad->mHeight, ARGB(128,255,0,0)); } } if(tc && tc->source && tc->source->view && tc->source->view->actZ >= 1.3 && card == tc->source)//paint the source green while infocus. { - if(fakemask) + if (tc->source->isTapped()) { - fakemask->SetColor(ARGB(150,0,255,0)); - renderer->RenderQuad(fakemask.get(), actX, (actY-yy), actT, (26 * (actZ*zz) + 1) / 16, 38 * (actZ*zz) / 16); + renderer->FillRect(actX - (scale * quad->mWidth / 2)-7,actY - (scale * quad->mHeight / 2)+7,scale* quad->mHeight,scale * quad->mWidth, ARGB(128,0,255,0)); + } + else + { + renderer->FillRect(tc->source->view->actX - (scale * quad->mWidth / 2),tc->source->view->actY - (scale * quad->mHeight / 2), scale*quad->mWidth, scale*quad->mHeight, ARGB(128,0,255,0)); } } @@ -535,13 +525,12 @@ JQuadPtr CardGui::AlternateThumbQuad(MTGCard * card) return q; } -void CardGui::AlternateRender(MTGCard * card, const Pos& pos, bool noborder, bool smallerscale) +void CardGui::AlternateRender(MTGCard * card, const Pos& pos) { // Draw the "unknown" card model JRenderer * renderer = JRenderer::GetInstance(); JQuadPtr q; - //set id - string cardsetname = setlist[card->setId].c_str(); + float x = pos.actX; vectoritems = gModRules.cardgui.background; @@ -565,10 +554,6 @@ void CardGui::AlternateRender(MTGCard * card, const Pos& pos, bool noborder, boo float scale = pos.actZ * 250 / q->mHeight; q->SetColor(ARGB((int)pos.actA,255,255,255)); - - //Draw border - DrawBorder(cardsetname, pos, x, noborder, smallerscale); - //render alternate renderer->RenderQuad(q.get(), x, pos.actY, pos.actT, scale, scale); } @@ -1130,7 +1115,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad) } //Renders a big card on screen. Defaults to the "alternate" rendering if no image is found -void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder, bool smallerscale, bool ingame) +void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder) { JRenderer * renderer = JRenderer::GetInstance(); //GameObserver * game = GameObserver::GetInstance(); @@ -1138,25 +1123,15 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder // card = (MTGCard*)game->mLayers->actionLayer()->currentActionCard; //i want this but ai targets cards so quickly that it can crash the game. float x = pos.actX; - //init setname - string cardsetname = setlist[card->setId].c_str(); + JQuadPtr quad = thumb ? WResourceManager::Instance()->RetrieveCard(card, RETRIEVE_THUMB) : WResourceManager::Instance()->RetrieveCard(card); MTGCardInstance * kcard = dynamic_cast(card); - if(kcard && !kcard->hasCopiedToken && !kcard->isToken && kcard->name != kcard->model->data->name) + if(kcard && !kcard->isToken && kcard->name != kcard->model->data->name) { MTGCard * fcard = MTGCollection()->getCardByName(kcard->name); quad = WResourceManager::Instance()->RetrieveCard(fcard); } - if(ingame) - { - if (kcard->hasCopiedToken && kcard->getObserver() && !quad.get()) - { - MTGCard * tcard = MTGCollection()->getCardById(abs(kcard->copiedID)); - quad = thumb ? WResourceManager::Instance()->RetrieveCardToken(tcard, RETRIEVE_THUMB, 1, abs(kcard->copiedID)) - : WResourceManager::Instance()->RetrieveCardToken(tcard, RETRIEVE_NORMAL, 1, abs(kcard->copiedID)); - } - } if (quad.get()) { if (quad->mHeight < quad->mWidth) @@ -1165,23 +1140,30 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder } quad->SetColor(ARGB(255,255,255,255)); float scale = pos.actZ * 250.f / quad->mHeight; - //Draw border - DrawBorder(cardsetname, pos, x, noborder, smallerscale); - //force smaller scale on alpha beta - smallerscale = cardsetname=="LEA"||cardsetname=="LEB"?true:smallerscale; - float modxscale = (cardsetname =="UNH")?0.02f:0.008f; - float modyscale = (cardsetname =="UNH")?0.015f:0.0075f; - bool unh = (cardsetname =="UNH")?true:false; - //Draw card - if(smallerscale && !unh) - renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale-0.001f, scale-0.001f); - else + //init setname + string cardsetname = setlist[card->setId].c_str(); + if(!noborder) { - if(ingame) - renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale+modxscale, scale+modyscale); + if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") + { + //like white border + renderer->FillRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(255,248,248,255)); + //black thin line to simulate card edge + renderer->DrawRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(150,20,20,20)); + } else - renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale+0.002f, scale+0.0015f); + { + //like black border + renderer->FillRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(255,10,10,10)); + //white thin line to simulate card edge + renderer->DrawRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(50,240,240,240)); + } + //render card image + renderer->RenderQuad(quad.get(), x, pos.actY-2, pos.actT, scale-0.02f, scale-0.02f); } + else + renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale); + RenderCountersBig(card, pos); return; } @@ -1189,63 +1171,7 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder //DebugTrace("Unable to fetch image: " << card->getImageName()); // If we come here, we do not have the picture. - AlternateRender(card, pos, noborder, smallerscale); -} - -void CardGui::DrawBorder(string cardsetname, const Pos& pos, float x, bool noborder, bool smallerscale) -{ - JRenderer * renderer = JRenderer::GetInstance(); - JQuadPtr alphabeta = WResourceManager::Instance()->RetrieveTempQuad("alphabeta.png"); - - if(!noborder) - { - if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") - {//Draw white border - renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(255,248,248,255)); - renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(150,20,20,20)); - } - else - { - if(cardsetname == "LEA") - {//BETA HAS REGULAR BORDER - //Draw more rounder black border - renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-10.f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f - 0.5f,pos.actZ * 239.4f + 8.f,10.f,ARGB(255,5,5,5)); - renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-10.f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f - 0.5f,pos.actZ * 239.4f + 8.f,10.f,ARGB(50,240,240,240)); - } - else - {//draw black border - renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(255,5,5,5)); - renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(50,240,240,240)); - } - } - } - //draw inner border - if(cardsetname == "LEA"||cardsetname == "LEB") - { - if(alphabeta.get()) - { - alphabeta->SetHotSpot(static_cast (alphabeta->mWidth / 2), static_cast (alphabeta->mHeight / 2)); - float myscale = pos.actZ * 254 / alphabeta->mHeight; - alphabeta->SetColor(ARGB((int)pos.actA,255,255,255)); - renderer->RenderQuad(alphabeta.get(), x, pos.actY+0.2f, pos.actT, myscale, myscale); - } - } -} - -bool CardGui::isBlackBorder(string cardsetname) -{ - if(cardsetname == "2ED"|| - cardsetname == "RV"|| - cardsetname == "4ED"|| - cardsetname == "5ED"|| - cardsetname == "6ED"|| - cardsetname == "7ED"|| - cardsetname == "8ED"|| - cardsetname == "9ED"|| - cardsetname == "CHR"|| - cardsetname == "DM") - return false; - return true; + AlternateRender(card, pos); } string CardGui::FormattedData(string data, string replace, string value) diff --git a/projects/mtg/src/CardPrimitive.cpp b/projects/mtg/src/CardPrimitive.cpp index b1c1df544..3e399bf66 100644 --- a/projects/mtg/src/CardPrimitive.cpp +++ b/projects/mtg/src/CardPrimitive.cpp @@ -41,10 +41,6 @@ CardPrimitive::CardPrimitive(CardPrimitive * source) if(!source) return; basicAbilities = source->basicAbilities; - for(int k=0; k < Constants::NB_BASIC_ABILITIES; k++) - { - modbasicAbilities.push_back(source->basicAbilities[k]); - } LKIbasicAbilities = source->basicAbilities; for (size_t i = 0; i < source->types.size(); ++i) @@ -82,7 +78,6 @@ CardPrimitive::~CardPrimitive() int CardPrimitive::init() { basicAbilities.reset(); - modbasicAbilities.clear(); types.clear(); diff --git a/projects/mtg/src/CardSelector.cpp b/projects/mtg/src/CardSelector.cpp index 0065f3e77..3a7de16a7 100644 --- a/projects/mtg/src/CardSelector.cpp +++ b/projects/mtg/src/CardSelector.cpp @@ -340,13 +340,7 @@ void CardSelector::Render() if (CardView* card = dynamic_cast(active) ) { if(timer > 0) - { - float modx = 14.f; - Pos npos = Pos(bigpos.x+modx,bigpos.y-4.f,bigpos.zoom-(bigpos.zoom/5),bigpos.t,bigpos.alpha); - //render card - bool ingame = observer?true:false; - card->DrawCard(npos, mDrawMode, false, false, false,ingame); - } + card->DrawCard(bigpos, mDrawMode); } } } diff --git a/projects/mtg/src/Damage.cpp b/projects/mtg/src/Damage.cpp index 5536711bd..3fff0b8f7 100644 --- a/projects/mtg/src/Damage.cpp +++ b/projects/mtg/src/Damage.cpp @@ -185,7 +185,7 @@ int Damage::resolve() _target->poisonCount += damage;//this will be changed to poison counters. _target->damageCount += damage; if(typeOfDamage == 2) - target->nonCombatDamage += damage; + _target->nonCombatDamage += damage; if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes. { vector values = MTGAllCards::getCreatureValuesById(); diff --git a/projects/mtg/src/DeckView.cpp b/projects/mtg/src/DeckView.cpp index 9fbdb8c21..43a06dd30 100644 --- a/projects/mtg/src/DeckView.cpp +++ b/projects/mtg/src/DeckView.cpp @@ -93,7 +93,7 @@ void DeckView::reloadIndexes() } } -void DeckView::renderCard(int index, int alpha, bool asThumbnail, bool addWHborder) +void DeckView::renderCard(int index, int alpha, bool asThumbnail) { WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); @@ -146,30 +146,20 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail, bool addWHbord else {//NORMAL VIEW WITH IMAGES int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText; - float modx = addWHborder ? 2.0f:0.0f; - bool smallerscale = modx > 0.0f ? true:false; - //border for editor && others since the border in cardgui:drawcard scales larger... + //border for editor && others??? string cardsetname = setlist[cardPosition.card->setId].c_str(); if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") { - JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(255,248,248,255)); - JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(150,20,20,20)); + JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(255,248,248,255)); + JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(150,20,20,20)); } else { - if (cardsetname == "LEA") - { - JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 96.75f)-(7.f+modx),(cardPosition.y - cardPosition.scale * 139.25f)-(7.f+modx),cardPosition.scale * 193.5f,cardPosition.scale * 278.5f,7.f+modx,ARGB(255,10,10,10)); - JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 96.75f)-(7.f+modx),(cardPosition.y - cardPosition.scale * 139.25f)-(7.f+modx),cardPosition.scale * 193.5f,cardPosition.scale * 278.5f,7.f+modx,ARGB(50,240,240,240)); - } - else - { - JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(255,10,10,10)); - JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(50,240,240,240)); - } + JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(255,10,10,10)); + JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(50,240,240,240)); } Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255); - CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true, smallerscale); + CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true); } int quadAlpha = alpha; if (!deck()->count(cardPosition.card)) quadAlpha /= 2; diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp index d1344768b..a1ee9b63b 100644 --- a/projects/mtg/src/ExtraCost.cpp +++ b/projects/mtg/src/ExtraCost.cpp @@ -1288,11 +1288,9 @@ int SacrificeCost::doPay() { MTGCardInstance * beforeCard = target; source->storedCard = target->createSnapShot(); - WEvent * e; target->controller()->game->putInGraveyard(target); + WEvent * e = NEW WEventCardSacrifice(beforeCard,target); GameObserver * game = target->owner->getObserver(); - bool cardIsToken = target->isToken ? true : false; - e = NEW WEventCardSacrifice(beforeCard, target, cardIsToken); game->receiveEvent(e); target = NULL; if (tc) diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index c37427ea1..ee647ae37 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -54,7 +54,6 @@ void GameObserver::cleanup() gameTurn.clear(); OpenedDisplay = NULL; AffinityNeedsUpdate = false; - legendNeedUpdate = false; } GameObserver::~GameObserver() @@ -900,17 +899,7 @@ void GameObserver::gameStateBasedEffects() int nbcards = z->nb_cards; //------------------------------ p->nomaxhandsize = (z->hasAbility(Constants::NOMAXHAND)); - //legendary - if (legendNeedUpdate) - { - for (int cl = 0; cl < nbcards; cl++) - { - MTGCardInstance * c = z->cards[cl]; - if (!c->isPhased && c->hasType(Subtypes::TYPE_LEGENDARY) && !c->has(Constants::NOLEGEND)) - checkLegendary(c); - } - legendNeedUpdate = false; - } + ///////////////////////////////////////////////// //handle end of turn effects while we're at it.// ///////////////////////////////////////////////// @@ -1030,43 +1019,6 @@ void GameObserver::gameStateBasedEffects() } } -void GameObserver::checkLegendary(MTGCardInstance * card) -{ - map::iterator it; - int destroy = 0; - - vectoroldCards; - for (it = cards.begin(); it != cards.end(); it++) - { - MTGCardInstance * comparison = (*it).first; - if (comparison != card && comparison->controller() == card->controller() && !(comparison->getName().compare(card->getName()))) - { - oldCards.push_back(comparison); - destroy = 1; - } - } - if(destroy) - { - vectorselection; - MultiAbility * multi = NEW MultiAbility(this, this->mLayers->actionLayer()->getMaxId(), card, card, NULL); - for(unsigned int i = 0;i < oldCards.size();i++) - { - AAMover *a = NEW AAMover(this, this->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New"); - a->oneShot = true; - multi->Add(a); - } - multi->oneShot = 1; - MTGAbility * a1 = multi; - selection.push_back(a1); - AAMover *b = NEW AAMover(this, this->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old"); - b->oneShot = true; - MTGAbility * b1 = b; - selection.push_back(b1); - MTGAbility * menuChoice = NEW MenuAbility(this, this->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule"); - menuChoice->addToGame(); - } -} - void GameObserver::enchantmentStatus() { for (int i = 0; i < 2; i++) diff --git a/projects/mtg/src/GameStateDuel.cpp b/projects/mtg/src/GameStateDuel.cpp index 5ab78aeb8..69221161c 100644 --- a/projects/mtg/src/GameStateDuel.cpp +++ b/projects/mtg/src/GameStateDuel.cpp @@ -1196,59 +1196,24 @@ void GameStateDuel::Render() case DUEL_STATE_BACK_TO_MAIN_MENU: if (game) { - string gtype = ""; - if(game->gameType() == GAME_TYPE_CLASSIC) - gtype = "Classic"; - else if(game->gameType() == GAME_TYPE_MOMIR) - gtype = "Momir"; - else if(game->gameType() == GAME_TYPE_RANDOM1 || game->gameType() == GAME_TYPE_RANDOM2) - gtype = "Random"; - else if(game->gameType() == GAME_TYPE_STORY) - gtype = "Story"; - else if(game->gameType() == GAME_TYPE_DEMO) - gtype = "Demo"; - else if(game->gameType() == GAME_TYPE_STONEHEWER) - gtype = "Stone Hewer"; - else if(game->gameType() == GAME_TYPE_HERMIT) - gtype = "Hermit Druid"; - else - gtype = "Blitzkrieg"; r->FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, ARGB(100,0,0,0)); char buffer[4096]; sprintf(buffer, _("Turn:%i").c_str(), game->turn); mFont->SetColor(ARGB(255,255,255,255)); mFont->DrawString(buffer, SCREEN_WIDTH / 2, 0, JGETEXT_CENTER); - mFont->DrawString(gtype, SCREEN_WIDTH / 2, SCREEN_HEIGHT - 15, JGETEXT_CENTER); } if (menu) { menu->Render(); // display the player deck names in their respective corners - string p0playmode = ""; - if(game->players[0]->playMode == Player::MODE_TEST_SUITE) - p0playmode = "AI Testsuite"; - else if(game->players[0]->playMode == Player::MODE_HUMAN) - p0playmode = "Human"; - else - p0playmode = "AI"; string playerDeckName = game->players[0]->deckName; float playerDeckNamePixelLength = mFont->GetStringWidth(playerDeckName.c_str()); - float playerModePixelLength = mFont->GetStringWidth(p0playmode.c_str()); mFont->DrawString( playerDeckName, SCREEN_WIDTH_F - playerDeckNamePixelLength, SCREEN_HEIGHT_F - 50); - mFont->DrawString( p0playmode, SCREEN_WIDTH_F - playerModePixelLength, SCREEN_HEIGHT_F - 60); if(game->players.size()>1) { - string p1playmode = ""; - if(game->players[1]->playMode == Player::MODE_TEST_SUITE) - p1playmode = "AI Testsuite"; - else if(game->players[1]->playMode == Player::MODE_HUMAN) - p1playmode = "Human"; - else - p1playmode = "AI"; string opponentDeckName = game->players[1]->deckName; - mFont->DrawString( opponentDeckName, 0, 40); - mFont->DrawString( p1playmode, 0, 50); + mFont->DrawString( opponentDeckName, 0, 50); } } } diff --git a/projects/mtg/src/GuiAvatars.cpp b/projects/mtg/src/GuiAvatars.cpp index 5645195e6..b12d2a8fd 100644 --- a/projects/mtg/src/GuiAvatars.cpp +++ b/projects/mtg/src/GuiAvatars.cpp @@ -12,24 +12,24 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) : { Add(self = NEW GuiAvatar(SCREEN_WIDTH, SCREEN_HEIGHT, false, mpDuelLayers->getRenderedPlayer(), GuiAvatar::BOTTOM_RIGHT, this)); self->zoom = 0.9f; - Add(selfGraveyard = NEW GuiGraveyard(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 7, false, mpDuelLayers->getRenderedPlayer(), this)); - Add(selfLibrary = NEW GuiLibrary(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 10 + GuiGameZone::Height + 5, false, mpDuelLayers->getRenderedPlayer(), this)); + Add(selfGraveyard = NEW GuiGraveyard(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 1, false, mpDuelLayers->getRenderedPlayer(), this)); + Add(selfLibrary = NEW GuiLibrary(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 5 + GuiGameZone::Height + 5, false, mpDuelLayers->getRenderedPlayer(), this)); //myexile - Add(selfExile = NEW GuiExile(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 34, false, mpDuelLayers->getRenderedPlayer(), this)); + Add(selfExile = NEW GuiExile(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 30, false, mpDuelLayers->getRenderedPlayer(), this)); Add(opponent = NEW GuiAvatar(0, 0, false, mpDuelLayers->getRenderedPlayerOpponent(), GuiAvatar::TOP_LEFT, this)); opponent->zoom = 0.9f; //opponentExile - Add(opponentExile = NEW GuiExile(-30 + GuiAvatar::Width * 1.2f - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, + Add(opponentExile = NEW GuiExile(-30 + GuiAvatar::Width * 1.2 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false, mpDuelLayers->getRenderedPlayerOpponent(), this)); //opponentGraveyard - Add(opponentGraveyard = NEW GuiGraveyard(5 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 5, false, + Add(opponentGraveyard = NEW GuiGraveyard(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5, false, mpDuelLayers->getRenderedPlayerOpponent(), this)); //opponentHand - Add(opponentHand = NEW GuiOpponentHand(-15 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false, + Add(opponentHand = NEW GuiOpponentHand(-15 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false, mpDuelLayers->getRenderedPlayerOpponent(), this)); //opponentLibrary - Add(opponentLibrary = NEW GuiLibrary(5 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 5 + GuiGameZone::Height + 5, false, + Add(opponentLibrary = NEW GuiLibrary(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5 + GuiGameZone::Height + 5, false, mpDuelLayers->getRenderedPlayerOpponent(), this)); observer->getCardSelector()->Add(self); @@ -145,12 +145,12 @@ void GuiAvatars::Update(float dt) void GuiAvatars::Render() { JRenderer * r = JRenderer::GetInstance(); - float w = 52; - float h = 52; + float w = 54; + float h = 54; if (opponent == active) { - r->FillRect(opponent->actX, opponent->actY, 34 * opponent->actZ, h+22 * opponent->actZ, ARGB(200,0,0,0)); - r->FillRect(opponent->actX, opponent->actY, (w * opponent->actZ)-1, (h * opponent->actZ)+2, ARGB(200,0,0,0)); + r->FillRect(opponent->actX, opponent->actY, 40 * opponent->actZ, h+20 * opponent->actZ, ARGB(200,0,0,0)); + r->FillRect(opponent->actX, opponent->actY, w * opponent->actZ, h * opponent->actZ, ARGB(200,0,0,0)); } else if (self == active) { diff --git a/projects/mtg/src/GuiHand.cpp b/projects/mtg/src/GuiHand.cpp index 22daf0612..950585dd9 100644 --- a/projects/mtg/src/GuiHand.cpp +++ b/projects/mtg/src/GuiHand.cpp @@ -122,9 +122,9 @@ void GuiHandSelf::Repos() { float dist = 180.0f / cards.size(); if (dist > 20) - dist = 18.0;//20.0 + dist = 20.0; else - y = 35.0;//40.0 + y = 40.0; for (vector::iterator it = cards.begin(); it != cards.end(); ++it) { (*it)->x = ClosedRowX; diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index 6e0ed09ff..fa6fab17c 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -62,20 +62,12 @@ void GuiPlay::HorzStack::Enstack(CardView* card) { card->x = x + baseX; card->y = y + baseY; - /*if (total < 8) + if (total < 8) x += CARD_WIDTH; else if (total < 16) x += (SCREEN_WIDTH - 200 - baseX) / total; else - x += (SCREEN_WIDTH - 50 - baseX) / total;*/ - - // new adjustment - if (total < 8) - x += CARD_WIDTH; - else if (total < 24) - x += (SCREEN_WIDTH - 200 - baseX) / total; - else - x += (SCREEN_WIDTH - 70 - baseX) / total; + x += (SCREEN_WIDTH - 50 - baseX) / total; } void GuiPlay::VertStack::Enstack(CardView* card) @@ -91,10 +83,9 @@ void GuiPlay::VertStack::Enstack(CardView* card) card->x = x + baseX; card->y = y + baseY; - y += 9; - if (++count == total - 1 && y == 9) - y += 9; - //last value += 12... + y += 12; + if (++count == total - 1 && y == 12) + y += 12; } void GuiPlay::VertStack::Render(CardView* card, iterator begin, iterator end) diff --git a/projects/mtg/src/GuiStatic.cpp b/projects/mtg/src/GuiStatic.cpp index d41002585..baa30379a 100644 --- a/projects/mtg/src/GuiStatic.cpp +++ b/projects/mtg/src/GuiStatic.cpp @@ -88,11 +88,11 @@ void GuiAvatar::Render() } if (player->getObserver()->currentPlayer == player) - r->DrawRect(x0 - 1, y0 - 1, (Width+1) * actZ, (Height+1) * actZ, ARGB((int)actA, 0, 255, 0)); + r->DrawRect(x0 - 1, y0 - 1, 36 * actZ, 51 * actZ, ARGB((int)actA, 0, 255, 0)); else if (player->getObserver()->currentActionPlayer == player) - r->DrawRect(x0, y0, (Width-1) * actZ, (Height-1) * actZ, ARGB((int)actA, 0, 0, 255)); + r->DrawRect(x0, y0, 34 * actZ, 49 * actZ, ARGB((int)actA, 0, 0, 255)); if (player->getObserver()->isInterrupting == player) - r->DrawRect(x0, y0, (Width-1) * actZ, (Height-1) * actZ, ARGB((int)actA, 255, 0, 0)); + r->DrawRect(x0, y0, 34 * actZ, 49 * actZ, ARGB((int)actA, 255, 0, 0)); //Life char buffer[10]; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 5b0ac20fd..3ff78a543 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2416,7 +2416,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG string tokenDesc = splitToken[1]; vector tokenParameters = split(tokenDesc, ','); //lets try finding a token by card name. - if (splitToken[1].size() && tokenParameters.size() <3) + if (splitToken[1].size() && (tokenParameters.size() ==1||tokenParameters.size() ==2)) { string cardName = splitToken[1]; MTGCard * safetycard = MTGCollection()->getCardByName(cardName); @@ -3396,6 +3396,25 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return a; } + //changecost - alternate for altercost + vector splitChangeCost = parseBetween(s, "changecost(", ")", true); + if(splitChangeCost.size()) + { + if(splitChangeCost[1].size()) + { + vector ccParameters = split( splitChangeCost[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 AAlterCost(observer, id, card, target, amount, color); + return a; + } + } + } + //Change Power/Toughness WParsedPT * wppt = NEW WParsedPT(s, spell, card); bool nonstatic = false; diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index cf5d094cc..008734c53 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -96,10 +96,16 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to void MTGCardInstance::copy(MTGCardInstance * card) { - MTGCard * source = card->model; + MTGCard * source = NULL; + if(card->isToken || card->hasCopiedToken) + { + source = card; + } + else + source = MTGCollection()->getCardById(card->copiedID); + CardPrimitive * data = source->data; - basicAbilities = card->model->data->basicAbilities; - modbasicAbilities = card->modbasicAbilities; + basicAbilities = data->basicAbilities; for (size_t i = 0; i < data->types.size(); i++) { types.push_back(data->types[i]); @@ -121,24 +127,30 @@ void MTGCardInstance::copy(MTGCardInstance * card) magicText = data->magicText; spellTargetType = data->spellTargetType; alias = data->alias; + copiedID = card->copiedID; + doubleFaced = data->doubleFaced; + origpower = card->origpower;//for flip + origtoughness = card->origtoughness;//for flip //Now this is dirty... int backupid = mtgid; int castMethodBackUP = this->castMethod; mtgid = source->getId(); MTGCardInstance * oldStored = this->storedSourceCard; - Spell * spell = NEW Spell(observer, this); + /*Spell * spell = NEW Spell(observer, this); observer = card->observer; AbilityFactory af(observer); af.addAbilities(observer->mLayers->actionLayer()->getMaxId(), spell); - delete spell; + delete spell;*/ if(observer->players[1]->playMode == Player::MODE_TEST_SUITE) mtgid = backupid; // there must be a way to get the token id... else { - mtgid = card->getMTGId(); /////////////////////////////////////////////////// - setId = card->setId; // Copier/Cloner cards produces the same token...// - //rarity = card->getRarity(); /////////////////////////////////////////////////// + mtgid = card->getMTGId(); /////////////////////////////////////////////////// + setId = card->setId; // Copier/Cloner cards produces the same token...// + rarity = card->getRarity(); /////////////////////////////////////////////////// + + setMTGId(card->copiedID); //**************sets copier image****************// } castMethod = castMethodBackUP; backupTargets = this->backupTargets; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index d7c8acb38..12381e0f3 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -3233,10 +3233,8 @@ int MTGLegendRule::added(MTGCardInstance * card) return 1; } -int MTGLegendRule::removed(MTGCardInstance * card) +int MTGLegendRule::removed(MTGCardInstance *) { - if (card->has(Constants::NOLEGENDRULE)) - game->legendNeedUpdate = true; return 0; } diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index 908a7145b..9ad256d50 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -202,6 +202,20 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta zones[nbzones++] = MTGGameZone::MY_EXILE; zones[nbzones++] = MTGGameZone::OPPONENT_EXILE; } + else if (zoneName.compare("mycastingzone") == 0) + { + zones[nbzones++] = MTGGameZone::MY_GRAVEYARD; + zones[nbzones++] = MTGGameZone::MY_LIBRARY; + zones[nbzones++] = MTGGameZone::MY_HAND; + zones[nbzones++] = MTGGameZone::MY_EXILE; + } + else if (zoneName.compare("oppcastingzone") == 0) + { + zones[nbzones++] = MTGGameZone::OPPONENT_GRAVEYARD; + zones[nbzones++] = MTGGameZone::OPPONENT_LIBRARY; + zones[nbzones++] = MTGGameZone::OPPONENT_HAND; + zones[nbzones++] = MTGGameZone::OPPONENT_EXILE; + } else { int zone = MTGGameZone::zoneStringToId(zoneName); diff --git a/projects/mtg/src/ThisDescriptor.cpp b/projects/mtg/src/ThisDescriptor.cpp index f2767cb51..82966f636 100644 --- a/projects/mtg/src/ThisDescriptor.cpp +++ b/projects/mtg/src/ThisDescriptor.cpp @@ -293,6 +293,19 @@ ThisDescriptor * ThisDescriptorFactory::createThisDescriptor(GameObserver* obser return NULL; } + //controller creature spells - conduit of ruin + found = s.find("creaturespells"); + if (found != string::npos) + { + ThisCreatureSpells * td = NEW ThisCreatureSpells(criterion); + if (td) + { + td->comparisonMode = mode; + return td; + } + return NULL; + } + //power found = s.find("power"); if (found != string::npos) @@ -470,6 +483,21 @@ ThisControllerlife* ThisControllerlife::clone() const return NEW ThisControllerlife(*this); } +ThisCreatureSpells::ThisCreatureSpells(int count) +{ + comparisonCriterion = count; +} + +int ThisCreatureSpells::match(MTGCardInstance * card) +{ + return matchValue(card->controller()->game->stack->seenThisTurn("creature", Constants::CAST_ALL)); +} + +ThisCreatureSpells* ThisCreatureSpells::clone() const +{ + return NEW ThisCreatureSpells(*this); +} + ThisPower::ThisPower(int power) { comparisonCriterion = power; @@ -713,4 +741,4 @@ int ThisVariable::match(MTGCardInstance * card) ThisVariable * ThisVariable::clone() const { return NEW ThisVariable(*this); -} \ No newline at end of file +} diff --git a/projects/mtg/src/WEvent.cpp b/projects/mtg/src/WEvent.cpp index f1aef1574..9573a5631 100644 --- a/projects/mtg/src/WEvent.cpp +++ b/projects/mtg/src/WEvent.cpp @@ -99,8 +99,8 @@ player(player), nb_cards(nb_cards),drawAbility(cardDraw) { } -WEventCardSacrifice::WEventCardSacrifice(MTGCardInstance * card, MTGCardInstance * after, bool token) : - WEventCardUpdate(card),cardAfter(after),istoken(token) +WEventCardSacrifice::WEventCardSacrifice(MTGCardInstance * card, MTGCardInstance * after) : + WEventCardUpdate(card),cardAfter(after) { } diff --git a/projects/mtg/src/WResourceManager.cpp b/projects/mtg/src/WResourceManager.cpp index 3557e0dec..46c51df68 100644 --- a/projects/mtg/src/WResourceManager.cpp +++ b/projects/mtg/src/WResourceManager.cpp @@ -263,46 +263,6 @@ JQuadPtr ResourceManagerImpl::RetrieveCard(MTGCard * card, int style, int submod return JQuadPtr(); } -JQuadPtr ResourceManagerImpl::RetrieveCardToken(MTGCard * card, int style, int submode, int tId) -{ - //Cards are never, ever resource managed, so just check cache. - if (!card || options[Options::DISABLECARDS].number) return JQuadPtr(); - - submode = submode | TEXTURE_SUB_CARD; - - //static std::ostringstream filename; - //filename.str(""); - string filename; - filename.reserve(4096); - //filename << setlist[card->setId] << "/" << card->getImageName(); - filename.append(setlist[card->setId]); - filename.append("/"); - int id = -card->getMTGId(); - if(tId) - id = -tId; - ostringstream imagename; - imagename << "-" << id << "t.jpg"; - filename.append(imagename.str()); - - //Aliases. - if (style == RETRIEVE_THUMB) - { - submode = submode | TEXTURE_SUB_THUMB; - style = RETRIEVE_NORMAL; - } - - JQuadPtr jq = RetrieveQuad(filename, 0, 0, 0, 0, "", style, submode | TEXTURE_SUB_5551, id); - - lastError = textureWCache.mError; - if (jq) - { - jq->SetHotSpot(static_cast (jq->mTex->mWidth / 2), static_cast (jq->mTex->mHeight / 2)); - return jq; - } - - return JQuadPtr(); -} - int ResourceManagerImpl::AddQuadToManaged(const WManagedQuad& inQuad) { int id = mIDLookupMap.size();