From 13f590c6a22890ba4bfa1b8018dd5d4f7678f0c4 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Mon, 13 Feb 2017 08:26:06 +0800 Subject: [PATCH] hiddenface if the source has hiddenface ability then all of its targets will not show on the stack ability, useful for cards like demonic tutor etc... --- projects/mtg/src/ActionStack.cpp | 26 ++++++++++++++------------ projects/mtg/src/MTGDefinitions.cpp | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 58d60bf8c..f0f57af6b 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -94,7 +94,8 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string mFont->SetColor(ARGB(255,255,255,255)); mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); JRenderer * renderer = JRenderer::GetInstance(); - + bool hiddenview = source->has(Constants::HIDDENFACE)?true:false; + if (!targetQuad) { /*if(source->controller()->isHuman() && source->controller()->opponent()->isAI() && !alt2.size() && _(action).c_str() == source->name) @@ -122,24 +123,25 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } } - ostringstream aa; - aa << action << " " << "(" << count << ")"; + ostringstream aa; + aa << action << " " << "(" << count << ")"; - if(count > 1) - xnadj -= 4; + if(count > 1) + xnadj -= 4; - //renderer->FillRect(x-1.8f,y-16 + GetVerticalTextOffset(), 73 + xnadj, 43, ARGB(235,10,10,10));//box - - //mFont->SetColor(ARGB(255,128,255,128));//recolor + if(!hiddenview) + { mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT); - //mFont->SetColor(ARGB(255,255,255,255));//reset color - if(count > 1) { mFont->DrawString(_(aa.str()).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT); } else mFont->DrawString(_(action).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT); + } + else + mFont->DrawString(_(action).c_str(), x + 35, y + GetVerticalTextOffset(), JGETEXT_LEFT); + } JQuadPtr quad = observer->getResourceManager()->RetrieveCard(source, CACHE_THUMB); @@ -182,7 +184,7 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } - if(mytargetsQuad.size()) + if(mytargetsQuad.size() && !hiddenview) { float xadj = 0; for(unsigned int k = 0; k < mytargetsQuad.size(); k++) @@ -209,7 +211,7 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string } } } - else + else if(!hiddenview) { if (targetQuad) { diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index f9811f8e7..c9d02d911 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -175,7 +175,7 @@ const char* Constants::MTGBasicAbilities[] = { "canblocktapped", "oppnomaxhand", "cantcrew", - "hiddenface",//test for facedown + "hiddenface",//test for hiding card "anytypeofmana" };