diff --git a/projects/mtg/Makefile b/projects/mtg/Makefile index 2943bdd53..6bab01871 100644 --- a/projects/mtg/Makefile +++ b/projects/mtg/Makefile @@ -1,4 +1,4 @@ -OBJS = objs/ActionElement.o objs/ActionLayer.o objs/ActionStack.o objs/AIPlayer.o objs/AIStats.o objs/Blocker.o objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o objs/ConstraintResolver.o objs/Counters.o objs/Damage.o objs/DamagerDamaged.o objs/DamageResolverLayer.o objs/DeckDataWrapper.o objs/DeckStats.o objs/DuelLayers.o objs/GameApp.o objs/GameLauncher.o objs/GameObserver.o objs/GameOptions.o objs/GameStateDuel.o objs/GameStateMenu.o objs/GameStateOptions.o objs/GameStateShop.o objs/GuiCardsController.o objs/GuiLayers.o objs/Logger.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o objs/MTGGuiHand.o objs/MTGGuiPlay.o objs/MTGRules.o objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/PriceList.o objs/ShopItem.o objs/SimpleMenu.o objs/SimpleMenuItem.o objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TexturesCache.o objs/Token.o objs/utils.o +OBJS = objs/ActionElement.o objs/ActionLayer.o objs/ActionStack.o objs/AIPlayer.o objs/AIStats.o objs/Blocker.o objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o objs/ConstraintResolver.o objs/Counters.o objs/Damage.o objs/DamagerDamaged.o objs/DamageResolverLayer.o objs/DeckDataWrapper.o objs/DeckStats.o objs/DuelLayers.o objs/ExtraCost.h objs/GameApp.o objs/GameLauncher.o objs/GameObserver.o objs/GameOptions.o objs/GameStateDuel.o objs/GameStateMenu.o objs/GameStateOptions.o objs/GameStateShop.o objs/GuiCardsController.o objs/GuiLayers.o objs/Logger.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o objs/MTGGuiHand.o objs/MTGGuiPlay.o objs/MTGRules.o objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/PriceList.o objs/ShopItem.o objs/SimpleMenu.o objs/SimpleMenuItem.o objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TexturesCache.o objs/Token.o objs/utils.o DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS)) RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache) diff --git a/projects/mtg/bin/Res/sets/10E/_cards.dat b/projects/mtg/bin/Res/sets/10E/_cards.dat index 652296c38..6da59fb83 100644 --- a/projects/mtg/bin/Res/sets/10E/_cards.dat +++ b/projects/mtg/bin/Res/sets/10E/_cards.dat @@ -211,6 +211,19 @@ type=Instant mana={U}{U} [/card] [card] +text=Sacrifice Bottle Gnomes: You gain 3 life. +auto={s}:life:3 +id=129495 +name=Bottle Gnomes +rarity=U +color=Artifact +type=Artifact Creature +mana={3} +power=1 +subtype=Gnome +toughness=3 +[/card] +[card] text={T}: Add {1} to your mana pool. {T}: Add {G} or {W} to your mana pool. Brushland deals 1 damage to you. auto={T}:Add {1} auto={T}:Add {G} && Damage 1 controller @@ -256,6 +269,19 @@ subtype=Spider toughness=3 [/card] [card] +text=Sacrifice Composite Golem: Add {W}{U}{B}{R}{G} to your mana pool. +auto={s}:Add {W}{U}{B}{R}{G} +id=135275 +name=Composite Golem +rarity=U +color=Artifact +type=Artifact Creature +mana={6} +power=4 +subtype=Golem +toughness=4 +[/card] +[card] text=Draw two cards. auto=draw:2 id=134757 @@ -335,6 +361,19 @@ type=Instant mana={W} [/card] [card] +text={B}, {T}, Sacrifice Doomed Necromancer: Return target creature card from your graveyard to play. +auto={B},{T},{S}:moveTo(myinplay) target(creature|mygraveyard) +id=129880 +name=Doomed Necromancer +rarity=R +color=Black +type=Creature +mana={2}{B} +power=2 +subtype=Human Cleric Mercenary +toughness=2 +[/card] +[card] text={5}{R}{R}: Put a 5/5 red Dragon creature token with flying into play. (It can't be blocked except by creatures with flying or reach.) auto={5}{R}{R}:token(Dragon,creature dragon, 5/5,flying red) id=143024 @@ -1063,6 +1102,17 @@ type=Artifact mana={2} [/card] [card] +text={T}: Add {1} to your mana pool. {1}, {T}, Sacrifice Mind Stone: Draw a card. +auto={T}:Add{1} +auto={1}{T}{S}:draw:1 +id=135280 +name=Mind Stone +rarity=U +color=Artifact +type=Artifact +mana={0} +[/card] +[card] text=First strike, forestwalk, vigilance (This creature deals combat damage before creatures without first strike, it's unblockable as long as defending player controls a Forest, and attacking doesn't cause this creature to tap.) abilities=First strike, forestwalk, vigilance, legendary id=106405 @@ -1087,6 +1137,19 @@ type=Enchantment mana={2}{W} [/card] [card] +text=Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player. +auto={s}:Damage:1 target(creature,player) +id=134748 +name=Mogg Fanatic +rarity=U +color=Red +type=Creature +mana={R} +power=1 +subtype=Goblin +toughness=1 +[/card] +[card] text={T}: Add {R} to your mana pool. auto={T}: Add {R} id=129652 @@ -1127,6 +1190,19 @@ type=Basic Land subtype=Mountain [/card] [card] +text=Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn. +auto={s(creature|myinplay)}:2/2 +id=129653 +name=Nantuko Husk +rarity=U +color=Black +type=Creature +mana={2}{B} +power=2 +subtype=Zombie Insect +toughness=2 +[/card] +[card] text=Destroy target artifact or enchantment. target=artifact,enchantment id=129656 @@ -1230,6 +1306,16 @@ subtype=Horror toughness=2 [/card] [card] +text={2}, {T}, Sacrifice a creature: Draw a card. +auto={2},{T},{S(creature|myinplay)}:draw:1 +id=135281 +name=Phyrexian Vault +rarity=U +color=Artifact +type=Artifact +mana={3} +[/card] +[card] text=Shroud (This creature can't be the target of spells or abilities.) abilities=shroud id=130526 @@ -1635,6 +1721,20 @@ type=Instant mana={R} [/card] [card] +text=When Siege-Gang Commander comes into play, put three 1/1 red Goblin creature tokens into play. {1}{R}, Sacrifice a Goblin: Siege-Gang Commander deals 2 damage to target creature or player. +auto=token(Goblin,creature goblin, 1/1,red)*3 +auto={1},{R},{S(goblin|myinplay)}:Damage:2 target(creature,player) +id=130539 +name=Siege-Gang Commander +rarity=R +color=Red +type=Creature +mana={3}{R}{R} +power=2 +subtype=Goblin +toughness=2 +[/card] +[card] text=Flying, first strike (This creature can't be blocked except by creatures with flying or reach, and it deals combat damage before creatures without first strike.) abilities=Flying, first strike id=129735 diff --git a/projects/mtg/bin/Res/sets/10E/todo.dat b/projects/mtg/bin/Res/sets/10E/todo.dat index 99bde671b..e8fcdd925 100644 --- a/projects/mtg/bin/Res/sets/10E/todo.dat +++ b/projects/mtg/bin/Res/sets/10E/todo.dat @@ -244,18 +244,7 @@ power=2 subtype=Elemental Spirit toughness=1 [/card] -[card] -text=Sacrifice Bottle Gnomes: You gain 3 life. -id=129495 -name=Bottle Gnomes -rarity=U -color=Artifact -type=Artifact Creature -mana={3} -power=1 -subtype=Gnome -toughness=3 -[/card] + [card] text=Whenever Cephalid Constable deals combat damage to a player, return up to that many target permanents that player controls to their owners' hands. id=135261 @@ -386,18 +375,6 @@ type=Sorcery mana={G} [/card] [card] -text=Sacrifice Composite Golem: Add {W}{U}{B}{R}{G} to your mana pool. -id=135275 -name=Composite Golem -rarity=U -color=Artifact -type=Artifact Creature -mana={6} -power=4 -subtype=Golem -toughness=4 -[/card] -[card] text=Put target attacking creature on the bottom of its owner's library. Its controller gains life equal to its toughness. id=130528 name=Condemn @@ -529,18 +506,6 @@ type=Sorcery mana={B}{B} [/card] [card] -text={B}, {T}, Sacrifice Doomed Necromancer: Return target creature card from your graveyard to play. -id=129880 -name=Doomed Necromancer -rarity=R -color=Black -type=Creature -mana={2}{B} -power=2 -subtype=Human Cleric Mercenary -toughness=2 -[/card] -[card] text={3}, {T}: Double the amount of each type of mana in your mana pool. id=135243 name=Doubling Cube @@ -1110,28 +1075,6 @@ type=Sorcery mana={2}{B} [/card] [card] -text={T}: Add {1} to your mana pool. {1}, {T}, Sacrifice Mind Stone: Draw a card. -id=135280 -name=Mind Stone -rarity=U -color=Artifact -type=Artifact -mana={2} -[/card] - -[card] -text=Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player. -id=134748 -name=Mogg Fanatic -rarity=U -color=Red -type=Creature -mana={R} -power=1 -subtype=Goblin -toughness=1 -[/card] -[card] text=Trample (If this creature would deal enough combat damage to its blockers to destroy them, you may have it deal the rest of its damage to defending player.) Molimo, Maro-Sorcerer's power and toughness are each equal to the number of lands you control. id=106368 name=Molimo, Maro-Sorcerer @@ -1165,18 +1108,6 @@ subtype=Lhurgoyf toughness=* [/card] [card] -text=Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn. -id=129653 -name=Nantuko Husk -rarity=U -color=Black -type=Creature -mana={2}{B} -power=2 -subtype=Zombie Insect -toughness=2 -[/card] -[card] text=Target player gains 8 life. id=129655 name=Natural Spring @@ -1278,15 +1209,7 @@ power=4 subtype=Zombie Minion toughness=4 [/card] -[card] -text={2}, {T}, Sacrifice a creature: Draw a card. -id=135281 -name=Phyrexian Vault -rarity=U -color=Artifact -type=Artifact -mana={3} -[/card] + [card] text=As Pithing Needle comes into play, name a card. Activated abilities of sources with the chosen name can't be played unless they're mana abilities. id=129526 @@ -1607,18 +1530,7 @@ color=Red type=Instant mana={1}{R}{R} [/card] -[card] -text=When Siege-Gang Commander comes into play, put three 1/1 red Goblin creature tokens into play. {1}{R}, Sacrifice a Goblin: Siege-Gang Commander deals 2 damage to target creature or player. -id=130539 -name=Siege-Gang Commander -rarity=R -color=Red -type=Creature -mana={3}{R}{R} -power=2 -subtype=Goblin -toughness=2 -[/card] + [card] text=Draw three cards, then discard a card. id=136217 diff --git a/projects/mtg/bin/Res/sets/ALA/_cards.dat b/projects/mtg/bin/Res/sets/ALA/_cards.dat index b4272f3fe..33e2c9adb 100644 --- a/projects/mtg/bin/Res/sets/ALA/_cards.dat +++ b/projects/mtg/bin/Res/sets/ALA/_cards.dat @@ -94,6 +94,15 @@ subtype=Drake toughness=3 [/card] [card] +text={1}{U}, {T}, Sacrifice Courier's Capsule: Draw two cards. +auto={1}{U}, {T}, {S}: Draw:2 +id=174800 +name=Courier's Capsule +rarity=C +type=Artifact +mana={1}{U} +[/card] +[card] text=Reach (This can block creatures with flying.) Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) abilities=reach,exalted id=174960 @@ -162,6 +171,15 @@ subtype=Human Rogue toughness=1 [/card] [card] +text={2}{W}, {T}, Sacrifice Dispeller's Capsule: Destroy target artifact or enchantment. +auto={2}{W},{T},{S}:destroy target(artifact,enchantment) +id=174830 +name=Dispeller's Capsule +rarity=C +type=Artifact +mana={W} +[/card] +[card] text=Put two 1/1 red Goblin creature tokens into play. auto=token(Goblin,creature goblin, 1/1,red)*2 id=174936 @@ -208,6 +226,25 @@ subtype=Elf Shaman toughness=1 [/card] [card] +text=Flash {B}, {T}, Sacrifice an artifact: Draw a card. +abilities=flash +auto={B},{T},{S(artifact|myinplay)}:draw:1 +id=175138 +name=Etherium Astrolabe +rarity=U +type=Artifact +mana={2}{U} +[/card] +[card] +text={1}{B}, {T}, Sacrifice Executioner's Capsule: Destroy target nonblack creature. +auto={1}{B}{T}{S}:destroy target(creature[-black]) +id=174895 +name=Executioner's Capsule +rarity=C +type=Artifact +mana={B} +[/card] +[card] text={2}{U}: Untap target artifact. auto={2}{U}:untap target(artifact) id=174888 @@ -606,6 +643,15 @@ type=Basic Land subtype=Plains [/card] [card] +text={4}{W}, {T}, Sacrifice Protomatter Powder: Return target artifact card from your graveyard to play. +auto={4}{W}{T}{S}:moveTo(myInPlay) target(artifact|mygraveyard) +id=174833 +name=Protomatter Powder +rarity=U +type=Artifact +mana={2}{U} +[/card] +[card] text=Trample Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) abilities=trample,exalted id=174959 @@ -722,6 +768,19 @@ subtype=Human Knight toughness=2 [/card] [card] +text=Flying {B}, Sacrifice a creature: Regenerate Skeletal Kathari. +abilities=flying +auto={B},{S(creature|myinplay)}:regenerate +id=175119 +name=Skeletal Kathari +rarity=C +type=Creature +mana={4}{B} +power=3 +subtype=Bird Skeleton +toughness=2 +[/card] +[card] text=Vigilance {T}: Add {G} to your mana pool. abilities=vigilance auto={T}:Add{G} diff --git a/projects/mtg/bin/Res/sets/ALA/todo.dat b/projects/mtg/bin/Res/sets/ALA/todo.dat index e3f36b6ad..b8119b3e8 100644 --- a/projects/mtg/bin/Res/sets/ALA/todo.dat +++ b/projects/mtg/bin/Res/sets/ALA/todo.dat @@ -174,11 +174,13 @@ toughness=1 [/card] [card] text=As an additional cost to play Bone Splinters, sacrifice a creature. Destroy target creature. +target=creature +auto=destroy id=174967 name=Bone Splinters rarity=C type=Sorcery -mana={B} +mana={B},{S(creature|myinplay)} [/card] [card] text=Choose one or both - Branching Bolt deals 3 damage to target creature with flying; and/or Branching Bolt deals 3 damage to target creature without flying. @@ -266,14 +268,7 @@ power=3 subtype=Zombie Wizard toughness=3 [/card] -[card] -text={1}{U}, {T}, Sacrifice Courier's Capsule: Draw two cards. -id=174800 -name=Courier's Capsule -rarity=C -type=Artifact -mana={1}{U} -[/card] + [card] text=Reveal the top three cards of your library. Target opponent may choose to put those cards into your hand. If he or she doesn't, put those cards into your graveyard and draw five cards. id=178091 @@ -343,14 +338,7 @@ power=1 subtype=Human Wizard toughness=1 [/card] -[card] -text={2}{W}, {T}, Sacrifice Dispeller's Capsule: Destroy target artifact or enchantment. -id=174830 -name=Dispeller's Capsule -rarity=C -type=Artifact -mana={W} -[/card] + [card] text={2}{R}, {T}, Sacrifice a black creature, a red creature, and a green creature: Search your library for a card named Hellkite Overlord and put it into play. Then shuffle your library. @@ -432,14 +420,7 @@ name=Esper Panorama rarity=C type=Land [/card] -[card] -text=Flash {B}, {T}, Sacrifice an artifact: Draw a card. -id=175138 -name=Etherium Astrolabe -rarity=U -type=Artifact -mana={2}{U} -[/card] + [card] text=Artifact spells you play cost {1} less to play. id=176435 @@ -471,14 +452,6 @@ type=Sorcery mana={2}{W} [/card] [card] -text={1}{B}, {T}, Sacrifice Executioner's Capsule: Destroy target nonblack creature. -id=174895 -name=Executioner's Capsule -rarity=C -type=Artifact -mana={B} -[/card] -[card] text=At the end of your turn, if you control a creature with power 5 or greater, you may have Exuberant Firestoker deal 2 damage to target player. {T}: Add {1} to your mana pool. id=175049 name=Exuberant Firestoker @@ -986,14 +959,7 @@ power=7 subtype=Demon toughness=7 [/card] -[card] -text={4}{W}, {T}, Sacrifice Protomatter Powder: Return target artifact card from your graveyard to play. -id=174833 -name=Protomatter Powder -rarity=U -type=Artifact -mana={2}{U} -[/card] + [card] text=Counter target spell. Its controller loses 3 life and you gain 3 life. id=176450 @@ -1301,17 +1267,7 @@ type=Artifact mana={X} subtype=Equipment [/card] -[card] -text=Flying {B}, Sacrifice a creature: Regenerate Skeletal Kathari. -id=175119 -name=Skeletal Kathari -rarity=C -type=Creature -mana={4}{B} -power=3 -subtype=Bird Skeleton -toughness=2 -[/card] + [card] text=Skeletonize deals 3 damage to target creature. When a creature dealt damage this way is put into a graveyard this turn, put a 1/1 black Skeleton creature token into play with "{B}: Regenerate this creature." id=175070 diff --git a/projects/mtg/bin/Res/sets/EVE/_cards.dat b/projects/mtg/bin/Res/sets/EVE/_cards.dat index 787a3c11e..60af67b7d 100644 --- a/projects/mtg/bin/Res/sets/EVE/_cards.dat +++ b/projects/mtg/bin/Res/sets/EVE/_cards.dat @@ -53,6 +53,18 @@ type=Sorcery mana={2}{BG}{BG} [/card] [card] +text=Sacrifice Duergar Assailant: Duergar Assailant deals 1 damage to target attacking or blocking creature. +auto={S}:damage:1 target(creature[attacking;blocking]) +id=150975 +name=Duergar Assailant +rarity=C +type=Creature +mana={RW} +power=1 +subtype=Dwarf Soldier +toughness=1 +[/card] +[card] text=Wither (This deals damage to creatures in the form of -1/-1 counters.) {RW}: Duergar Cave-Guard gets +1/+0 until end of turn. abilities=wither auto={RW}:1/0 @@ -183,6 +195,19 @@ subtype=Scarecrow toughness=1 [/card] [card] +text=Flying {1}{W}, Sacrifice Kithkin Spellduster: Destroy target enchantment. Persist (When this creature is put into a graveyard from play, if it had no -1/-1 counters on it, return it to play under its owner's control with a -1/-1 counter on it.) +abilities=flying,persist +auto={1}{W}{S}:destroy target(enchantment) +id=152096 +name=Kithkin Spellduster +rarity=C +type=Creature +mana={4}{W} +power=2 +subtype=Kithkin Wizard +toughness=3 +[/card] +[card] text=Fear Persist (When this creature is put into a graveyard from play, if it had no -1/-1 counters on it, return it to play under its owner's control with a -1/-1 counter on it.) abilities=fear,persist id=147437 diff --git a/projects/mtg/bin/Res/sets/EVE/todo.dat b/projects/mtg/bin/Res/sets/EVE/todo.dat index 6cbbee153..6d7f61fa8 100644 --- a/projects/mtg/bin/Res/sets/EVE/todo.dat +++ b/projects/mtg/bin/Res/sets/EVE/todo.dat @@ -370,17 +370,7 @@ power=2 subtype=Faerie Rogue toughness=1 [/card] -[card] -text=Sacrifice Duergar Assailant: Duergar Assailant deals 1 damage to target attacking or blocking creature. -id=150975 -name=Duergar Assailant -rarity=C -type=Creature -mana={RW} -power=1 -subtype=Dwarf Soldier -toughness=1 -[/card] + [card] text=When Duergar Hedge-Mage comes into play, if you control two or more Mountains, you may destroy target artifact. When Duergar Hedge-Mage comes into play, if you control two or more Plains, you may destroy target enchantment. id=159068 @@ -705,18 +695,6 @@ type=Instant mana={3}{GU} [/card] [card] -text=Flying {1}{W}, Sacrifice Kithkin Spellduster: Destroy target enchantment. Persist (When this creature is put into a graveyard from play, if it had no -1/-1 counters on it, return it to play under its owner's control with a -1/-1 counter on it.) -abilities=flying -id=152096 -name=Kithkin Spellduster -rarity=C -type=Creature -mana={4}{W} -power=2 -subtype=Kithkin Wizard -toughness=3 -[/card] -[card] text=When Kithkin Zealot comes into play, you gain 1 life for each black and/or red permanent target opponent controls. id=154346 name=Kithkin Zealot @@ -1148,6 +1126,8 @@ mana={3}{G}{G} [/card] [card] text={1}, Sacrifice a Scarecrow: Draw a card. {4}, {T}: Return target artifact creature card from your graveyard to play. +auto={1}{S(scarecrow|myinplay)}:draw:1 +auto={4}{T}:moveTo(myinplay) target(artifact|mygraveyard) id=157979 name=Scarecrone rarity=R diff --git a/projects/mtg/bin/Res/sets/ICE/_cards.dat b/projects/mtg/bin/Res/sets/ICE/_cards.dat index 509330c85..3633444a6 100644 --- a/projects/mtg/bin/Res/sets/ICE/_cards.dat +++ b/projects/mtg/bin/Res/sets/ICE/_cards.dat @@ -1,5 +1,4 @@ #SET: ICE AGE -#VERSION: 1.6.1 #Number of playable cards: >132 #Note : please try to keep cards in alphabetical order of the name if possible [card] @@ -300,6 +299,7 @@ rarity=C type=Instant mana={B} [/card] +[card] text=Counter target spell if it is red or destroy target permanent if it is red. id=2508 alias=1191 @@ -309,6 +309,15 @@ type=Instant mana={U} [/card] [card] +text={2}{T}: Sacrifice Pit Trap to bury target creature without flying that is attacking you. +auto={2}{T}{S}:bury target(creature[-flying;attacking]|opponentinplay) +id=2419 +name=Pit Trap +rarity=U +type=Artifact +mana={2} +[/card] +[card] text=Counter target spell if it is blue or destroy target permanent if it is blue. id=2649 alias=1312 @@ -716,6 +725,21 @@ subtype=Erne toughness=2 [/card] [card] +text={T}: Sacrifice a forest to add three mana in any combination of red and/or green to your mana pool. Play this ability as an interrupt. +id=2646 +auto={T}{S(forest|myinplay)}: add {G}{G}{G} +auto={T}{S(forest|myinplay)}: add {G}{G}{R} +auto={T}{S(forest|myinplay)}: add {G}{R}{R} +auto={T}{S(forest|myinplay)}: add {R}{R}{R} +name=Orcish Lumberjack +rarity=C +type=Creature +mana={R} +power=1 +subtype=Orc +toughness=1 +[/card] +[card] text=Swampwalk abilities=swampwalk id=2581 @@ -1189,6 +1213,15 @@ subtype=Pyknite toughness=1 [/card] [card] +text={1}{T}: Sacrifice a creature to have Skull Catapult deal 2 damage to target creature or player. +id=2422 +name=Skull Catapult +auto={1}{T}{S(creature|myinplay)}:Damage:2 target(creature,player) +rarity=U +type=Artifact +mana={4} +[/card] +[card] text=Counts as a wall {1}: +1/+0 until end of turn {1}: +0/+1 until end of turn3: Snow Fortress deals 1 damage to target creature without flying that is attacking you. id=2423 abilities=defender @@ -1435,3 +1468,12 @@ rarity=U type=Instant mana={R} [/card] +[card] +text={0}: Sacrifice a land to gain 2 life. +auto={S(land|myinplay)}:life:2 +id=2436 +name=Zuran Orb +rarity=U +type=Artifact +mana={0} +[/card] diff --git a/projects/mtg/bin/Res/sets/ICE/todo.dat b/projects/mtg/bin/Res/sets/ICE/todo.dat index ed8c9d670..24e39351c 100644 --- a/projects/mtg/bin/Res/sets/ICE/todo.dat +++ b/projects/mtg/bin/Res/sets/ICE/todo.dat @@ -35,11 +35,11 @@ mana={3} [/card] [card] text={1}{T}: Sacrifice Barbed Sextant to add one mana of any color to your mana pool. Play this ability as an interrupt. Draw a card at the beginning of the next turn's upkeep. -auto={1}{T}: add {G} -auto={1}{T}: add {B} -auto={1}{T}: add {W} -auto={1}{T}: add {R} -auto={1}{T}: add {U} +auto={1}{T}{S}: add {G} +auto={1}{T}{S}: add {B} +auto={1}{T}{S}: add {W} +auto={1}{T}{S}: add {R} +auto={1}{T}{S}: add {U} id=2398 name=Barbed Sextant rarity=C @@ -175,14 +175,7 @@ rarity=R type=Artifact mana={4} [/card] -[card] -text={2}{T}: Sacrifice Pit Trap to bury target creature without flying that is attacking you. -id=2419 -name=Pit Trap -rarity=U -type=Artifact -mana={2} -[/card] + [card] text=Comes into play tapped.{X}{T}: Sacrifice Runed Arch. X target creatures with power no greater than 2 cannot be blocked this turn. Other effects may later be used to increase a creature's power beyond 2. id=2420 @@ -2256,40 +2249,9 @@ power=* subtype=Wall toughness=* [/card] -[card] -text={0}: Sacrifice a land to gain 2 life. -id=2436 -name=Zuran Orb -rarity=U -type=Artifact -mana={0} -[/card] -[card] -text={T}: Sacrifice a forest to add three mana in any combination of red and/or green to your mana pool. Play this ability as an interrupt. -id=2646 -auto={T}:destroy target(forest|myinplay) -auto={T}: add {G}{G}{G} -auto={T}: add {R}{R}{R} -auto={T}: add {G}{R}{R} -auto={T}: add {G}{G}{R} -name=Orcish Lumberjack -rarity=C -type=Creature -mana={R} -power=1 -subtype=Orc -toughness=1 -[/card] -[card] -text={1}{T}: Sacrifice a creature to have Skull Catapult deal 2 damage to target creature or player. -id=2422 -name=Skull Catapult -auto={1}{T}:Damage:2 target(creature,player) -auto={1}{T}:destroy target(creature|myinplay) -rarity=U -type=Artifact -mana={4} -[/card] + + + [card] text=When Kjeldoran Dead comes into play, sacrifice a creature.{B}: Regenerate id=2461 diff --git a/projects/mtg/bin/Res/sets/SHM/_cards.dat b/projects/mtg/bin/Res/sets/SHM/_cards.dat index 4abbe9c96..83fb7ddd0 100644 --- a/projects/mtg/bin/Res/sets/SHM/_cards.dat +++ b/projects/mtg/bin/Res/sets/SHM/_cards.dat @@ -38,6 +38,18 @@ subtype=Goblin Knight toughness=4 [/card] [card] +text=Plainswalk {2}{R}, Sacrifice Boggart Arsonists: Destroy target Scarecrow or Plains. +auto={2}{R}{S}:destroy target(scarecrow,plains) +id=158684 +name=Boggart Arsonists +rarity=C +type=Creature +mana={2}{R} +power=2 +subtype=Goblin Rogue +toughness=1 +[/card] +[card] text=Haste Wither (This deals damage to creatures in the form of -1/-1 counters.) abilities=haste,wither id=153970 @@ -87,6 +99,18 @@ subtype=Merfolk Rogue toughness=2 [/card] [card] +text={GW}, {T}, Sacrifice Elvish Hexhunter: Destroy target enchantment. +auto={GW}{T}{S}:destroy target(enchantment) +id=141958 +name=Elvish Hexhunter +rarity=C +type=Creature +mana={GW} +power=1 +subtype=Elf Shaman +toughness=1 +[/card] +[card] text={T}: Add {1} to your mana pool. {RG}, {T}: Add {R}{R}, {R}{G}, or {G}{G} to your mana pool. auto={T}:Add{1} auto={RG}{T}:Add{R}{R} @@ -156,6 +180,18 @@ subtype=Treefolk Shaman toughness=6 [/card] [card] +text=Sacrifice Fulminator Mage: Destroy target nonbasic land. +auto={S}:destroy target(land[-plains;-mountain;-swamp;-forest;-island]) +id=142009 +name=Fulminator Mage +rarity=R +type=Creature +mana={1}{BR}{BR} +power=2 +subtype=Elemental Shaman +toughness=2 +[/card] +[card] text=Flying Other blue creatures you control get +1/+1. Other black creatures you control get +1/+1. abilities=flying auto=lord(creature[blue]|myinplay) 1/1 @@ -193,6 +229,18 @@ rarity=R type=Land [/card] [card] +text=Sacrifice Heap Doll: Remove target card in a graveyard from the game. +auto={S}:moveTo(removedfromgame) target(*|graveyard) +id=154395 +name=Heap Doll +rarity=U +type=Artifact Creature +mana={1} +power=1 +subtype=Scarecrow +toughness=1 +[/card] +[card] text={T}: Add {U} to your mana pool. auto={T}:Add{U} id=158237 @@ -668,6 +716,19 @@ mana={2}{UB} subtype=Aura [/card] [card] +text={T}, Sacrifice a Mountain: Valleymaker deals 3 damage to target creature. {T}, Sacrifice a Forest: Choose a player. That player adds {G}{G}{G} to his or her mana pool. +auto={T}{S(mountain|myinplay)}:Damage:3 target(creature) +auto={T}{S(forest|myinplay)}:Add{G}{G}{G} +id=159397 +name=Valleymaker +rarity=R +type=Creature +mana={5}{RG} +power=5 +subtype=Giant Shaman +toughness=5 +[/card] +[card] text={2}, {T}: Tap target creature. auto={2},[T}:tap target(creature) id=147420 diff --git a/projects/mtg/bin/Res/sets/SHM/todo.dat b/projects/mtg/bin/Res/sets/SHM/todo.dat index 63ea2802f..16069644d 100644 --- a/projects/mtg/bin/Res/sets/SHM/todo.dat +++ b/projects/mtg/bin/Res/sets/SHM/todo.dat @@ -181,17 +181,7 @@ rarity=U type=Enchantment mana={2}{B} [/card] -[card] -text=Plainswalk {2}{R}, Sacrifice Boggart Arsonists: Destroy target Scarecrow or Plains. -id=158684 -name=Boggart Arsonists -rarity=C -type=Creature -mana={2}{R} -power=2 -subtype=Goblin Rogue -toughness=1 -[/card] + [card] text=If you would gain life, you gain twice that much life instead. id=146751 @@ -506,17 +496,7 @@ rarity=C type=Artifact mana={2} [/card] -[card] -text={GW}, {T}, Sacrifice Elvish Hexhunter: Destroy target enchantment. -id=141958 -name=Elvish Hexhunter -rarity=C -type=Creature -mana={GW} -power=1 -subtype=Elf Shaman -toughness=1 -[/card] + [card] text=Creatures target player controls can't block this turn. Ember Gale deals 1 damage to each white and/or blue creature that player controls. id=158766 @@ -642,17 +622,7 @@ rarity=R type=Instant mana={2}{GW}{GW}{GW} [/card] -[card] -text=Sacrifice Fulminator Mage: Destroy target nonbasic land. -id=142009 -name=Fulminator Mage -rarity=R -type=Creature -mana={1}{BR}{BR} -power=2 -subtype=Elemental Shaman -toughness=2 -[/card] + [card] text=When Furystoke Giant comes into play, other creatures you control gain "{T}: This creature deals 2 damage to target creature or player" until end of turn. Persist (When this creature is put into a graveyard from play, if it had no -1/-1 counters on it, return it to play under its owner's control with a -1/-1 counter on it.) id=152069 @@ -816,17 +786,7 @@ rarity=U type=Instant mana={RG} [/card] -[card] -text=Sacrifice Heap Doll: Remove target card in a graveyard from the game. -id=154395 -name=Heap Doll -rarity=U -type=Artifact Creature -mana={1} -power=1 -subtype=Scarecrow -toughness=1 -[/card] + [card] text=At the beginning of your upkeep, remove a -1/-1 counter from each creature you control. Persist (When this creature is put into a graveyard from play, if it had no -1/-1 counters on it, return it to play under its owner's control with a -1/-1 counter on it.) id=153312 @@ -2069,17 +2029,7 @@ type=Artifact mana={3} subtype=Equipment [/card] -[card] -text={T}, Sacrifice a Mountain: Valleymaker deals 3 damage to target creature. {T}, Sacrifice a Forest: Choose a player. That player adds {G}{G}{G} to his or her mana pool. -id=159397 -name=Valleymaker -rarity=R -type=Creature -mana={5}{RG} -power=5 -subtype=Giant Shaman -toughness=5 -[/card] + [card] text=Vexing Shusher can't be countered. {RG}: Target spell can't be countered by spells or abilities. id=146016 diff --git a/projects/mtg/bin/Res/sets/TMP/_cards.dat b/projects/mtg/bin/Res/sets/TMP/_cards.dat new file mode 100644 index 000000000..a9653e1a7 --- /dev/null +++ b/projects/mtg/bin/Res/sets/TMP/_cards.dat @@ -0,0 +1,1322 @@ +#TEMPEST +#Initial Release by Dr. Solomat +[card] +text=First strike {W}: Target creature gains first strike until end of turn. +auto={W}:first strike target(creature) +id=4857 +name=Advance Scout +rarity=C +color=White +mana={1}{W} +type=Creature +subtype=Human Soldier Scout +power=1 +toughness=1 +abilities=first strike +[/card] +[card] +text=Destroy target artifact, creature, or land. Aftershock deals 3 damage to you. +target=artifact,creature,land +auto=destroy +auto=life:-3 +id=4800 +name=Aftershock +color=Black +rarity=C +mana={2}{R}{R} +type=Sorcery +[/card] +[card] +text=Flying +id=4861 +name=Armored Pegasus +rarity=C +color=White +mana={1}{W} +type=Creature +subtype=Pegasus +power=1 +toughness=2 +abilities=flying +[/card] +[card] +text=Flying, swampwalk +id=4749 +name=Bayou Dragonfly +rarity=C +color=Green +mana={1}{G} +type=Creature +subtype=Insect +power=1 +toughness=1 +abilities=flying,swampwalk +[/card] +[card] +text=Isalndwalk +id=4690 +name=Benthic Behemoth +rarity=R +color=Blue +mana={5}{U}{U}{U} +type=Creature +subtype=Serpent +power=7 +toughness=6 +abilities=islandwalk +[/card] +[card] +text=Destroy all islands. +auto=destroy all(island) +id=4805 +name=Boil +colour=Red +rarity=U +mana={3}{R} +type=Instant +[/card] +[card] +text=Reach (This creature can block creatures with flying.) +id=4751 +name=Canopy Spider +color=Green +rarity=C +mana={1}{G} +type=Creature +subtype=Spider +power=1 +toughness=3 +abilities=Reach +[/card] +[card] +text=Reach (This creature can block creatures with flying.) +id=4807 +name=Canyon Wildcat +color=Red +rarity=C +mana={1}{R} +type=Creature +subtype=Cat +power=2 +toughness=1 +abilities=Mountainwalk +[/card] +[card] +text={1}: Prevent all damage against you from one black source. If a source deals damage to you more than once in a turn, you may pay 1 each time to prevent the damage. +id=4864 +alias=1335 +name=Circle of Protection: Black +colour=White +rarity=C +mana={1}{W} +type=Enchantment +[/card] +[card] +text={1}: Prevent all damage against you from one blue source. If a source deals damage to you more than once in a turn, you may pay 1 each time to prevent the damage. +id=4865 +alias=1336 +name=Circle of Protection: Blue +colour=White +rarity=C +mana={1}{W} +type=Enchantment +[/card] +[card] +text={1}: Prevent all damage against you from one green source. If a source deals damage to you more than once in a turn, you may pay 1 each time to prevent the damage. +id=4866 +alias=1337 +name=Circle of Protection: Green +colour=White +rarity=C +mana={1}{W} +type=Enchantment +[/card] +[card] +text={1}: Prevent all damage against you from one red source. If a source deals damage to you more than once in a turn, you may pay 1 each time to prevent the damage. +id=4867 +alias=1338 +name=Circle of Protection: Red +colour=White +rarity=C +mana={1}{W} +type=Enchantment +[/card] +[card] +text={1}: Prevent all damage against you from one white source. If a source deals damage to you more than once in a turn, you may pay 1 each time to prevent the damage. +id=4869 +alias=1339 +name=Circle of Protection: White +colour=White +rarity=C +mana={1}{W} +type=Enchantment +[/card] +[card] +text=All Sliver creatures gain "{2}:regenerate" +auto=lord(sliver) {2}:regenerate +id=4640 +name=Clot Sliver +colour=Black +rarity=C +mana={1}{B} +type=Creature +subtype=Sliver +power=1 +toughness=1 +abilities={2}:regenerate +[/card] +[card] +text=First strike +id=4599 +name=Coiled Tinviper +color=Artifact +rarity=C +mana={3} +type=Artifact Creature +subtype=Snake +power=2 +toughness=1 +abilities=first strike +[/card] +[card] +text=Counter target spell. +id=4693 +alias=1196 +name=Counterspell +Colour=Blue +rarity=C +mana={U}{U} +type=Instant +[/card] +[card] +text=Destroy target nonblack creature. It can't be regenerated. +target=creature[-black] +auto=bury +id=4645 +name=Dark Banishing +color=Black +rarity=C +mana={2}{B} +type=Instant +[/card] +[card] +text=Add {B}{B}{B} to your mana pool. +auto=Add {B}{B}{B} +id=4646 +name=Dark Ritual +colour=Black +rarity=C +mana={B} +type=Instant +[/card] +[card] +text={B}: Regenerate Darkling Stalker. {B}: Darkling Stalker gets +1/+1 until end of turn. +id=4647 +name=Darkling Stalker +colour=Black +rarity=C +mana={3}{B} +type=Creature +subtype=Shade Spirit +auto={B}:regenerate +auto={B}:1/1 +power=1 +toughness=1 +[/card] +[card] +text={B}{B}: Target creature gains shadow until end of turn. (It can block or be blocked by only creatures with shadow.) +auto={B}{B}:shadow target(creature) +id=4648 +name=Dauthi Embrace +color=Black +rarity=U +mana={2}{B} +type=Enchantment +[/card] +[card] +text=Shadow (This creature can block or be blocked by only creatures with shadow.) +id=4651 +name=Dauthi Marauder +color=Black +rarity=C +mana={2}{B} +type=Creature +subtype=Dauthi Minion +power=3 +toughness=1 +abilities=shadow +[/card] +[card] +text=Shadow (This creature can block or be blocked by only creatures with shadow.) {1}{B}: Dauthi Mercenary gets +1/+0 until end of turn. +id=4652 +name=Dauthi Mercenary +color=Black +rarity=U +mana={2}{B} +type=Creature +subtype=Dauthi Knight Mercenary +auto={1}{B}:1/0 +power=2 +toughness=1 +abilities=shadow +[/card] +[card] +text=Destroy target artifact or enchantment. +target=artifact,enchantment +auto=destroy +id=4872 +name=Disenchant +colour=White +rarity=C +mana={1}{W} +type=Instant +[/card] +[card] +text=Counter target spell. Draw a card. +id=4695 +alias=1196 +auto=draw:1 +name=Dismiss +colour=Blue +rarity=U +mana={2}{U}{U} +type=Instant +[/card] +[card] +text=Legendary Other Elf creatures have forestwalk. Other Elves have shroud. (They can't be the targets of spells or abilities.) +id=4757 +name=Eladamri, Lord of Leaves +auto=lord(elf) forestwalk +auto=lord(elf) shroud +colour=Green +rarity=R +mana={G}{G} +type=Creature +subtype=Elf Warrior +power=2 +toughness=2 +abilities=legendary +[/card] +[card] +text=Enchant creature (Target a creature as you play this. This card comes into play attached to that creature.) Enchanted creature gets -2/-2. +id=4661 +target=creature +auto=:-2/-2 +name=Enfeeblement +color=Black +rarity=C +mana={B}{B} +type=Enchantment +subtype=Aura +[/card] +[card] +text=Flying +id=4700 +name=Fighting Drake +colour=Blue +rarity=U +mana={2}{U}{U} +type=Creature +subtype=Sliver +power=2 +toughness=4 +abilities=flying +[/card] +[card] +text=Flying {R}: Firefly gets +1/+0 until end of turn. +id=4813 +name=Firefly +colour=Red +rarity=U +mana={3}{R} +type=Creature +subtype=Insect +auto={R}:1/0 +power=1 +toughness=1 +abilities=flying +[/card] +[card] +text={R}: Flowstone Giant gets +2/-2 until end of turn. +id=4816 +name=Flowstone Giant +colour=Red +rarity=C +mana={2}{R}{R} +type=Creature +subtype=Giant +auto={R}:2/-2 +power=3 +toughness=3 +[/card] +[card] +text=Flying {R}: Flowstone Wyvern gets +2/-2 until end of turn. +id=4818 +name=Flowstone Wyvern +colour=Red +rarity=R +mana={3}{R}{R} +type=Creature +subtype=Drake +auto={R}:2/-2 +power=3 +toughness=3 +abilities=flying +[/card] +[card] +text={T}: Add {G} to your mana pool. +auto={T}: Add {G} +id=4927 +name=Forest +rarity=L +color=Land +type=Basic Land +subtype=Forest +[/card] +[card] +text={T}: Add {G} to your mana pool. +auto={T}: Add {G} +id=4928 +name=Forest +rarity=L +color=Land +type=Basic Land +subtype=Forest +[/card] +[card] +text={T}: Add {G} to your mana pool. +auto={T}: Add {G} +id=4929 +name=Forest +rarity=L +color=Land +type=Basic Land +subtype=Forest +[/card] +[card] +text={T}: Add {G} to your mana pool. +auto={T}: Add {G} +id=4926 +name=Forest +rarity=L +color=Land +type=Basic Land +subtype=Forest +[/card] +[card] +text=Enchant creature When Frog Tongue comes into play, draw a card. Enchanted creature has reach. (It can block creatures with flying.) +target=creature +auto=reach +auto=draw:1 +id=4762 +name=Frog Tongue +colour=C +rarity=U +mana={1}{G +type=Enchantment +subtype=Aura +[/card] +[card] +text=Target blocking creature gets +4/+4 until end of turn. Draw a card. +target=creature[blocking] +auto=:4/4 +auto=draw:1 +id=4876 +name=Gallantry +color=White +rarity=U +mana={1}{W} +type=Instant +[/card] +[card] +text={U}: Giant Crab gains shroud until end of turn. (It can't be the target of spells or abilities.) +id=4703 +name=Giant Crab +colour=Blue +rarity=C +mana={4}{U} +type=Creature +subtype=Crab +auto={U}:shroud +power=3 +toughness=3 +[/card] +[card] +text=Enchant creature (Target a creature as you play this. This card comes into play attached to that creature.) Enchanted creature gets +2/+2. +id=4820 +target=creature +auto=:2/2 +name=Giant Strength +color=Red +rarity=C +mana={R}{R} +type=Enchantment +subtype=Aura +[/card] +[card] +text=Artifacts have shroud. (They can't be the targets of spells or abilities.) +auto=lord(artifact) shroud +id=4878 +name=Hanna's Custody +color=White +rarity=R +mana={2}{W} +type=Enchantment +[/card] +[card] +text=All Sliver creatures have haste. +id=4824 +auto=lord(sliver) Haste +name=Heart Sliver +colour=Red +rarity=C +mana={1}{R} +type=Creature +subtype=Sliver +power=1 +toughness=1 +abilities=Haste +[/card] +[card] +text=Reachshadow (This creature can block creatures with shadow as though they didn't have shadow. +id=4765 +name=Heartwood Dryad +rarity=C +color=Green +mana={1}{G} +type=Creature +subtype=Dryad +power=2 +toughness=1 +abilities=reachshadow +[/card] +[card] +text=Forestwalk +id=4767 +name=Heartwood Treefolk +rarity=U +color=Green +mana={2}{G}{G} +type=Creature +subtype=Treefolk +power=2 +toughness=3 +abilities=forestwalk +[/card] +[card] +text=Enchant creature Enchanted creature gets +1/+5. +target=creature +auto=:1/5 +id=4879 +name=Hero's Resolve +color=White +rarity=C +mana={1}{W} +type=Enchantment +subtype=Aura +[/card] +[card] +text=All Sliver creatures have trample. +auto=lord(sliver) Trample +id=4768 +name=Horned Sliver +colour=Green +rarity=U +mana={2}{G} +type=Creature +subtype=Sliver +power=2 +toughness=2 +abilities=trample +[/card] +[card] +id=4704 +name=Horned Turtle +colour=Blue +rarity=C +mana={2}{U} +type=Creature +subtype=Turtle +power=1 +toughness=4 +[/card] +[card] +text={T}: Add {U} to your mana pool. +auto={T}:add {U} +id=4949 +name=Island +rarity=L +type=Basic Land +subtype=Island +[/card] +[card] +text={T}: Add {U} to your mana pool. +auto={T}:add {U} +id=4951 +name=Island +rarity=L +type=Basic Land +subtype=Island +[/card] +[card] +text={T}: Add {U} to your mana pool. +auto={T}:add {U} +id=4950 +name=Island +rarity=L +type=Basic Land +subtype=Island +[/card] +[card] +text={T}: Add {U} to your mana pool. +auto={T}:add {U} +id=4952 +name=Island +rarity=L +type=Basic Land +subtype=Island +[/card] +[card] +text=First strike {W}{W}: Knight of Dawn gains protection from the color of your choice until end of turn. +id=4883 +name=Knight of Dawn +colour=White +rarity=U +mana={1}{W}{W} +type=Creature +subtype=Human Knight +auto={W}{W}:protection from white +auto={W}{W}:protection from blue +auto={W}{W}:protection from black +auto={W}{W}:protection from red +auto={W}{W}:protection from green +power=2 +toughness=2 +abilites=first strike +[/card] +[card] +text=Lightning Blast deals 4 damage to target creature or player. +target=creature,player +auto=Damage:4 +id=4827 +name=Lightning Blast +color=Red +rarity=C +mana={3}{R} +type=Instant +[/card] +[card] +text=Haste (This creature can attack and {T} as soon as it comes under your control.) +id=4828 +name=Lightning Elemental +color=Red +rarity=C +mana={3}{R} +type=Creature +subtype=Elemental +power=4 +toughness=1 +abilities=Haste +[/card] +[card] +id=4829 +name=Lowland Giant +colour=Red +rarity=C +mana={2}{R}{R} +type=Creature +subtype=Giant +power=3 +toughness=3 +[/card] +[card] +text={T}: Add {1} to your mana pool. +auto={T}: Add {1} +id=4616 +name=Manakin +color=Artifact +rarity=C +mana={2} +type=Artifact Creature +subtype=Construct +power=1 +toughness=1 +[/card] +[card] +text={U}: Manta Riders gains flying until end of turn. +id=4711 +name=Manta Riders +colour=Blue +rarity=C +mana={U} +type=Creature +subtype=Merfolk +auto={U}:flying +power=1 +toughness=1 +[/card] +[card] +text={W}, {T}: Tap target creature. +auto={W}{T}:tap target(creature) +id=4887 +name=Master Decoy +rarity=C +color=White +mana={1}{W} +type=Creature +subtype=Human Soldier +power=1 +toughness=2 +[/card] +[card] +text=Flying {T}: Mawcor deals 1 damage to target creature or player. +auto={T}:damage:1 target(creature,player) +id=4712 +name=Mawcor +colour=Blue +rarity=R +mana={3}{U}{U} +type=Creature +subtype=Beast +power=3 +toughness=3 +abilities=flying +[/card] +[card] +id=4617 +name=Metallic Sliver +colour=Artifact +rarity=C +mana={1} +type=Artifact Creature +subtype=Sliver +power=1 +toughness=1 +[/card] +[card] +text={T}: Add {R} to your mana pool. +auto={T}: Add {R} +id=4945 +name=Mountain +rarity=L +color=Land +type=Basic Land +subtype=Mountain +[/card] +[card] +text={T}: Add {R} to your mana pool. +auto={T}: Add {R} +id=4946 +name=Mountain +rarity=L +color=Land +type=Basic Land +subtype=Mountain +[/card] +[card] +text={T}: Add {R} to your mana pool. +auto={T}: Add {R} +id=4947 +name=Mountain +rarity=L +color=Land +type=Basic Land +subtype=Mountain +[/card] +[card] +text={T}: Add {R} to your mana pool. +auto={T}: Add {R} +id=4948 +name=Mountain +rarity=L +color=Land +type=Basic Land +subtype=Mountain +[/card] +[card] +text=All Sliver creatures get +1/+1. +id=4772 +auto=lord(sliver) 1/1 +name=Muscle Sliver +colour=Green +rarity=C +mana={1}{G} +type=Creature +subtype=Sliver +power=2 +subtype=Sliver +toughness=2 +[/card] +[card] +text=Target player gains 8 life. +target=player +auto=life:8 +id=4773 +name=Natural Spring +color=Green +rarity=C +mana={3}{G}{G} +type=Sorcery +[/card] +[card] +text=Destroy all green creatures. Those creatures cannot be regenerated. +auto=bury all(creature[green]) +id=4676 +name=Perish +rarity=U +mana={2}{B} +type=Sorcery +[/card] +[card] +id=4622 +name=Phyrexian Hulk +color=Artifact +rarity=U +mana={6} +type=Artifact Creature +subtype=Golem +power=5 +toughness=4 +[/card] +[card] +text=Shroud (This creature can't be the target of spells or abilities.) +id=4778 +name=Pincher Beetles +color=Green +rarity=C +mana={2}{G} +type=Creature +subtype=Insect +power=3 +toughness=1 +abilities=shroud +[/card] +[card] +text={T}: Add {W} to your mana pool. +auto={T}: Add {W} +id=4955 +name=Plains +rarity=L +color=Land +type=Basic Land +subtype=Plains +[/card] +[card] +text={T}: Add {W} to your mana pool. +auto={T}: Add {W} +id=4953 +name=Plains +rarity=L +color=Land +type=Basic Land +subtype=Plains +[/card] +[card] +text={T}: Add {W} to your mana pool. +auto={T}: Add {W} +id=4954 +name=Plains +rarity=L +color=Land +type=Basic Land +subtype=Plains +[/card] +[card] +text={T}: Add {W} to your mana pool. +auto={T}: Add {W} +id=4956 +name=Plains +rarity=L +color=Land +type=Basic Land +subtype=Plains +[/card] +[card] +text={2}, {T}: Tap or untap target creature. +auto={2}{T}:tap target(creature) +auto={2}{T}:untap target(creature) +id=4624 +name=Puppet Strings +color=Artifact +rarity=U +mana={3} +type=Artifact +[/card] +[card] +text=Destroy target land. +target=land +auto=destroy +id=4678 +name=Rain of Tears +rarity=U +color=Black +mana={1}{B}{B} +type=Sorcery +[/card] +[card] +text=First strike {G}: Regenerate Ranger en-Vec. +id=4914 +name=Ranger en-Vec +rarity=U +color=White,Green +mana={1}{W}{G} +type=Creature +subtype=Human Soldier Archer +auto={G}:regenerate +power=2 +toughness=2 +abilities=first strike +[/card] +[card] +text={B}: Destroy target artifact, creature, or land you control. +id=4679 +name=Rats of Rath +colour=Black +rarity=C +mana={2}{B} +type=Creature +subtype=Rat +auto={B}:destroy target(artifact,creature,land|myinplay) +power=2 +toughness=1 +[/card] +[card] +text=Target creature loses shadow until end of turn. Draw a card. +target=creature +auto=-shadow +auto=draw:1 +id=4780 +name=Reality Anchor +color=Green +rarity=C +mana={1}{G} +type=Instant +[/card] +[card] +text=Trample (If this creature would deal enough combat damage to its blockers to destroy them, you may have it deal the rest of its damage to defending player.) +id=4785 +name=Rootbreaker Wurm +rarity=C +color=Green +mana={5}{G}{G} +type=Creature +subtype=Wurm +power=6 +toughness=6 +abilities=trample +[/card] +[card] +text={1}{G}: Rootwalla gets +2/+2 until end of turn. Play this ability only once each turn. +auto={1}{G}:2/2 limit:1 +id=4786 +name=Rootwalla +color=Green +rarity=C +mana={2}{G} +type=Creature +subtype=Lizard +power=2 +toughness=2 +[/card] +[card] +text={T}: Rootwater Hunter deals 1 damage to target creature or player. +id=4721 +name=Rootwater Hunter +auto={T}:damage:1 target(creature,player) +colour=Blue +rarity=C +mana={2}{U} +type=Creature +subtype=Merfolk +power=1 +toughness=1 +[/card] +[card] +text=(This creature deals combat damage before creatures without first strike.) {R}: Sandstone Warrior gets +1/+0 until end of turn. +id=4841 +name=Sandstone Warrior +colour=Red +rarity=C +mana={2}{R}{R} +type=Creature +subtype=Human Soldier Warrior +auto={R}:1/0 +power=3 +toughness=3 +abilities=first strike +[/card] +[card] +text=Flying {1}{B}: Regenerate Screeching Harpy. +id=4684 +name=Screeching Harpy +color=Black +rarity=U +mana={2}{B}{B} +type=Creature +subtype=Harpy Beast +auto={1}{B}:regenerate +power=2 +toughness=2 +abilities=flying +[/card] +[card] +text={T}: Untap target creature. +id=4788 +name=Seeker of Skybreak +color=Green +rarity=C +mana={1}{G} +type=Creature +subtype=Elf +auto={T}:untap target(creature) +power=2 +toughness=1 +[/card] +[card] +text=Target creature gains shadow until end of turn. Draw a card. +target=creature +auto=shadow +auto=draw:1 +id=4725 +name=Shadow Rift +color=Blue +rarity=C +mana={U} +type=Instant +[/card] +[card] +text=Flying, first strike +id=4917 +name=Sky Spirit +rarity=U +color=White,Blue +mana={1}{W}{U} +type=Creature +subtype=Spirit +power=2 +toughness=2 +abilities=flying,first strike +[/card] +[card] +text=Flying +id=4927 +name=Skyshroud Condor +rarity=U +color=Blue +mana={1}{U} +type=Creature +subtype=Bird +power=2 +toughness=2 +abilities=flying +[/card] +[card] +text={T}: Add {G} to your mana pool. {1}: Add {W} or {R} to your mana pool. +id=4789 +name=Skyshroud Elf +color=Green +rarity=C +mana={1}{G} +type=Creature +subtype=Elf +auto={T}:Add {G} +auto={1}:Add {W} +auto={1}:Add {R} +power=1 +toughness=1 +[/card] +[card] +text={1}{G}: Regenerate Skyshroud Troll. +id=4791 +name=Skyshroud Troll +color=Green +rarity=C +mana={2}{G}{G} +type=Creature +subtype=Troll Giant +auto={1}{G}:regenerate +power=3 +toughness=3 +[/card] +[card] +text=Shadow (This creature can block or be blocked by only creatures with shadow.) {1}{W}: Soltari Crusader gets +1/+0 until end of turn. +id=4899 +name=Soltari Crusader +color=White +rarity=U +mana={2}{W} +type=Creature +subtype=Soltari Knight +auto={1}{W}:1/0 +power=2 +toughness=1 +abilities=shadow +[/card] +[card] +text={W}: Soltari Emissary gains shadow until end of turn. +id=4900 +name=Soltari Emissary +color=White +rarity=R +mana={1}{W} +type=Creature +subtype=Soltari Soldier +auto={W}:shadow +power=2 +toughness=1 +[/card] +[card] +text=Shadow (This creature can block or be blocked by only creatures with shadow.) +id=4901 +name=Soltari Foot Soldier +color=White +rarity=C +mana={W} +type=Creature +subtype=Soltari Soldier +power=1 +toughness=1 +abilities=shadow +[/card] +[card] +text=Protection from black Shadow (This creature can block or be blocked by only creatures with shadow.) +id=4903 +name=Soltari Monk +color=White +rarity=U +mana={W}{W} +type=Creature +subtype=Soltari Monk Cleric +power=2 +toughness=1 +abilities=shadow,protection from black +[/card] +[card] +text=Protection from red Shadow (This creature can block or be blocked by only creatures with shadow.) +id=4904 +name=Soltari Priest +color=White +rarity=U +mana={W}{W} +type=Creature +subtype=Soltari Cleric +power=2 +toughness=1 +abilities=shadow,protection from red +[/card] +[card] +text=Counter target spell with converted mana cost X. +id=4728 +alias=1224 +name=Spell Blast +colour=Blue +rarity=C +mana={X}{U} +type=Instant +[/card] +[card] +text=When Staunch Defenders comes into play, you gain 4 life. +id=4907 +name=Staunch Defenders +color=White +rarity=U +mana={3}{W}{W} +type=Creature +subtype=Human Soldier +auto=life:4 +power=3 +toughness=4 +[/card] +[card] +text=Enchant enchantment You control enchanted enchantment. +target=enchantment +alias=1194 +id=4729 +name=Steal Enchantment +colour=Blue +rarity=U +mana={U}{U} +type=Enchantment +subtype=Aura +[/card] +[card] +text=Destroy target land. +target=land +auto=destroy +id=4850 +name=Stone Rain +colour=Red +rarity=C +mana={2}{R} +type=Sorcery +[/card] +[card] +text={G}{G}: Tap target creature with flying. +id=4793 +auto={G}{G}:tap target(creature[flying]) +name=Storm Front +colour=Green +rarity=U +mana={G} +type=Enchantment +[/card] +[card] +text={T}: Add {B} to your mana pool. +auto={T}: Add {B} +id=4925 +name=Swamp +rarity=L +type=Basic Land +subtype=Swamp +[/card] +[card] +text={T}: Add {B} to your mana pool. +auto={T}: Add {B} +id=4922 +name=Swamp +rarity=L +type=Basic Land +subtype=Swamp +[/card] +[card] +text={T}: Add {B} to your mana pool. +auto={T}: Add {B} +id=4923 +name=Swamp +rarity=L +type=Basic Land +subtype=Swamp +[/card] +[card] +text={T}: Add {B} to your mana pool. +auto={T}: Add {B} +id=4924 +name=Swamp +rarity=L +type=Basic Land +subtype=Swamp +[/card] +[card] +text=All Sliver creatures have first strike. +id=4908 +auto=lord(sliver) first strike +name=Talon Sliver +colour=White +rarity=C +mana={1}{W} +type=Creature +subtype=Sliver +power=1 +toughness=1 +abilities=First Strike +[/card] +[card] +text=Shadow (This creature can block or be blocked by only creatures with shadow) +id=4735 +name=Thalakos Sentry +color=Blue +rarity=C +mana={1}{U} +type=Creature +subtype=Thalakos Soldier +power=1 +toughness=2 +abilities=shadow +[/card] +[card] +id=4794 +name=Trained Armodon +color=Green +rarity=C +mana={1}{G}{G} +type=Creature +subtype=Elephant +power=3 +toughness=3 +[/card] +[card] +text=Destroy all enchantments. +id=4795 +auto=destroy all(enchantment) +name=Tranquility +colour=Green +rarity=C +mana={2}{G} +type=Sorcery +[/card] +[card] +text=Destroy target artifact. +id=4798 +target=artifact +auto=destroy +name=Verdigris +colour=Green +rarity=U +mana={2}{G} +type=Sorcery +[/card] +[card] +text=Defender (This creature can't attack.) Wall of Diffusion can block creatures with shadow as though they didn't have shadow. +id=4855 +name=Wall of Diffusion +colour=Red +rarity=C +mana={1}{R} +type=Creature +subtype=Wall +power=0 +toughness=5 +abilities=defender, reachshadow +[/card] +[card] +text={T}: Target creature gains flying until end of turn. +id=4744 +name=Wind Dancer +colour=Blue +rarity=U +mana={1}{U} +type=Creature +subtype=Faerie +auto={T}:flying target(creature) +power=1 +toughness=1 +abilities=flying +[/card] +[card] +text=Flying +id=4745 +name=Wind Drake +colour=Blue +rarity=C +mana={2}{U} +type=Creature +subtype=Drake +power=2 +toughness=2 +abilities=flying +[/card] +[card] +text=All Sliver creatures have flying. +id=4746 +name=Winged Sliver +colour=Blue +rarity=C +mana={1}{U} +type=Creature +subtype=Sliver +auto=lord(Sliver) flying +power=1 +toughness=1 +abilities=flying +[/card] +[card] +text=Destroy target land. +id=4799 +target=land +auto=destroy +name=Winter's Grasp +colour=Green +rarity=U +mana={1}{G}{G} +type=Sorcery +[/card] diff --git a/projects/mtg/bin/Res/sets/TMP/todo.dat b/projects/mtg/bin/Res/sets/TMP/todo.dat new file mode 100644 index 000000000..9aea6b53d --- /dev/null +++ b/projects/mtg/bin/Res/sets/TMP/todo.dat @@ -0,0 +1,82 @@ +[card] +text=Each Sliver gains,{2}:This creature gets +0/+1 until end of turn. +auto={2}:0/1 +auto=lord(sliver) {2}:0/1 +id=4689 +name=Armor Sliver +rarity=U +type=Creature +mana={2}{W} +power=2 +subtype=Sliver +toughness=2 +[/card] +[card] +text=Target attacking or blocking creature gets +4/+0 until end of turn. Destroy that creature at end of turn. +target=creature[attacking,blocking] +auto=4/0 +auto=@next endofturn:destroy +id=4804 +name=Blood Frenzy +rarity=C +color=Red +type=Instant +mana={1}{R} +[/card] +[card] +text=When Cloudchaser Eagle comes into play, destroy target enchantment. +target=enchantment +auto=destroy +id=4871 +name=Cloudchaser Eagle +color=White +rarity=C +mana={2}{W} +type=Creature +subtype=Bird +power=2 +toughness=2 +abilities=flying +[/card] +[card] +text=Legendary Fear When Commander Greven il-Vec comes into play, sacrifice a creature. +target=creature|myinplay +auto=bury +id=4643 +name=Commander Greven il-Vec +colour=Black +rarity=R +mana={3}{B}{B}{B} +type=Creature +subtype=Human Warrior +power=7 +toughness=5 +abilities=fear,legendary +[/card] +[card] +text={R}: Flowstone Salamander deals 1 damage to target creature blocking it. +id=4817 +name=Flowstone Salamander +colour=Red +rarity=U +mana={3}{R}{R} +type=Creature +subtype=Salamander +auto={R}:damage:1 target(creature[blocking]) +power=3 +toughness=4 +[/card] + [card] +text=When Gravedigger comes into play, you may return target creature card from your graveyard to your hand. +target=creature|myGraveyard +alias=1174 +id=4665 +name=Gravedigger +rarity=U +colour=Black +mana={3}{B} +type=Creature +subtype=Zombie +power=2 +toughness=2 +[/card] \ No newline at end of file diff --git a/projects/mtg/include/ActionStack.h b/projects/mtg/include/ActionStack.h index 5ead2c600..3b584492e 100644 --- a/projects/mtg/include/ActionStack.h +++ b/projects/mtg/include/ActionStack.h @@ -145,6 +145,7 @@ class ActionStack :public GuiLayer{ int CombatDamages(); int CombatDamages(int firststrike); int has(Interruptible * action); + int has(MTGAbility * ability); #if defined (WIN32) || defined (LINUX) void Dump(); #endif diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index fc0fe4040..6f9bda0de 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -81,10 +81,15 @@ class ADrawer:public ActivatedAbility{ return 1; } + + const char * getMenuText(){ return "Draw"; } + ~ADrawer(){ + OutputDebugString("Deleting ADrawer\n"); + } }; @@ -170,6 +175,17 @@ public: if (p){ MTGGameZone * fromZone = _target->getCurrentZone(); MTGGameZone * destZone = MTGGameZone::stringToZone(destinationZone, source); + + //inplay is a special zone ! + for (int i=0; i < 2; i++){ + if (destZone == game->players[i]->game->inPlay){ + Spell * spell = NEW Spell(_target); + game->players[i]->game->putInZone(_target, fromZone, game->players[i]->game->stack); + spell->resolve(); + delete spell; + return 1; + } + } p->game->putInZone(_target,fromZone,destZone); } return 1; diff --git a/projects/mtg/include/ExtraCost.h b/projects/mtg/include/ExtraCost.h new file mode 100644 index 000000000..eb1360dac --- /dev/null +++ b/projects/mtg/include/ExtraCost.h @@ -0,0 +1,49 @@ +#ifndef _EXTRACOST_H_ +#define _EXTRACOST_H_ + +#include +using std::vector; + +class TargetChooser; +class MTGCardInstance; +class MTGAbility; + +class ExtraCost{ +public: + TargetChooser * tc; + MTGCardInstance * source; + ExtraCost(TargetChooser *_tc = NULL); + virtual int setPayment(MTGCardInstance * card) = 0; + virtual int isPaymentSet() = 0; + virtual int doPay() = 0; + virtual void Render(){}; + virtual int setSource(MTGCardInstance * _source); +}; + +class ExtraCosts{ +public: + vectorcosts; + MTGCardInstance * source; + MTGAbility * action; + ExtraCosts(); + void Render(); + int tryToSetPayment(MTGCardInstance * card); + int isPaymentSet(); + int doPay(); + int reset(); + int setAction(MTGAbility * _action, MTGCardInstance * _source); + void Dump(); +}; + +class SacrificeCost: public ExtraCost{ +public: + MTGCardInstance * target; + SacrificeCost(TargetChooser *_tc = NULL); + virtual int setPayment(MTGCardInstance * card); + virtual int isPaymentSet(); + virtual int doPay(); + virtual void Render(); + virtual int setSource(MTGCardInstance * _source); +}; + +#endif \ No newline at end of file diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index 600549628..54e888db3 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -38,6 +38,7 @@ class GameObserver{ PhaseRing * phaseRing; int cancelCurrentAction(); int currentGamePhase; + ExtraCosts * waitForExtraPayment; int oldGamePhase; TargetChooser * targetChooser; DuelLayers * mLayers; diff --git a/projects/mtg/include/ManaCost.h b/projects/mtg/include/ManaCost.h index 05542c223..6a24f274e 100644 --- a/projects/mtg/include/ManaCost.h +++ b/projects/mtg/include/ManaCost.h @@ -6,13 +6,19 @@ class ManaCostHybrid; +class ExtraCosts; +class ExtraCost; +class MTGAbility; +class MTGCardInstance; class ManaCost{ protected: int cost[Constants::MTG_NB_COLORS+1]; ManaCostHybrid * hybrids[10]; int nbhybrids; + public: + ExtraCosts * extraCosts; static ManaCost * parseManaCost(string value, ManaCost * _manacost = NULL); void init(); void x(); @@ -21,6 +27,7 @@ class ManaCost{ ~ManaCost(); ManaCost(ManaCost * _manaCost); void copy (ManaCost * _manaCost); + int isNull(); int getConvertedCost(); string toString(); int getCost(int color); @@ -30,6 +37,16 @@ class ManaCost{ int hasColor(int color); int remove (int color, int value); int add(int color, int value); + + // + // Extra Costs (sacrifice...) + // + int addExtraCost(ExtraCost * _cost); + int setExtraCostsAction(MTGAbility * action, MTGCardInstance * card); + int isExtraPaymentSet(); + int resetExtraPayment(); + int doPayExtra(); + int addHybrid(int c1, int v1, int c2, int v2); int tryToPayHybrids(ManaCostHybrid * _hybrids[], int _nbhybrids, int diff[]); void randomDiffHybrids(ManaCost * _cost, int diff[]); diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 9186e3656..4211be233 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -274,6 +274,16 @@ ActionStack::ActionStack(int id, GameObserver* _game):GuiLayer(id, _game){ } +int ActionStack::has(MTGAbility * ability){ + for (int i = 0; i < mCount ; i++){ + if (((Interruptible *)mObjects[i])->type==ACTION_ABILITY){ + StackAbility * action = ((StackAbility *)mObjects[i]); + if (action->state == NOT_RESOLVED && action->ability == ability) return 1; + } + } + return 0; +} + int ActionStack::has(Interruptible * action){ for (int i = 0; i < mCount ; i++){ if (mObjects[i] == action) return 1; @@ -658,15 +668,15 @@ void ActionStack::Render(){ for (int i=0;istate==NOT_RESOLVED){ - current->x = x0 + 5; - if (i != mCount -1){ - current->y = currenty; - currenty += current->mHeight; - }else{ - current->y = currenty + 40 ; - currenty += current->mHeight + 40; - } - current->Render(); + current->x = x0 + 5; + if (i != mCount -1){ + current->y = currenty; + currenty += current->mHeight; + }else{ + current->y = currenty + 40 ; + currenty += current->mHeight + 40; + } + current->Render(); } } @@ -698,15 +708,15 @@ void ActionStack::Render(){ for (int i=0;idisplay){ - ((Interruptible *)mObjects[i])->x = x0 + 5; - if (i != mCount -1){ - ((Interruptible *)mObjects[i])->y = currenty; - currenty += ((Interruptible *)mObjects[i])->mHeight; - }else{ - ((Interruptible *)mObjects[i])->y = currenty + 40 ; - currenty += ((Interruptible *)mObjects[i])->mHeight + 40; - } - mObjects[i]->Render(); + ((Interruptible *)mObjects[i])->x = x0 + 5; + if (i != mCount -1){ + ((Interruptible *)mObjects[i])->y = currenty; + currenty += ((Interruptible *)mObjects[i])->mHeight; + }else{ + ((Interruptible *)mObjects[i])->y = currenty + 40 ; + currenty += ((Interruptible *)mObjects[i])->mHeight + 40; + } + mObjects[i]->Render(); } } } diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp new file mode 100644 index 000000000..cbf0ba4dd --- /dev/null +++ b/projects/mtg/src/ExtraCost.cpp @@ -0,0 +1,118 @@ +#include "../include/ExtraCost.h" +#include "../include/TargetChooser.h" +#include "../include/MTGCardInstance.h" +#include + +ExtraCost::ExtraCost( TargetChooser *_tc):tc(_tc){ + +} + + +int ExtraCost::setSource(MTGCardInstance * _source){ + source=_source; + if (tc){ tc->source = _source;} + return 1; +} + +SacrificeCost::SacrificeCost(TargetChooser *_tc):ExtraCost(_tc){ + target = NULL; + if (!tc) OutputDebugString("Self Sacrifice\n"); +} + +int SacrificeCost::setSource(MTGCardInstance * card){ + ExtraCost::setSource(card); + if (!tc) target = card; + return 1; +} + +int SacrificeCost::setPayment(MTGCardInstance * card){ + if (tc) { + int result = tc->addTarget(card); + if (result) { + target = card; + return result; + } + } + return 0; +} + +int SacrificeCost::isPaymentSet(){ + if (target) return 1; + return 0; +} + +int SacrificeCost::doPay(){ + if(target){ + target->controller()->game->putInGraveyard(target); + return 1; + } + return 0; +} + +void SacrificeCost::Render(){ + //TODO : real stuff + JLBFont * mFont = GameApp::CommonRes->GetJLBFont(Constants::MAIN_FONT); + mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); + char buffer[200]; + sprintf(buffer, "sacrifice"); + mFont->DrawString(buffer, 20 ,20, JGETEXT_LEFT); +} + +// +//Container +// +ExtraCosts::ExtraCosts(){ + action = NULL; + source = NULL; +} + +void ExtraCosts::Render(){ + //TODO cool window and stuff... + for (int i=0; i < costs.size(); i++){ + costs[i]->Render(); + } +} + +int ExtraCosts::setAction(MTGAbility * _action, MTGCardInstance * _card){ + action = _action; + source = _card; + for (int i=0; i < costs.size(); i++){ + costs[i]->setSource(_card); + } + return 1; +} + +int ExtraCosts::reset(){ + action = NULL; + source = NULL; + //TODO set all payments to "unset" + return 1; +} + +int ExtraCosts::tryToSetPayment(MTGCardInstance * card){ + for (int i=0; i < costs.size(); i++){ + if (int result = costs[i]->setPayment(card)) return result; + } + return 0; +} + +int ExtraCosts::isPaymentSet(){ + for (int i=0; i < costs.size(); i++){ + if (!costs[i]->isPaymentSet()) return 0; + } + return 1; +} + +int ExtraCosts::doPay(){ + int result = 0; + for (int i=0; i < costs.size(); i++){ + result+=costs[i]->doPay(); + } + return result; +} +void ExtraCosts::Dump(){ + char buf[4096]; + OutputDebugString("=====\nDumping ExtraCosts=====\n"); + sprintf(buf, "NbElements : %i\n", costs.size()); + OutputDebugString(buf); +} \ No newline at end of file diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 327000bb5..4651869c4 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -6,6 +6,7 @@ #include "../include/CardGui.h" #include "../include/Damage.h" #include "../include/DamageResolverLayer.h" +#include "../include/ExtraCost.h" #include @@ -46,6 +47,7 @@ GameObserver::GameObserver(Player * _players[], int _nb_players){ currentGamePhase = -1; targetChooser = NULL; cardWaitingForTargets = NULL; + waitForExtraPayment = NULL; reaction = 0; gameOver = NULL; phaseRing = NEW PhaseRing(_players,_nb_players); @@ -213,6 +215,9 @@ void GameObserver::Render(){ if (targetChooser || mLayers->actionLayer()->isWaitingForAnswer()){ JRenderer::GetInstance()->DrawRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,ARGB(255,255,0,0)); } + if (waitForExtraPayment){ + waitForExtraPayment->Render(); + } } @@ -275,17 +280,17 @@ void GameObserver::cardClick (MTGCardInstance * card, Targetable * object){ int result; if (card) { if (card == cardWaitingForTargets){ - LOG("attempt to close targetting"); - int _result = targetChooser->ForceTargetListReady(); - if (_result){ - result = TARGET_OK_FULL; - }else{ + LOG("attempt to close targetting"); + int _result = targetChooser->ForceTargetListReady(); + if (_result){ + result = TARGET_OK_FULL; + }else{ - LOG("...but we cant!\n"); - result = targetChooser->targetsReadyCheck(); - } + LOG("...but we cant!\n"); + result = targetChooser->targetsReadyCheck(); + } }else{ - result = targetChooser->toggleTarget(card); + result = targetChooser->toggleTarget(card); } }else{ result = targetChooser->toggleTarget(clickedPlayer); @@ -297,6 +302,17 @@ void GameObserver::cardClick (MTGCardInstance * card, Targetable * object){ } } + if (waitForExtraPayment){ + if (card){ + waitForExtraPayment->tryToSetPayment(card); + } + if (waitForExtraPayment->isPaymentSet()){ + waitForExtraPayment->action->reactToClick(waitForExtraPayment->source); + waitForExtraPayment = NULL; + } + return; + } + if (card){ reaction = mLayers->actionLayer()->isReactingToClick(card); if (reaction == -1) mLayers->actionLayer()->reactToClick(card); diff --git a/projects/mtg/src/GuiLayers.cpp b/projects/mtg/src/GuiLayers.cpp index fe2eca106..40850c68a 100644 --- a/projects/mtg/src/GuiLayers.cpp +++ b/projects/mtg/src/GuiLayers.cpp @@ -118,6 +118,11 @@ void GuiLayers::Update(float dt, Player * currentPlayer){ u32 key; while ((key = JGE::GetInstance()->ReadButton())) { + GameObserver * game = GameObserver::GetInstance(); + if (game->waitForExtraPayment && key == PSP_CTRL_CROSS){ + game->waitForExtraPayment = NULL; + continue; + } for (i=0; igetConvertedCost()){ + if (cost && cost->isNull()){ OutputDebugString("Cost is null\n"); SAFE_DELETE(cost); } @@ -1040,12 +1040,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ game->addObserver(NEW APestilence(_id, card)); break; } - /*case 1173: //Plague Rats - { - game->addObserver(NEW APlagueRats(_id, card, "Plague Rats")); - break; - } - */ + case 1174: //Raise Dead { MTGPlayerCards * zones = game->currentlyActing()->game; @@ -1621,7 +1616,9 @@ MTGAbility::~MTGAbility(){ //returns 1 if this ability needs to be removed from the list of active abilities int MTGAbility::testDestroy(){ - if (!game->isInPlay(source)){ + if (game->mLayers->stackLayer()->has(this)) return 0; + if (!game->isInPlay(source) ){ + OutputDebugString("Destroying Ability !!!\n"); return 1; } if (target && !game->isInPlay((MTGCardInstance *)target)){ @@ -1647,16 +1644,32 @@ ActivatedAbility::ActivatedAbility(int id, MTGCardInstance * card, ManaCost * _c int ActivatedAbility::isReactingToClick(MTGCardInstance * card){ Player * player = game->currentPlayer; if (!playerturnonly) player = game->currentlyActing(); - if (card == source && (!cost || player->getManaPool()->canAfford(cost)) && source->controller()==player && (!needsTapping || (!source->isTapped() && !source->hasSummoningSickness())) && player==game->currentlyActing()) + if (card == source && source->controller()==player && player==game->currentlyActing() && (!needsTapping || (!source->isTapped() && !source->hasSummoningSickness()))){ + if (!cost) return 1; + if (!player->getManaPool()->canAfford(cost)) return 0; return 1; + } return 0; } int ActivatedAbility::reactToClick(MTGCardInstance * card){ if (!isReactingToClick(card)) return 0; + OutputDebugString("React To click 1\n"); + if (cost){ + cost->setExtraCostsAction(this, card); + OutputDebugString("React To click 2\n"); + if (!cost->isExtraPaymentSet()){ + OutputDebugString("React To click 3\n"); + + game->waitForExtraPayment = cost->extraCosts; + return 0; + } + game->currentlyActing()->getManaPool()->pay(cost); + cost->doPayExtra(); + } if (needsTapping) source->tapped = 1; - if (cost) game->currentlyActing()->getManaPool()->pay(cost); fireAbility(); + return 1; } @@ -1664,7 +1677,17 @@ int ActivatedAbility::reactToClick(MTGCardInstance * card){ int ActivatedAbility::reactToTargetClick(Targetable * object){ if (!isReactingToTargetClick(object)) return 0; if (needsTapping) source->tapped = 1; - if (cost) game->currentlyActing()->getManaPool()->pay(cost); + if (cost){ + if (object->typeAsTarget() == TARGET_CARD) cost->setExtraCostsAction(this, (MTGCardInstance *) object); + OutputDebugString("React To click 2\n"); + if (!cost->isExtraPaymentSet()){ + OutputDebugString("React To click 3\n"); + game->waitForExtraPayment = cost->extraCosts; + return 0; + } + game->currentlyActing()->getManaPool()->pay(cost); + cost->doPayExtra(); + } fireAbility(); return 1; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 726268d28..d5ddb06fd 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -6,8 +6,8 @@ MTGPutInPlayRule::MTGPutInPlayRule(int _id):MTGAbility(_id, NULL){ } int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card){ - Player * player = game->currentlyActing(); - Player * currentPlayer = game->currentPlayer; + Player * player = game->currentlyActing(); + Player * currentPlayer = game->currentPlayer; LOG("CANPUTINPLAY- check if card belongs to current player\n"); if (!player->game->hand->hasCard(card)) return 0; LOG("CANPUTINPLAY- check if card is land or can be played\n"); @@ -23,17 +23,7 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card){ ManaCost * cost = card->getManaCost(); if (playerMana->canAfford(cost)){ LOG("CANPUTINPLAY- ManaCost ok\n"); - if (game->targetListIsSet(card)){ -#ifdef LOG - LOG("CANPUTINPLAY- Targets chosen -> OK\n"); -#endif - return 1; - }else{ -#ifdef LOG - LOG("CANPUTINPLAY- Targets not chosen yet\n"); -#endif - return 0; - } + return 1; } } return 0; @@ -42,8 +32,20 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card){ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card){ if (!isReactingToClick(card)) return 0; Player * player = game->currentlyActing(); + ManaCost * cost = card->getManaCost(); + if (cost->isExtraPaymentSet()){ + if (!game->targetListIsSet(card)){ + LOG("CANPUTINPLAY- Targets not chosen yet\n"); + return 0; + } + }else{ + cost->setExtraCostsAction(this, card); + game->waitForExtraPayment = cost->extraCosts; + return 0; + } ManaCost * previousManaPool = NEW ManaCost(player->getManaPool()); player->getManaPool()->pay(card->getManaCost()); + card->getManaCost()->doPayExtra(); ManaCost * spellCost = previousManaPool->Diff(player->getManaPool()); delete previousManaPool; if (card->hasType("land")){ diff --git a/projects/mtg/src/ManaCost.cpp b/projects/mtg/src/ManaCost.cpp index 65330e4b6..122b55f91 100644 --- a/projects/mtg/src/ManaCost.cpp +++ b/projects/mtg/src/ManaCost.cpp @@ -2,6 +2,9 @@ #include "../include/Logger.h" #include "../include/ManaCost.h" #include "../include/ManaCostHybrid.h" +#include "../include/ExtraCost.h" +#include "../include/TargetChooser.h" +#include "../include/Targetable.h" #if defined (WIN32) @@ -50,6 +53,19 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost){ }else if (value == "x"){ manaCost->x(); }else if (value == "t"){ + //Tap is handled outside of Manacost + }else if (value[0] == 's'){ + //sacrifice + OutputDebugString("Sacrifice\n"); + TargetChooserFactory tcf; + TargetChooser * tc = NULL; + int target_start = value.find("("); + int target_end = value.find(")"); + if (target_start!=string::npos && target_end!=string::npos){ + string target = value.substr(target_start+1, target_end-1 - target_start); + tc = tcf.createTargetChooser(target,NULL); + } + manaCost->addExtraCost(NEW SacrificeCost(tc)); }else{ int intvalue = atoi(value.c_str()); int colors[2]; @@ -128,6 +144,7 @@ void ManaCost::init(){ cost[i] = 0; } nbhybrids = 0; + extraCosts = NULL; } @@ -139,6 +156,11 @@ void ManaCost::copy(ManaCost * _manaCost){ hybrids[i] = NEW ManaCostHybrid((*_manaCost->hybrids[i])); } nbhybrids = _manaCost->nbhybrids; + + if (_manaCost->extraCosts){ + //TODO Deep copy ? + extraCosts = _manaCost->extraCosts; + } } int ManaCost::getCost(int color){ @@ -165,6 +187,12 @@ int ManaCost::hasColor(int color){ return 0; } +int ManaCost::isNull(){ + if (getConvertedCost()) return 0; + if (extraCosts) return 0; + return 1; +} + int ManaCost::getConvertedCost(){ int result = 0; for (unsigned int i = 0; i < Constants::MTG_NB_COLORS; i++){ @@ -210,6 +238,35 @@ int ManaCost::addHybrid(int c1, int v1, int c2, int v2){ return nbhybrids; } +int ManaCost::addExtraCost(ExtraCost * _cost){ + if (!extraCosts) extraCosts = NEW ExtraCosts(); + extraCosts->costs.push_back(_cost); + OutputDebugString("Adding Sacrifice\n"); + return 1; +} + + +int ManaCost::isExtraPaymentSet(){ + if (!extraCosts) return 1; + OutputDebugString("Checking costs\n"); + return extraCosts->isPaymentSet(); +} + +int ManaCost::resetExtraPayment(){ + if (!extraCosts) return 1; + return extraCosts->reset(); +} + +int ManaCost::doPayExtra(){ + if (!extraCosts) return 0; + return extraCosts->doPay(); //TODO reset ? +} + +int ManaCost::setExtraCostsAction(MTGAbility * action, MTGCardInstance * card){ + if (extraCosts) extraCosts->setAction(action, card); + return 1; +} + int ManaCost::pay(ManaCost * _cost){ ManaCost * diff = Diff(_cost); for (int i=0; i < Constants::MTG_NB_COLORS; i++){ diff --git a/projects/mtg/template.vcproj b/projects/mtg/template.vcproj index 2a8c4a273..e9440f6f7 100644 --- a/projects/mtg/template.vcproj +++ b/projects/mtg/template.vcproj @@ -284,6 +284,10 @@ RelativePath=".\src\DuelLayers.cpp" > + + @@ -589,6 +593,10 @@ RelativePath=".\include\DuelLayers.h" > + +