Commit 06d98be4 authored by VanillaSalt's avatar VanillaSalt

update

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