From 5ce66a289e70e86d1f45a7f75bc2cf1b02f3f13b Mon Sep 17 00:00:00 2001 From: "wagic.laurent" Date: Thu, 18 Jun 2009 23:14:47 +0000 Subject: [PATCH] Laurent - Added new keyword "cantbeblockedby" See 10E addition Elven Riders and Juggernaut. I tested Elven Riders successfully, but not juggernaut yet... Also if this new keyword function correctly we remove abilities like FEAR and UNBLOCKABLE... Needs to be further tested... Feedback and extensive test are welcome on this one... --- projects/mtg/bin/Res/sets/10E/_cards.dat | 27 ++++++++++++++++++++++++ projects/mtg/bin/Res/sets/10E/todo.dat | 24 --------------------- projects/mtg/src/MTGAbility.cpp | 27 ++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 24 deletions(-) diff --git a/projects/mtg/bin/Res/sets/10E/_cards.dat b/projects/mtg/bin/Res/sets/10E/_cards.dat index 0e6ea304e..1b21378c1 100644 --- a/projects/mtg/bin/Res/sets/10E/_cards.dat +++ b/projects/mtg/bin/Res/sets/10E/_cards.dat @@ -656,6 +656,19 @@ type=Instant mana={3}{U}{U} [/card] [card] +text=Elven Riders can't be blocked except by Walls and/or creatures with flying. +id=135266 +name=Elven Riders +auto=cantbeblockedby(creature[-walls;-flying]) +rarity=U +color=Green +type=Creature +mana={3}{G}{G} +power=3 +subtype=Elf +toughness=3 +[/card] +[card] text=Whenever Elvish Berserker becomes blocked, it gets +1/+1 until end of turn for each creature blocking it. id=129533 auto=rampage(1/1,0) @@ -1200,6 +1213,20 @@ type=Artifact mana={4} [/card] [card] +text=Juggernaut attacks each turn if able. Juggernaut can't be blocked by Walls. +id=135240 +name=Juggernaut +rarity=U +color=Artifact +type=Artifact Creature +mana={4} +power=5 +abilities=mustattack +auto=cantbeblockedby(walls) +subtype=Juggernaut +toughness=3 +[/card] +[card] text=Haste (This creature can attack and {T} as soon as it comes under your control.) {T}: Kamahl, Pit Fighter deals 3 damage to target creature or player. abilities=haste,legendary auto={T}:Damage:3 target(creature,player) diff --git a/projects/mtg/bin/Res/sets/10E/todo.dat b/projects/mtg/bin/Res/sets/10E/todo.dat index 67fdc24c1..f3da5759d 100644 --- a/projects/mtg/bin/Res/sets/10E/todo.dat +++ b/projects/mtg/bin/Res/sets/10E/todo.dat @@ -353,18 +353,6 @@ subtype=Insect toughness=1 [/card] [card] -text=Elven Riders can't be blocked except by Walls and/or creatures with flying. -id=135266 -name=Elven Riders -rarity=U -color=Green -type=Creature -mana={3}{G}{G} -power=3 -subtype=Elf -toughness=3 -[/card] -[card] text=Faerie Conclave comes into play tapped. {T}: Add {U} to your mana pool. {1}{U}: Faerie Conclave becomes a 2/1 blue Faerie creature with flying until end of turn. It's still a land. (It can't be blocked except by creatures with flying or reach.) id=106531 name=Faerie Conclave @@ -576,18 +564,6 @@ subtype=Elf Druid toughness=1 [/card] [card] -text=Juggernaut attacks each turn if able. Juggernaut can't be blocked by Walls. -id=135240 -name=Juggernaut -rarity=U -color=Artifact -type=Artifact Creature -mana={4} -power=5 -subtype=Juggernaut -toughness=3 -[/card] -[card] text=Karplusan Strider can't be the target of blue or black spells. id=129911 name=Karplusan Strider diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 77c55d4fd..dd416cd32 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -711,6 +711,32 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){ continue; } + //CannotBeBlockedBy + found = s.find("cantbeblockedby("); + if (found != string::npos){ + int end = s.find(")",found+1); + string starget = s.substr(found + 18,end - found - 18); + TargetChooserFactory tcf; + tc = tcf.createTargetChooser(starget,card); + // TypeTargetChooser * tc = createTargetChooser(starget,card); + if (dryMode){ + dryModeResult = BAKA_EFFECT_GOOD; + break; + } + for (int i = 0; i < 2 ; i++){ + for (int j = game->players[i]->game->inPlay->nb_cards-1; j >=0 ; j--){ + MTGCardInstance * current = game->players[i]->game->inPlay->cards[j]; + if (tc->canTarget(current));{ + if (card->canBlock (current)) return 1; + } + } + } + result++; + continue; + } + + + //Discard found = s.find("discard:"); if (found != string::npos){ @@ -962,6 +988,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){ result++; continue; } + #if defined (WIN32) || defined (LINUX) char buf[4096]; sprintf(buf, "AUTO ACTION PARSED: %s\n", line.c_str());