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...
This commit is contained in:
Anthony Calosa
2017-02-13 08:26:06 +08:00
parent d604ae2d77
commit 13f590c6a2
2 changed files with 15 additions and 13 deletions
+13 -11
View File
@@ -94,6 +94,7 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string
mFont->SetColor(ARGB(255,255,255,255)); mFont->SetColor(ARGB(255,255,255,255));
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
JRenderer * renderer = JRenderer::GetInstance(); JRenderer * renderer = JRenderer::GetInstance();
bool hiddenview = source->has(Constants::HIDDENFACE)?true:false;
if (!targetQuad) if (!targetQuad)
{ {
@@ -122,24 +123,25 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string
} }
} }
ostringstream aa; ostringstream aa;
aa << action << " " << "(" << count << ")"; aa << action << " " << "(" << count << ")";
if(count > 1) if(count > 1)
xnadj -= 4; xnadj -= 4;
//renderer->FillRect(x-1.8f,y-16 + GetVerticalTextOffset(), 73 + xnadj, 43, ARGB(235,10,10,10));//box if(!hiddenview)
{
//mFont->SetColor(ARGB(255,128,255,128));//recolor
mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT); mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT);
//mFont->SetColor(ARGB(255,255,255,255));//reset color
if(count > 1) if(count > 1)
{ {
mFont->DrawString(_(aa.str()).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT); mFont->DrawString(_(aa.str()).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT);
} }
else else
mFont->DrawString(_(action).c_str(), x + 75 + xnadj, y + GetVerticalTextOffset(), JGETEXT_LEFT); 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); 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; float xadj = 0;
for(unsigned int k = 0; k < mytargetsQuad.size(); k++) 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) if (targetQuad)
{ {
+1 -1
View File
@@ -175,7 +175,7 @@ const char* Constants::MTGBasicAbilities[] = {
"canblocktapped", "canblocktapped",
"oppnomaxhand", "oppnomaxhand",
"cantcrew", "cantcrew",
"hiddenface",//test for facedown "hiddenface",//test for hiding card
"anytypeofmana" "anytypeofmana"
}; };