Commit 06d98be4 authored by VanillaSalt's avatar VanillaSalt

update

parent d3dcc211
...@@ -27,6 +27,7 @@ ClientCard::ClientCard() { ...@@ -27,6 +27,7 @@ ClientCard::ClientCard() {
alias = 0; alias = 0;
level = 0; level = 0;
rank = 0; rank = 0;
link = 0;
race = 0; race = 0;
attribute = 0; attribute = 0;
attack = 0; attack = 0;
...@@ -35,7 +36,7 @@ ClientCard::ClientCard() { ...@@ -35,7 +36,7 @@ ClientCard::ClientCard() {
base_defense = 0; base_defense = 0;
lscale = 0; lscale = 0;
rscale = 0; rscale = 0;
link = 0; link_marker = 0;
cHint = 0; cHint = 0;
chValue = 0; chValue = 0;
atkstring[0] = 0; atkstring[0] = 0;
...@@ -88,13 +89,6 @@ void ClientCard::UpdateInfo(char* buf) { ...@@ -88,13 +89,6 @@ void ClientCard::UpdateInfo(char* buf) {
myswprintf(lvstring, L"R%d", rank); myswprintf(lvstring, L"R%d", rank);
} }
} }
if(flag & QUERY_LINK) {
pdata = BufferIO::ReadInt32(buf);
if (link != (unsigned int)pdata) {
link = pdata;
myswprintf(lvstring, L"L%d", link);
}
}
if(flag & QUERY_ATTRIBUTE) if(flag & QUERY_ATTRIBUTE)
attribute = BufferIO::ReadInt32(buf); attribute = BufferIO::ReadInt32(buf);
if(flag & QUERY_RACE) if(flag & QUERY_RACE)
...@@ -109,7 +103,10 @@ void ClientCard::UpdateInfo(char* buf) { ...@@ -109,7 +103,10 @@ void ClientCard::UpdateInfo(char* buf) {
} }
if(flag & QUERY_DEFENSE) { if(flag & QUERY_DEFENSE) {
defense = BufferIO::ReadInt32(buf); defense = BufferIO::ReadInt32(buf);
if(defense < 0) { if(type & TYPE_LINK) {
defstring[0] = '-';
defstring[1] = 0;
} else if(defense < 0) {
defstring[0] = '?'; defstring[0] = '?';
defstring[1] = 0; defstring[1] = 0;
} else } else
...@@ -170,6 +167,16 @@ void ClientCard::UpdateInfo(char* buf) { ...@@ -170,6 +167,16 @@ void ClientCard::UpdateInfo(char* buf) {
rscale = BufferIO::ReadInt32(buf); rscale = BufferIO::ReadInt32(buf);
myswprintf(rscstring, L"%d", rscale); myswprintf(rscstring, L"%d", rscale);
} }
if(flag & QUERY_LINK) {
pdata = BufferIO::ReadInt32(buf);
if (link != (unsigned int)pdata) {
link = pdata;
}
pdata = BufferIO::ReadInt32(buf);
if (link_marker != (unsigned int)pdata) {
link_marker = pdata;
}
}
} }
void ClientCard::ClearTarget() { void ClientCard::ClearTarget() {
for(auto cit = cardTarget.begin(); cit != cardTarget.end(); ++cit) { for(auto cit = cardTarget.begin(); cit != cardTarget.end(); ++cit) {
......
...@@ -20,6 +20,7 @@ struct CardData { ...@@ -20,6 +20,7 @@ struct CardData {
int defense; int defense;
unsigned int lscale; unsigned int lscale;
unsigned int rscale; unsigned int rscale;
unsigned int link_marker;
}; };
struct CardDataC { struct CardDataC {
unsigned int code; unsigned int code;
...@@ -33,6 +34,7 @@ struct CardDataC { ...@@ -33,6 +34,7 @@ struct CardDataC {
int defense; int defense;
unsigned int lscale; unsigned int lscale;
unsigned int rscale; unsigned int rscale;
unsigned int link_marker;
unsigned int ot; unsigned int ot;
unsigned int category; unsigned int category;
}; };
...@@ -69,6 +71,7 @@ public: ...@@ -69,6 +71,7 @@ public:
u32 type; u32 type;
u32 level; u32 level;
u32 rank; u32 rank;
u32 link;
u32 attribute; u32 attribute;
u32 race; u32 race;
s32 attack; s32 attack;
...@@ -77,7 +80,7 @@ public: ...@@ -77,7 +80,7 @@ public:
s32 base_defense; s32 base_defense;
u32 lscale; u32 lscale;
u32 rscale; u32 rscale;
u32 link; u32 link_marker;
u32 reason; u32 reason;
u32 select_seq; u32 select_seq;
u8 owner; u8 owner;
......
...@@ -31,6 +31,11 @@ bool DataManager::LoadDB(const char* file) { ...@@ -31,6 +31,11 @@ bool DataManager::LoadDB(const char* file) {
cd.type = sqlite3_column_int(pStmt, 4); cd.type = sqlite3_column_int(pStmt, 4);
cd.attack = sqlite3_column_int(pStmt, 5); cd.attack = sqlite3_column_int(pStmt, 5);
cd.defense = sqlite3_column_int(pStmt, 6); cd.defense = sqlite3_column_int(pStmt, 6);
if(cd.type & TYPE_LINK) {
cd.link_marker = cd.defense;
cd.defense = 0;
} else
cd.link_marker = 0;
unsigned int level = sqlite3_column_int(pStmt, 7); unsigned int level = sqlite3_column_int(pStmt, 7);
cd.level = level & 0xff; cd.level = level & 0xff;
cd.lscale = (level >> 24) & 0xff; cd.lscale = (level >> 24) & 0xff;
......
...@@ -381,10 +381,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -381,10 +381,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if (mainGame->cbCardType2->getSelected() == 8) { if (mainGame->cbCardType2->getSelected() == 8) {
mainGame->ebDefense->setEnabled(false); mainGame->ebDefense->setEnabled(false);
mainGame->ebDefense->setText(L""); mainGame->ebDefense->setText(L"");
} } else {
else {
mainGame->ebDefense->setEnabled(true); mainGame->ebDefense->setEnabled(true);
} }
} }
break; break;
...@@ -825,7 +823,7 @@ void DeckBuilder::FilterCards() { ...@@ -825,7 +823,7 @@ void DeckBuilder::FilterCards() {
if((filter_deftype == 1 && data.defense != filter_def) || (filter_deftype == 2 && data.defense < filter_def) if((filter_deftype == 1 && data.defense != filter_def) || (filter_deftype == 2 && data.defense < filter_def)
|| (filter_deftype == 3 && data.defense <= filter_def) || (filter_deftype == 4 && (data.defense > filter_def || data.defense < 0)) || (filter_deftype == 3 && data.defense <= filter_def) || (filter_deftype == 4 && (data.defense > filter_def || data.defense < 0))
|| (filter_deftype == 5 && (data.defense >= filter_def || data.defense < 0)) || (filter_deftype == 6 && data.defense != -2) || (filter_deftype == 5 && (data.defense >= filter_def || data.defense < 0)) || (filter_deftype == 6 && data.defense != -2)
|| (data.type & TYPE_LINK)) || (data.type & TYPE_LINK))
continue; continue;
} }
if(filter_lvtype) { if(filter_lvtype) {
......
...@@ -487,17 +487,13 @@ void Game::DrawMisc() { ...@@ -487,17 +487,13 @@ void Game::DrawMisc() {
} }
} }
void Game::DrawStatus(ClientCard* pcard, int x1, int y1, int x2, int y2) { void Game::DrawStatus(ClientCard* pcard, int x1, int y1, int x2, int y2) {
if(pcard->type & TYPE_LINK) { adFont->draw(L"/", recti(x1 - 4, y1, x1 + 4, y1 + 20), 0xff000000, true, false, 0);
adFont->draw(pcard->atkstring, recti(x1 - 4, y1, x1 + 4, y1 + 20), 0xff000000, true, false, 0); adFont->draw(L"/", recti(x1 - 3, y1 + 1, x1 + 5, y1 + 21), 0xffffffff, true, false, 0);
adFont->draw(pcard->atkstring, recti(x1 - 3, y1 + 1, x1 + 5, y1 + 21), 0xffffffff, true, false, 0); int w = adFont->getDimension(pcard->atkstring).Width;
} adFont->draw(pcard->atkstring, recti(x1 - 5 - w, y1, x1 - 5, y1 + 20), 0xff000000, false, false, 0);
else { adFont->draw(pcard->atkstring, recti(x1 - 4 - w, y1 + 1, x1 - 4, y1 + 21),
adFont->draw(L"/", recti(x1 - 4, y1, x1 + 4, y1 + 20), 0xff000000, true, false, 0); pcard->attack > pcard->base_attack ? 0xffffff00 : pcard->attack < pcard->base_attack ? 0xffff2090 : 0xffffffff, false, false, 0);
adFont->draw(L"/", recti(x1 - 3, y1 + 1, x1 + 5, y1 + 21), 0xffffffff, true, false, 0); if(!(pcard->type & TYPE_LINK)) {
int w = adFont->getDimension(pcard->atkstring).Width;
adFont->draw(pcard->atkstring, recti(x1 - 5 - w, y1, x1 - 5, y1 + 20), 0xff000000, false, false, 0);
adFont->draw(pcard->atkstring, recti(x1 - 4 - w, y1 + 1, x1 - 4, y1 + 21),
pcard->attack > pcard->base_attack ? 0xffffff00 : pcard->attack < pcard->base_attack ? 0xffff2090 : 0xffffffff, false, false, 0);
w = adFont->getDimension(pcard->defstring).Width; w = adFont->getDimension(pcard->defstring).Width;
adFont->draw(pcard->defstring, recti(x1 + 4, y1, x1 + 4 + w, y1 + 20), 0xff000000, false, false, 0); adFont->draw(pcard->defstring, recti(x1 + 4, y1, x1 + 4 + w, y1 + 20), 0xff000000, false, false, 0);
adFont->draw(pcard->defstring, recti(x1 + 5, y1 + 1, x1 + 5 + w, y1 + 21), adFont->draw(pcard->defstring, recti(x1 + 5, y1 + 1, x1 + 5 + w, y1 + 21),
......
...@@ -1747,20 +1747,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1747,20 +1747,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf(formatBuffer, L"\n(%ls)", dataManager.GetName(mcard->alias)); myswprintf(formatBuffer, L"\n(%ls)", dataManager.GetName(mcard->alias));
str.append(formatBuffer); str.append(formatBuffer);
} }
if(mcard->type & TYPE_LINK) { myswprintf(formatBuffer, L"\n%ls/%ls", mcard->atkstring, mcard->defstring);
myswprintf(formatBuffer, L"\n%ls/Link %d", mcard->atkstring, mcard->link); str.append(formatBuffer);
str.append(formatBuffer); if(!(mcard->type & TYPE_LINK)) {
myswprintf(formatBuffer, L"\n%ls/%ls", dataManager.FormatRace(mcard->race), dataManager.FormatAttribute(mcard->attribute));
str.append(formatBuffer);
}
else {
myswprintf(formatBuffer, L"\n%ls/%ls", mcard->atkstring, mcard->defstring);
str.append(formatBuffer);
int form = 0x2605; int form = 0x2605;
if (mcard->rank) ++form; if (mcard->rank) ++form;
myswprintf(formatBuffer, L"\n%c%d %ls/%ls", form, (mcard->level ? mcard->level : mcard->rank), dataManager.FormatRace(mcard->race), dataManager.FormatAttribute(mcard->attribute)); myswprintf(formatBuffer, L"\n%c%d", form, (mcard->level ? mcard->level : mcard->rank));
str.append(formatBuffer);
} else {
myswprintf(formatBuffer, L"\nLINK-%d", mcard->link);
str.append(formatBuffer); str.append(formatBuffer);
if(mcard->link_marker & LINK_MARKER_TOP) {
myswprintf(formatBuffer, L" %ls", dataManager.GetSysString(1361));
str.append(formatBuffer);
}
} }
myswprintf(formatBuffer, L" %ls/%ls", dataManager.FormatRace(mcard->race), dataManager.FormatAttribute(mcard->attribute));
str.append(formatBuffer);
if(mcard->location == LOCATION_HAND && (mcard->type & TYPE_PENDULUM)) { if(mcard->location == LOCATION_HAND && (mcard->type & TYPE_PENDULUM)) {
myswprintf(formatBuffer, L"\n%d/%d", mcard->lscale, mcard->rscale); myswprintf(formatBuffer, L"\n%d/%d", mcard->lscale, mcard->rscale);
str.append(formatBuffer); str.append(formatBuffer);
......
...@@ -1025,15 +1025,9 @@ void Game::ShowCardInfo(int code) { ...@@ -1025,15 +1025,9 @@ void Game::ShowCardInfo(int code) {
if(cd.type & TYPE_MONSTER) { if(cd.type & TYPE_MONSTER) {
myswprintf(formatBuffer, L"[%ls] %ls/%ls", dataManager.FormatType(cd.type), dataManager.FormatRace(cd.race), dataManager.FormatAttribute(cd.attribute)); myswprintf(formatBuffer, L"[%ls] %ls/%ls", dataManager.FormatType(cd.type), dataManager.FormatRace(cd.race), dataManager.FormatAttribute(cd.attribute));
stInfo->setText(formatBuffer); stInfo->setText(formatBuffer);
int form = 0x2605; if(!(cd.type & TYPE_LINK)) {
if(cd.type & TYPE_XYZ) ++form; int form = 0x2605;
if(cd.type & TYPE_LINK) { if(cd.type & TYPE_XYZ) ++form;
if(cd.attack < 0)
myswprintf(formatBuffer, L"?/Link %d", cd.level);
else
myswprintf(formatBuffer, L"%d/Link %d", cd.attack, cd.level);
}
else {
myswprintf(formatBuffer, L"[%c%d] ", form, cd.level); myswprintf(formatBuffer, L"[%c%d] ", form, cd.level);
wchar_t adBuffer[16]; wchar_t adBuffer[16];
if(cd.attack < 0 && cd.defense < 0) if(cd.attack < 0 && cd.defense < 0)
...@@ -1045,6 +1039,14 @@ void Game::ShowCardInfo(int code) { ...@@ -1045,6 +1039,14 @@ void Game::ShowCardInfo(int code) {
else else
myswprintf(adBuffer, L"%d/%d", cd.attack, cd.defense); myswprintf(adBuffer, L"%d/%d", cd.attack, cd.defense);
wcscat(formatBuffer, adBuffer); wcscat(formatBuffer, adBuffer);
} else {
myswprintf(formatBuffer, L"[LINK-%d] ", cd.level);
wchar_t adBuffer[16];
if(cd.attack < 0)
myswprintf(adBuffer, L"?/-");
else
myswprintf(adBuffer, L"%d/-", cd.attack);
wcscat(formatBuffer, adBuffer);
} }
if(cd.type & TYPE_PENDULUM) { if(cd.type & TYPE_PENDULUM) {
wchar_t scaleBuffer[16]; wchar_t scaleBuffer[16];
......
...@@ -519,12 +519,12 @@ extern Game* mainGame; ...@@ -519,12 +519,12 @@ extern Game* mainGame;
#define BUTTON_SIDE_OK 309 #define BUTTON_SIDE_OK 309
#define BUTTON_SHUFFLE_DECK 310 #define BUTTON_SHUFFLE_DECK 310
#define COMBOBOX_MAINTYPE 311 #define COMBOBOX_MAINTYPE 311
#define BUTTON_EFFECT_FILTER 312 #define COMBOBOX_SECONDTYPE 312
#define BUTTON_START_FILTER 313 #define BUTTON_EFFECT_FILTER 313
#define SCROLL_FILTER 314 #define BUTTON_START_FILTER 314
#define EDITBOX_KEYWORD 315 #define SCROLL_FILTER 315
#define BUTTON_CLEAR_FILTER 316 #define EDITBOX_KEYWORD 316
#define COMBOBOX_SECONDTYPE 317 #define BUTTON_CLEAR_FILTER 317
#define BUTTON_REPLAY_START 320 #define BUTTON_REPLAY_START 320
#define BUTTON_REPLAY_PAUSE 321 #define BUTTON_REPLAY_PAUSE 321
#define BUTTON_REPLAY_STEP 322 #define BUTTON_REPLAY_STEP 322
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment