diff --git a/projects/mtg/bin/Res/graphics/alphabeta.png b/projects/mtg/bin/Res/graphics/alphabeta.png index 668425817..bc2c38a02 100644 Binary files a/projects/mtg/bin/Res/graphics/alphabeta.png and b/projects/mtg/bin/Res/graphics/alphabeta.png differ diff --git a/projects/mtg/include/CardGui.h b/projects/mtg/include/CardGui.h index 4ef10700b..7a8bca284 100644 --- a/projects/mtg/include/CardGui.h +++ b/projects/mtg/include/CardGui.h @@ -33,7 +33,7 @@ protected: /* ** Tries to render the Big version of a card picture, backups to text version in case of failure */ - static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false); + static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false, bool smallerscale = false); static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal); static void AlternateRender(MTGCard * card, const Pos& pos); @@ -55,8 +55,8 @@ public: virtual void Render(); virtual void Update(float dt); - void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false); - static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false); + void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool smallscale = false); + static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool smallscale = false); static JQuadPtr AlternateThumbQuad(MTGCard * card); virtual ostream& toString(ostream&) const; diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 356203bd0..4e78569ac 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -98,6 +98,7 @@ public: bool exileEffects; bool suspended; bool miracle; + bool hasCopiedToken; bool isBestowed; int chooseacolor; string chooseasubtype; diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index f7b052513..b9cc7215b 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1466,18 +1466,23 @@ AACopier::AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, M int AACopier::resolve() { + bool tokencopied = false; MTGCardInstance * _target = (MTGCardInstance *) target; if (_target) { MTGCard* clone ; - if(_target->isToken || _target->isACopier) + if(_target->isToken || (_target->isACopier && _target->hasCopiedToken)) + { clone = _target; + tokencopied = true; + } else clone = MTGCollection()->getCardById(_target->copiedID); MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game); source->copy(myClone); SAFE_DELETE(myClone); source->isACopier = true; + source->hasCopiedToken = tokencopied; source->copiedID = _target->copiedID; if(_target->isMorphed) { @@ -3880,8 +3885,8 @@ int AACloner::resolve() // Use id of the card to have the same image as the original MTGCard* clone = (_target->isToken ? _target: MTGCollection()->getCardById(_target->getId())); - // If its a copier then copy what it is - if(_target->isACopier) + // If its a copier and copied a token then copy what it is + if(_target->isACopier && _target->hasCopiedToken) clone = _target; Player * targetPlayer = who == 1 ? source->controller()->opponent() : source->controller(); diff --git a/projects/mtg/src/CardDisplay.cpp b/projects/mtg/src/CardDisplay.cpp index 13c9f2fcd..d9147acdf 100644 --- a/projects/mtg/src/CardDisplay.cpp +++ b/projects/mtg/src/CardDisplay.cpp @@ -263,11 +263,11 @@ void CardDisplay::Render() { mObjects[mCurr]->Render(); CardGui * cardg = ((CardGui *) mObjects[mCurr]); - Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 1.0, 0.0, 220); - int drawMode = DrawMode::kNormal; + Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 0.90f, 0.0, 220); + int drawMode = DrawMode::kNormal;//scale card display from 1.0f to 0.90f if (observer) { - pos.actY = 145; + pos.actY = 142;//reduce y a little if (x < (CardGui::BigWidth / 2)) pos.actX = SCREEN_WIDTH - 10 - CardGui::BigWidth / 2; drawMode = observer->getCardSelector()->GetDrawMode(); } diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 63de518ab..d0021a34b 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -111,17 +111,17 @@ void CardGui::Update(float dt) PlayGuiObject::Update(dt); } -void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder) +void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder, bool smallerscale) { - DrawCard(card, inPosition, inMode, thumb, noborder); + DrawCard(card, inPosition, inMode, thumb, noborder, smallerscale); } -void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder) +void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder, bool smallerscale) { switch (inMode) { case DrawMode::kNormal: - RenderBig(inCard, inPosition, thumb, noborder); + RenderBig(inCard, inPosition, thumb, noborder, smallerscale); break; case DrawMode::kText: AlternateRender(inCard, inPosition); @@ -1114,7 +1114,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad) } //Renders a big card on screen. Defaults to the "alternate" rendering if no image is found -void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder) +void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder, bool smallerscale) { JRenderer * renderer = JRenderer::GetInstance(); //GameObserver * game = GameObserver::GetInstance(); @@ -1145,7 +1145,7 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder if(!noborder) { if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") - { + {//Draw white border renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(255,248,248,255)); renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(150,20,20,20)); } @@ -1153,27 +1153,35 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder { if(cardsetname == "LEA"||cardsetname == "LEB") { + //force smaller scale + smallerscale = true; + //Draw more rounder black border renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-10.5f,(pos.actY - (pos.actZ * 119.7f))-11.5f,pos.actZ * 168.f + 0.5f,pos.actZ * 239.4f + 4.f,10.f,ARGB(255,5,5,5)); renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-10.5f,(pos.actY - (pos.actZ * 119.7f))-11.5f,pos.actZ * 168.f + 0.5f,pos.actZ * 239.4f + 4.f,10.f,ARGB(50,240,240,240)); } else - { + {//draw black border renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(255,5,5,5)); renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(50,240,240,240)); } } - if(cardsetname == "LEA"||cardsetname == "LEB") - { - if(alphabeta.get()) - renderer->RenderQuad(alphabeta.get(),(pos.actX - (pos.actZ * 100.f))+12.f,(pos.actY - (pos.actZ * 142.5f))+17.5f, pos.actT, 0.88f, 0.88f); - renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale-0.01f, scale-0.01f); - } - else - renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale); } + //draw inner border + if(cardsetname == "LEA"||cardsetname == "LEB") + { + if(alphabeta.get()) + { + alphabeta->SetHotSpot(static_cast (alphabeta->mWidth / 2), static_cast (alphabeta->mHeight / 2)); + float myscale = pos.actZ * 250 / alphabeta->mHeight; + alphabeta->SetColor(ARGB((int)pos.actA,255,255,255)); + renderer->RenderQuad(alphabeta.get(), x, pos.actY, pos.actT, myscale, myscale); + } + } + //Draw card + if(smallerscale) + renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale-0.01f, scale-0.01f); else - renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale); - + renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale); RenderCountersBig(card, pos); return; } diff --git a/projects/mtg/src/DeckView.cpp b/projects/mtg/src/DeckView.cpp index a18424a9a..18e6247b3 100644 --- a/projects/mtg/src/DeckView.cpp +++ b/projects/mtg/src/DeckView.cpp @@ -147,6 +147,7 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail, bool addWHbord {//NORMAL VIEW WITH IMAGES int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText; float modx = addWHborder ? 2.0f:0.0f; + bool smallerscale = modx > 0.0f ? true:false; //border for editor && others??? string cardsetname = setlist[cardPosition.card->setId].c_str(); if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") @@ -156,11 +157,19 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail, bool addWHbord } else { - JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(255,10,10,10)); - JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(50,240,240,240)); + if (cardsetname == "LEA" || cardsetname == "LEB") + { + JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 96.75f)-(7.f+modx),(cardPosition.y - cardPosition.scale * 139.25f)-(7.f+modx),cardPosition.scale * 193.5f,cardPosition.scale * 278.5f,7.f+modx,ARGB(255,10,10,10)); + JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 96.75f)-(7.f+modx),(cardPosition.y - cardPosition.scale * 139.25f)-(7.f+modx),cardPosition.scale * 193.5f,cardPosition.scale * 278.5f,7.f+modx,ARGB(50,240,240,240)); + } + else + { + JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(255,10,10,10)); + JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(50,240,240,240)); + } } Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255); - CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true); + CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true, smallerscale); } int quadAlpha = alpha; if (!deck()->count(cardPosition.card)) quadAlpha /= 2; diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 91f5404fc..2c3775dc3 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -227,6 +227,7 @@ void MTGCardInstance::initMTGCI() myPair = NULL; shackled = NULL; miracle = false; + hasCopiedToken = false; countTrini = 0; imprintedCards.clear(); attackCost = 0;