Erwan
- Added "stack" as a zone in the perser - Added "fizzle" keyword in the parser for counterspells
This commit is contained in:
@@ -286,7 +286,8 @@ type=Land
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target spell.
|
||||
alias=1196
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
id=129882
|
||||
name=Cancel
|
||||
rarity=C
|
||||
@@ -648,6 +649,17 @@ subtype=Goblin Mutant
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target red or green spell.
|
||||
target=*[red;green]|stack
|
||||
auto=fizzle
|
||||
id=129908
|
||||
name=Flashfreeze
|
||||
rarity=U
|
||||
color=Blue
|
||||
type=Instant
|
||||
mana={1}{U}
|
||||
[/card]
|
||||
[card]
|
||||
text={T}: Add {G} to your mana pool.
|
||||
auto={T}: Add {G}
|
||||
id=129561
|
||||
@@ -1701,6 +1713,17 @@ subtype=Rat
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target creature spell.
|
||||
target=creature|stack
|
||||
auto=fizzle
|
||||
id=129699
|
||||
name=Remove Soul
|
||||
rarity=C
|
||||
color=Blue
|
||||
type=Instant
|
||||
mana={1}{U}
|
||||
[/card]
|
||||
[card]
|
||||
text=You gain 3 life. Draw a card.
|
||||
auto=life:3
|
||||
auto=draw:1
|
||||
|
||||
@@ -530,15 +530,7 @@ power=1
|
||||
subtype=Zombie Goblin
|
||||
toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target red or green spell.
|
||||
id=129908
|
||||
name=Flashfreeze
|
||||
rarity=U
|
||||
color=Blue
|
||||
type=Instant
|
||||
mana={1}{U}
|
||||
[/card]
|
||||
|
||||
[card]
|
||||
text=All creatures get +X/-X until end of turn.
|
||||
id=130542
|
||||
@@ -1163,15 +1155,7 @@ color=Blue
|
||||
type=Sorcery
|
||||
mana={2}{U}
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target creature spell.
|
||||
id=129699
|
||||
name=Remove Soul
|
||||
rarity=C
|
||||
color=Blue
|
||||
type=Instant
|
||||
mana={1}{U}
|
||||
[/card]
|
||||
|
||||
[card]
|
||||
text=Flying (This creature can't be blocked except by creatures with flying or reach.) At the beginning of your upkeep, you may return target creature card from your graveyard to play.
|
||||
id=106384
|
||||
|
||||
@@ -62,7 +62,8 @@ toughness=5
|
||||
[card]
|
||||
text=Counter target spell.
|
||||
id=178092
|
||||
alias=1196
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
name=Cancel
|
||||
rarity=C
|
||||
type=Instant
|
||||
|
||||
@@ -109,7 +109,8 @@ mana={1}{W}
|
||||
[card]
|
||||
text=Counter target spell.
|
||||
id=2500
|
||||
alias=1196
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
name=Counterspell
|
||||
rarity=C
|
||||
type=Instant
|
||||
|
||||
@@ -553,14 +553,6 @@ mana={2}{W}
|
||||
subtype=Aura
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target spell.
|
||||
id=2500
|
||||
name=Counterspell
|
||||
rarity=C
|
||||
type=Instant
|
||||
mana={U}{U}
|
||||
[/card]
|
||||
[card]
|
||||
text={4}, {T}: Attach target Aura attached to a creature to another creature.
|
||||
id=2401
|
||||
name=Crown of the Ages
|
||||
@@ -1348,22 +1340,6 @@ subtype=Spirit
|
||||
toughness=3
|
||||
[/card]
|
||||
[card]
|
||||
text=Choose one - Counter target spell if it's red; or destroy target permanent if it's red.
|
||||
id=2508
|
||||
name=Hydroblast
|
||||
rarity=C
|
||||
type=Instant
|
||||
mana={U}
|
||||
[/card]
|
||||
[card]
|
||||
text=Put target creature card in a graveyard into play under your control.
|
||||
id=2731
|
||||
name=Hymn of Rebirth
|
||||
rarity=U
|
||||
type=Sorcery
|
||||
mana={3}{G}{W}
|
||||
[/card]
|
||||
[card]
|
||||
text={X}, {T}: Put a charge counter on Ice Cauldron and remove a nonland card in your hand from the game. As long as that card remains removed from the game, you may play it. Note the type and amount of mana spent to pay this activation cost. Play this ability only if there are no charge counters on Ice Cauldron. {T}, Remove a charge counter from Ice Cauldron: Add Ice Cauldron's last noted type and amount of mana to your mana pool. Spend this mana only to play the last card removed from the game with Ice Cauldron.
|
||||
id=2407
|
||||
name=Ice Cauldron
|
||||
@@ -2475,22 +2451,6 @@ subtype=Ouphe
|
||||
toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
text=Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue.
|
||||
id=2649
|
||||
name=Pyroblast
|
||||
rarity=C
|
||||
type=Instant
|
||||
mana={R}
|
||||
[/card]
|
||||
[card]
|
||||
text=Pyroclasm deals 2 damage to each creature.
|
||||
id=2650
|
||||
name=Pyroclasm
|
||||
rarity=U
|
||||
type=Sorcery
|
||||
mana={1}{R}
|
||||
[/card]
|
||||
[card]
|
||||
text=Blocking creatures get +1/+1 until end of turn.
|
||||
id=2708
|
||||
name=Rally
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[card]
|
||||
text=Counter target spell. You gain 3 life.
|
||||
alias=1196
|
||||
id=23155
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
auto=life:3
|
||||
name=Absorb
|
||||
color=White,Blue
|
||||
rarity=R
|
||||
mana={W}{U}{U}
|
||||
type=Instant
|
||||
@@ -339,6 +339,17 @@ subtype=Elf
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target creature spell. Draw a card.
|
||||
target=creature|stack
|
||||
auto=fizzle
|
||||
auto=draw:1
|
||||
id=22986
|
||||
name=Exclude
|
||||
rarity=C
|
||||
type=Instant
|
||||
mana={2}{U}
|
||||
[/card]
|
||||
[card]
|
||||
text=Creatures you control have haste. Sacrifice Fires of Yavimaya: Target creature gets +2/+2 until end of turn.
|
||||
auto=lord(creature|myinplay) haste
|
||||
auto={s}:2/2 target(creature)
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
[card]
|
||||
text=Counter target spell. You gain 3 life.
|
||||
id=23155
|
||||
name=Absorb
|
||||
rarity=R
|
||||
type=Instant
|
||||
mana={W}{U}{U}
|
||||
[/card]
|
||||
[card]
|
||||
text=Choose a color. Target player reveals his or her hand, then you choose a card of that color from it. That player discards that card.
|
||||
id=23030
|
||||
name=Addle
|
||||
@@ -723,14 +715,7 @@ type=Enchantment
|
||||
mana={U}
|
||||
subtype=Aura
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target creature spell. Draw a card.
|
||||
id=22986
|
||||
name=Exclude
|
||||
rarity=C
|
||||
type=Instant
|
||||
mana={2}{U}
|
||||
[/card]
|
||||
|
||||
[card]
|
||||
text=Enchant creature Domain - Enchanted creature gets -1/-1 for each basic land type among lands you control.
|
||||
id=23032
|
||||
|
||||
@@ -1051,6 +1051,17 @@ toughness=2
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
text=As an additional cost to play Withering Boon, pay 3 life. Counter target creature spell.
|
||||
target=creature|stack
|
||||
auto=fizzle
|
||||
auto=life:-3
|
||||
id=3321
|
||||
name=Withering Boon
|
||||
rarity=U
|
||||
type=Instant
|
||||
mana={1}{B}
|
||||
[/card]
|
||||
[card]
|
||||
text=Flying. Other Griffin creatures get +1/+1.
|
||||
id=3526
|
||||
name=Zuberi, Golden Feather
|
||||
|
||||
@@ -3153,14 +3153,7 @@ power=1
|
||||
subtype=Bird
|
||||
toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
text=As an additional cost to play Withering Boon, pay 3 life. Counter target creature spell.
|
||||
id=3321
|
||||
name=Withering Boon
|
||||
rarity=U
|
||||
type=Instant
|
||||
mana={1}{B}
|
||||
[/card]
|
||||
|
||||
[card]
|
||||
text=Search your library for a creature card and reveal that card. Shuffle your library, then put the revealed card back on top of it.
|
||||
id=3424
|
||||
|
||||
@@ -21,6 +21,16 @@ mana={2}{W}{W}
|
||||
type=Instant
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target artifact or enchantment spell.
|
||||
target=artifact,enchantment|stack
|
||||
auto=fizzle
|
||||
id=45976
|
||||
name=Annul
|
||||
rarity=C
|
||||
type=Instant
|
||||
mana={U}
|
||||
[/card]
|
||||
[card]
|
||||
text=Sacrifice an artifact: Atog gets +2/+2 until end of turn.
|
||||
id=46106
|
||||
alias=1280
|
||||
|
||||
@@ -40,14 +40,7 @@ name=Ancient Den
|
||||
rarity=C
|
||||
type=Artifact Land
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target artifact or enchantment spell.
|
||||
id=45976
|
||||
name=Annul
|
||||
rarity=C
|
||||
type=Instant
|
||||
mana={U}
|
||||
[/card]
|
||||
|
||||
[card]
|
||||
text={R}, Remove the top ten cards of your library from the game: Arc-Slogger deals 2 damage to target creature or player.
|
||||
id=48436
|
||||
|
||||
@@ -194,7 +194,8 @@ abilities=flying,cloud
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target spell.
|
||||
alias=1196
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
id=19570
|
||||
name=Counterspell
|
||||
color=Blue
|
||||
@@ -546,8 +547,7 @@ color=Black
|
||||
rarity=U
|
||||
mana={2}{B}{B}{B}
|
||||
type=Enchantment
|
||||
[/card]
|
||||
|
||||
[/card] [card]
|
||||
text={3}, {T}: Target creature gains first strike until end of turn.
|
||||
id=19882
|
||||
name=Iron Lance
|
||||
|
||||
@@ -617,14 +617,6 @@ subtype=Human Minion
|
||||
toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target spell.
|
||||
id=19570
|
||||
name=Counterspell
|
||||
rarity=C
|
||||
type=Instant
|
||||
mana={U}{U}
|
||||
[/card]
|
||||
[card]
|
||||
text=Whenever a creature becomes the target of a spell or ability, return that creature to its owner's hand. (It won't be affected by the spell or ability.)
|
||||
id=19683
|
||||
name=Cowardice
|
||||
|
||||
@@ -786,6 +786,16 @@ toughness=1
|
||||
abilities=mountainwalk
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target creature or sorcery spell.
|
||||
target=creature,sorcery|stack
|
||||
auto=fizzle
|
||||
id=4268
|
||||
name=Mystic Denial
|
||||
rarity=U
|
||||
type=Instant
|
||||
mana={1}{U}{U}
|
||||
[/card]
|
||||
[card]
|
||||
text=Target player gains 8 life.
|
||||
target=player
|
||||
auto=life:8
|
||||
|
||||
@@ -413,14 +413,7 @@ rarity=C
|
||||
type=Sorcery
|
||||
mana={G}
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target creature or sorcery spell.
|
||||
id=4268
|
||||
name=Mystic Denial
|
||||
rarity=U
|
||||
type=Instant
|
||||
mana={1}{U}{U}
|
||||
[/card]
|
||||
|
||||
[card]
|
||||
text=As an additional cost to play Natural Order, sacrifice a green creature. Search your library for a green creature card and put it into play. Then shuffle your library.
|
||||
id=4307
|
||||
|
||||
@@ -403,6 +403,8 @@ subtype=Aura
|
||||
text=Counter target spell.
|
||||
id=1196
|
||||
name=Counterspell
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
rarity=U
|
||||
type=Instant
|
||||
mana={U}{U}
|
||||
|
||||
@@ -354,6 +354,16 @@ rarity=R
|
||||
type=Land
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target blue instant spell.
|
||||
target=instant[blue]|stack
|
||||
auto=fizzle
|
||||
id=158773
|
||||
name=Guttural Response
|
||||
rarity=U
|
||||
type=Instant
|
||||
mana={RG}
|
||||
[/card]
|
||||
[card]
|
||||
text=Sacrifice Heap Doll: Remove target card in a graveyard from the game.
|
||||
auto={S}:moveTo(removedfromgame) target(*|graveyard)
|
||||
id=154395
|
||||
|
||||
@@ -678,14 +678,7 @@ power=4
|
||||
subtype=Scarecrow
|
||||
toughness=4
|
||||
[/card]
|
||||
[card]
|
||||
text=Counter target blue instant spell.
|
||||
id=158773
|
||||
name=Guttural Response
|
||||
rarity=U
|
||||
type=Instant
|
||||
mana={RG}
|
||||
[/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.)
|
||||
|
||||
@@ -261,7 +261,8 @@ toughness=5
|
||||
[card]
|
||||
text=Counter target spell.
|
||||
id=4693
|
||||
alias=1196
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
name=Counterspell
|
||||
Color=Blue
|
||||
rarity=C
|
||||
@@ -377,7 +378,8 @@ type=Instant
|
||||
[card]
|
||||
text=Counter target spell. Draw a card.
|
||||
id=4695
|
||||
alias=1196
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
auto=draw:1
|
||||
name=Dismiss
|
||||
color=Blue
|
||||
|
||||
@@ -5,13 +5,13 @@ FIRSTMAIN
|
||||
hand:bad moon
|
||||
manapool:{1}{B}
|
||||
[PLAYER2]
|
||||
hand:counterspell
|
||||
hand:counterspell (RV)
|
||||
manapool:{U}{U}
|
||||
[DO]
|
||||
bad moon
|
||||
no
|
||||
yes
|
||||
counterspell
|
||||
counterspell (RV)
|
||||
bad moon
|
||||
endinterruption
|
||||
[ASSERT]
|
||||
@@ -21,7 +21,7 @@ graveyard:bad moon
|
||||
manapool:{0}
|
||||
life:20
|
||||
[PLAYER2]
|
||||
graveyard:counterspell
|
||||
graveyard:counterspell (RV)
|
||||
manapool:{0}
|
||||
life:20
|
||||
[END]
|
||||
@@ -510,7 +510,6 @@ void ActionStack::Update(float dt){
|
||||
unpackDamageStacks();
|
||||
for (int i = 0; i < mCount ; i++){
|
||||
Interruptible * current = (Interruptible *)mObjects[i];
|
||||
OutputDebugString("OH MY GOD, TAARGET MODE!\n");
|
||||
if (tc->canTarget(current)){
|
||||
if (mObjects[mCurr]) mObjects[mCurr]->Leaving(PSP_CTRL_UP);
|
||||
current->display = 1;
|
||||
|
||||
@@ -307,6 +307,25 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
if (s.find("other") != string::npos) lordIncludeSelf = 0;
|
||||
}
|
||||
|
||||
|
||||
//Fizzle (counterspell...)
|
||||
found = s.find("fizzle");
|
||||
if (found != string::npos){
|
||||
if (dryMode) {
|
||||
dryModeResult = BAKA_EFFECT_BAD;
|
||||
dryModeResultSet = 1;
|
||||
break;
|
||||
}
|
||||
if (tc){
|
||||
//TODO
|
||||
}else{
|
||||
Spell * starget = spell->getNextSpellTarget();
|
||||
if (starget) game->mLayers->stackLayer()->Fizzle(starget);
|
||||
}
|
||||
result++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
//Untapper (Ley Druid...)
|
||||
found = s.find("untap");
|
||||
@@ -919,12 +938,12 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
game->addObserver(NEW AConservator(_id,card));
|
||||
break;
|
||||
}
|
||||
case 1196: //Counterspell
|
||||
/* case 1196: //Counterspell
|
||||
{
|
||||
Spell * starget = spell->getNextSpellTarget();
|
||||
if (starget) game->mLayers->stackLayer()->Fizzle(starget);
|
||||
break;
|
||||
}
|
||||
} */
|
||||
case 1197: //Creature Bond
|
||||
{
|
||||
game->addObserver(NEW ACreatureBond(_id,card, card->target));
|
||||
|
||||
@@ -52,6 +52,10 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
zones[nbzones] = game->players[0]->game->inPlay;
|
||||
nbzones++;
|
||||
zones[nbzones] = game->players[1]->game->inPlay;
|
||||
}else if(zoneName.compare("stack") == 0){
|
||||
zones[nbzones] = game->players[0]->game->stack;
|
||||
nbzones++;
|
||||
zones[nbzones] = game->players[1]->game->stack;
|
||||
}else{
|
||||
MTGGameZone * zone = MTGGameZone::stringToZone(zoneName, card,card);
|
||||
if (zone) zones[nbzones] = zone;
|
||||
@@ -220,7 +224,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(MTGCardInstance * card
|
||||
//Any target than cannot be defined automatically is determined by its id
|
||||
switch (id){
|
||||
//Spell
|
||||
case 1196: //CounterSpell
|
||||
//case 1196: //CounterSpell
|
||||
case 1224: //Spell blast
|
||||
{
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
@@ -273,6 +277,8 @@ int TargetChooser::canTarget(Targetable * target){
|
||||
MTGCardInstance * card = (MTGCardInstance *) target;
|
||||
if (source && (card->protectedAgainst(source) || card->has(Constants::SHROUD))) return 0;
|
||||
return 1;
|
||||
}else if (target->typeAsTarget() == TARGET_STACKACTION){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -362,14 +368,25 @@ void TypeTargetChooser::addType(int type){
|
||||
}
|
||||
|
||||
int TypeTargetChooser::canTarget(Targetable * target ){
|
||||
if (!TargetZoneChooser::canTarget(target)) return 0;
|
||||
if (target->typeAsTarget() == TARGET_CARD){
|
||||
MTGCardInstance * card = (MTGCardInstance *) target;
|
||||
if (!TargetZoneChooser::canTarget(card)) return 0;
|
||||
for (int i= 0; i < nbtypes; i++){
|
||||
if (card->hasSubtype(types[i])) return 1;
|
||||
if (Subtypes::subtypesList->find(card->name) == types[i]) return 1;
|
||||
}
|
||||
return 0;
|
||||
}else if (target->typeAsTarget() == TARGET_STACKACTION){
|
||||
Interruptible * action = (Interruptible *) target;
|
||||
if (action->type == ACTION_SPELL && action->state==NOT_RESOLVED){
|
||||
Spell * spell = (Spell *) action;
|
||||
MTGCardInstance * card = spell->source;
|
||||
for (int i= 0; i < nbtypes; i++){
|
||||
if (card->hasSubtype(types[i])) return 1;
|
||||
if (Subtypes::subtypesList->find(card->name) == types[i]) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -397,10 +414,17 @@ DescriptorTargetChooser::DescriptorTargetChooser(CardDescriptor * _cd, MTGGameZo
|
||||
}
|
||||
|
||||
int DescriptorTargetChooser::canTarget(Targetable * target){
|
||||
if (!TargetZoneChooser::canTarget(target)) return 0;
|
||||
if (target->typeAsTarget() == TARGET_CARD){
|
||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||
if (!TargetZoneChooser::canTarget(_target)) return 0;
|
||||
if (cd->match(_target)) return 1;
|
||||
}else if (target->typeAsTarget() == TARGET_STACKACTION){
|
||||
Interruptible * action = (Interruptible *) target;
|
||||
if (action->type == ACTION_SPELL && action->state==NOT_RESOLVED){
|
||||
Spell * spell = (Spell *) action;
|
||||
MTGCardInstance * card = spell->source;
|
||||
if (cd->match(card)) return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -473,6 +497,16 @@ int TargetZoneChooser::canTarget(Targetable * target){
|
||||
for (int i = 0; i<nbzones; i++){
|
||||
if (zones[i]->hasCard(card)) return 1;
|
||||
}
|
||||
}else if (target->typeAsTarget() == TARGET_STACKACTION){
|
||||
OutputDebugString ("CHECKING INTERRUPTIBLE\n");
|
||||
Interruptible * action = (Interruptible *) target;
|
||||
if (action->type == ACTION_SPELL && action->state==NOT_RESOLVED){
|
||||
Spell * spell = (Spell *) action;
|
||||
MTGCardInstance * card = spell->source;
|
||||
for (int i = 0; i<nbzones; i++){
|
||||
if (zones[i]->hasCard(card)) return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -109,6 +109,9 @@ int TestSuiteAI::Act(float dt){
|
||||
}else{
|
||||
int mtgid = suite->getMTGId(action);
|
||||
if (mtgid){
|
||||
char buffe[512];
|
||||
sprintf(buffe, "CARD ID : %i\n", mtgid);
|
||||
OutputDebugString(buffe);
|
||||
Interruptible * toInterrupt = suite->getActionByMTGId(mtgid);
|
||||
if (toInterrupt){
|
||||
g->stackObjectClicked(toInterrupt);
|
||||
|
||||
Reference in New Issue
Block a user