From 04e53f20020951eaf608cf4f82eebca01c811f2f Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 27 Sep 2015 09:52:35 +0800 Subject: [PATCH] increase the players life indicator(scale to 1.3f), fix init vars increase the life indicator for players to 1.3f, life indicator for players changes color according to its value. fix init for vars(should fix gravecardtypes for tarmogoyf and pbasiclandtypes ) --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 2 +- projects/mtg/include/AllAbilities.h | 4 ++-- projects/mtg/src/GuiStatic.cpp | 17 ++++++++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 04a60659b..5bd8fc22c 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -85760,7 +85760,7 @@ auto=@movedTo(*[-creature]|mystack):lifelink ueot text=Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.) -- Whenever you cast a noncreature spell, Seeker of the Way gains lifelink until end of turn. mana={1}{W} type=Creature -subtype=Human Monk +subtype=Human Warrior power=2 toughness=2 [/card] diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index cf8706933..1f1b519f3 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -708,7 +708,7 @@ private: else if (s == "pbasiclandtypes")//Basic Land types { intValue = 0; - int forest, plains, swamp, island, mountain = 0; + int forest = 0, plains = 0, swamp = 0, island = 0, mountain = 0; for (int j = card->controller()->game->battlefield->nb_cards - 1; j >= 0; --j) { if (card->controller()->game->battlefield->cards[j]->hasType("forest")) @@ -801,7 +801,7 @@ private: else if (s == "gravecardtypes")//Tarmogoyf { intValue = 0; - int art, cre, enc, ins, lnd, sor, trb, pwk = 0; + int art = 0, cre = 0, enc = 0, ins = 0, lnd = 0, sor = 0, trb = 0, pwk = 0; for (int i = 0; i < 2; i++) { Player * p = card->getObserver()->players[i]; diff --git a/projects/mtg/src/GuiStatic.cpp b/projects/mtg/src/GuiStatic.cpp index 4269577c9..a087d2186 100644 --- a/projects/mtg/src/GuiStatic.cpp +++ b/projects/mtg/src/GuiStatic.cpp @@ -96,18 +96,29 @@ void GuiAvatar::Render() //Life char buffer[10]; + int lx = 255, ly = 255, lz = 255; + if(life > 24) { lx = 127; ly = 255; lz = 212; } + if(life > 16 && life < 24) { lx = 255; ly = 255; lz = 255; } + if(life > 12 && life < 17) { lx = 255; ly = 255; lz = 105; } + if(life > 8 && life < 13) { lx = 255; ly = 255; lz = 13; } + if(life > 4 && life < 9) { lx = 255; ly = 166; lz = 0; } + if(life < 5) { lx = 255; ly = 40; lz = 0; } sprintf(buffer, "%i", life); switch (corner) { case TOP_LEFT: mFont->SetColor(ARGB((int)actA / 4, 0, 0, 0)); mFont->DrawString(buffer, actX + 2, actY + 2); - mFont->SetColor(ARGB((int)actA, 255, 255, 255)); + mFont->SetScale(1.3f); + mFont->SetColor(ARGB((int)actA, lx, ly, lz)); mFont->DrawString(buffer, actX + 1, actY + 1); + mFont->SetScale(1); break; case BOTTOM_RIGHT: - mFont->SetColor(ARGB((int)actA, 255, 255, 255)); - mFont->DrawString(buffer, actX, actY - 10, JGETEXT_RIGHT); + mFont->SetScale(1.3f); + mFont->SetColor(ARGB((int)actA, lx, ly, lz)); + mFont->DrawString(buffer, actX, actY - 14, JGETEXT_RIGHT); + mFont->SetScale(1); break; } //poison