diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 5d79c1581..19a79afeb 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -42,6 +42,8 @@ control_magic2.txt counsel_of_the_soratami.txt counterspell.txt counterspell2.txt +counterspell3.txt +counterspell4.txt creature_bond.txt deja_vu.txt dingus_egg.txt @@ -115,4 +117,3 @@ zombify.txt #Momir Basic Tests ######################## momir/keldon_warlord.txt - diff --git a/projects/mtg/bin/Res/test/counterspell3.txt b/projects/mtg/bin/Res/test/counterspell3.txt new file mode 100644 index 000000000..7688a157b --- /dev/null +++ b/projects/mtg/bin/Res/test/counterspell3.txt @@ -0,0 +1,30 @@ +#Testing counterspell extensively +[INIT] +FIRSTMAIN +[PLAYER1] +hand:lightning bolt +inplay:mountain +[PLAYER2] +hand:counterspell +inplay:hill giant,1393,1392 +[DO] +mountain +lightning bolt +hill giant +no +yes +1392 +1393 +counterspell +lightning bolt +endinterruption +[ASSERT] +FIRSTMAIN +[PLAYER1] +graveyard:lightning bolt +inplay:mountain +[PLAYER2] +graveyard:counterspell +inplay:hill giant,1393,1392 +life:20 +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/counterspell4.txt b/projects/mtg/bin/Res/test/counterspell4.txt new file mode 100644 index 000000000..82ca8f0b1 --- /dev/null +++ b/projects/mtg/bin/Res/test/counterspell4.txt @@ -0,0 +1,27 @@ +#Testing counterspell on bad moon +[INIT] +FIRSTMAIN +[PLAYER1] +hand:bad moon +manapool:{1}{B} +[PLAYER2] +hand:counterspell +manapool:{U}{U} +[DO] +bad moon +no +yes +counterspell +bad moon +endinterruption +[ASSERT] +FIRSTMAIN +[PLAYER1] +graveyard:bad moon +manapool:{0} +life:20 +[PLAYER2] +graveyard:counterspell +manapool:{0} +life:20 +[END] \ No newline at end of file diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index f2e3cf6cd..5e9564f47 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -502,6 +502,7 @@ void ActionStack::Update(float dt){ TargetChooser * tc = game->getCurrentTargetChooser(); int newState = game->getCurrentGamePhase(); currentState = newState; + if (!tc) checked = 0; //Select Stack's display mode if (mode==ACTIONSTACK_STANDARD && tc && !checked){ @@ -509,15 +510,16 @@ 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; - mCurr = i; - mObjects[mCurr]->Entering(); - mode=ACTIONSTACK_TARGET; - modal = 1; + if (mObjects[mCurr]) mObjects[mCurr]->Leaving(PSP_CTRL_UP); + current->display = 1; + mCurr = i; + mObjects[mCurr]->Entering(); + mode=ACTIONSTACK_TARGET; + modal = 1; }else{ - current->display = 0; + current->display = 0; } } if (mode != ACTIONSTACK_TARGET){