- Added CC Avatar
- Fixed a segfault bug when selling cards
- Added a few messages in the credits
- Show types of a card in "Alternate" display
- This update should get rid of all copyrighted contents
This commit is contained in:
wagic.the.homebrew
2009-02-01 06:29:29 +00:00
parent 2d37fafe53
commit 9454ac88fe
9 changed files with 79 additions and 54 deletions
+9 -1
View File
@@ -1,6 +1,7 @@
#include "../include/config.h"
#include "../include/CardGui.h"
#include "../include/ManaCostHybrid.h"
#include "../include/Subtypes.h"
#include <Vector2D.h>
void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcons, float x, float y, float rotation, float scale){
@@ -63,7 +64,6 @@ void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcon
unsigned int j = 0;
while ((h = manacost->getHybridCost(j))){
OutputDebugString("Hybrid\n");
for (int i = 0; i < 2; i++){
int color = h->color1;
int value = h->value1;
@@ -178,6 +178,14 @@ void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcon
mFont->DrawString(buf,x+v.x,y+v.y);
}
for (int i = card->nb_types-1; i>=0; i--){
v.x = ((-width/2)+10) * scale;
v.y = (height/2-20 - 12 * i) * scale;
v.Rotate(rotation);
string s = Subtypes::subtypesList->find(card->types[i]);
mFont->DrawString(s.c_str(),x+v.x,y+v.y);
}
}
+15 -3
View File
@@ -47,6 +47,7 @@ GameStateDuel::GameStateDuel(GameApp* parent): GameState(parent) {
#ifdef TESTSUITE
testSuite = NULL;
#endif
showMsg = 0;
}
GameStateDuel::~GameStateDuel() {
@@ -69,8 +70,8 @@ void GameStateDuel::Start()
mGamePhase = DUEL_STATE_CHOOSE_DECK1;
mFont = GameApp::CommonRes->GetJLBFont(Constants::MENU_FONT);
mFont->SetBase(0); // using 2nd font
opponentMenuFont = mFont; //NEW JLBFont("graphics/simon",22);
mFont->SetBase(0);
opponentMenuFont = mFont;
menu = NEW SimpleMenu(DUEL_MENU_GAME_MENU, this, mFont, SCREEN_WIDTH/2-100, 25);
@@ -280,6 +281,7 @@ void GameStateDuel::Update(float dt)
}
game->Update(dt);
if (game->gameOver){
showMsg = (rand() % 5);
if (!mPlayers[0]->isAI() && mPlayers[1]->isAI() && mPlayers[0]!= game->gameOver){
#if defined (WIN32) || defined (LINUX)
char buf[4096];
@@ -352,7 +354,7 @@ void GameStateDuel::Render()
if (!mPlayers[0]->isAI() && mPlayers[1]->isAI() ){
if (game->gameOver !=mPlayers[0]){
sprintf (buffer, "Victory! Congratulations, You earn 500 credits");
}else{
}else{
sprintf (buffer, "You have been defeated");
}
}else{
@@ -363,6 +365,16 @@ void GameStateDuel::Render()
sprintf(buffer, "Player %i wins (%i)", winner, p0life );
}
mFont->DrawString(buffer, 10, 150);
if (showMsg == 1){
JLBFont * f = GameApp::CommonRes->GetJLBFont(Constants::MAIN_FONT);
mFont->DrawString("Please support this project !" ,10,180);
f->DrawString("Wagic is free, open source, and developed on the little free time I have" ,10,196);
f->DrawString("If you enjoy this game, please consider donating a few bucks" ,10,208);
f->DrawString("I'll drink a beer in your name!" ,10,220);
f->DrawString("Thanks in advance for your support." ,10,232);
mFont->DrawString("-> http://wololo.net/wagic" ,10,244);
}
break;
}
case DUEL_STATE_CHOOSE_DECK1:
+11 -18
View File
@@ -69,43 +69,36 @@ void GameStateOptions::Render()
"Wagic, The Homebrew ?! by WilLoW",
"This is a work in progress and it contains bugs",
"updates on http://www.wololo.net/wagic",
"Many thanks to J for his help in this release, and to all card creators",
"Many thanks to the programmers and card creators who helped in this release",
"",
"Developped with the JGE++ Library (http://jge.khors.com)",
"",
"this freeware app is not endorsed by Wizards of the Coast, Inc",
"",
"Player's avatar from http://mathieuchoinet.blogspot.com, under CC License",
"Background picture from KDE4 , www.kde.org",
"SFX From www.soundsnap.com",
};
const char * const MusicText[] = {
"",
"Music by Celestial Aeon Project, under Creative Commons License",
"Their music can be downloaded at http://www.jamendo.com"
"Their music can be downloaded at http://www.jamendo.com",
"",
"This work is not related to or endoresed by Wizards of the Coast, Inc",
"",
"Please support this project with donations at http://wololo.net/wagic",
};
JLBFont * mFont = GameApp::CommonRes->GetJLBFont("graphics/magic");
mFont->SetColor(ARGB(255,200,200,200));
mFont->SetScale(1.0);
float startpos = 272 - timer * 10;
float pos = startpos;
for (int i = 0; i < 10; i++){
int size = sizeof(CreditsText) / sizeof(CreditsText[0]);
for (int i = 0; i < size; i++){
pos = startpos +20*i;
if (pos > -20){
mFont->DrawString(CreditsText[i],SCREEN_WIDTH/2,pos ,JGETEXT_CENTER);
}
}
if (GameApp::HasMusic){
for (int i = 0; i < 3; i++){
pos = startpos +20*(10+i);
if (pos > -20){
mFont->DrawString(MusicText[i],SCREEN_WIDTH/2, pos,JGETEXT_CENTER);
}
}
}
if (pos < -20) timer = 0;
mFont->SetScale(1.f);
+8
View File
@@ -352,6 +352,14 @@ void MTGGuiPlay::Render(){
RenderPlayerInfo(0);
RenderPlayerInfo(1);
int opponentHand = game->players[1]->game->hand->nb_cards;
char buffer[10];
sprintf(buffer,"%i",opponentHand);
mFont->SetColor(ARGB(128,0,0,0));
mFont->DrawString(buffer, 56, 20);
mFont->SetColor(ARGB(255,255,255,255));
mFont->DrawString(buffer, 54, 18);
if (mGlitterAlpha < 0){
mGlitterAlpha = 510;
int position = rand() % 2;
-5
View File
@@ -14,11 +14,6 @@ Subtypes::Subtypes(){
int Subtypes::Add(string value){
int result = find(value);
if (result) return result;
#if defined (WIN32)
char buf[4096];
sprintf(buf, "Adding new type: *%s*\n",value.c_str());
OutputDebugString(buf);
#endif
std::transform( value.begin(), value.end(), value.begin(), ::tolower );
nb_items++;
values[value] = nb_items;