Commit 14444f12 authored by salix5's avatar salix5

defence->defense

parent 0f849425
...@@ -31,9 +31,9 @@ ClientCard::ClientCard() { ...@@ -31,9 +31,9 @@ ClientCard::ClientCard() {
race = 0; race = 0;
attribute = 0; attribute = 0;
attack = 0; attack = 0;
defence = 0; defense = 0;
base_attack = 0; base_attack = 0;
base_defence = 0; base_defense = 0;
lscale = 0; lscale = 0;
rscale = 0; rscale = 0;
cHint = 0; cHint = 0;
...@@ -101,17 +101,17 @@ void ClientCard::UpdateInfo(char* buf) { ...@@ -101,17 +101,17 @@ void ClientCard::UpdateInfo(char* buf) {
myswprintf(atkstring, L"%d", attack); myswprintf(atkstring, L"%d", attack);
} }
if(flag & QUERY_DEFENCE) { if(flag & QUERY_DEFENCE) {
defence = BufferIO::ReadInt32(buf); defense = BufferIO::ReadInt32(buf);
if(defence < 0) { if(defense < 0) {
defstring[0] = '?'; defstring[0] = '?';
defstring[1] = 0; defstring[1] = 0;
} else } else
myswprintf(defstring, L"%d", defence); myswprintf(defstring, L"%d", defense);
} }
if(flag & QUERY_BASE_ATTACK) if(flag & QUERY_BASE_ATTACK)
base_attack = BufferIO::ReadInt32(buf); base_attack = BufferIO::ReadInt32(buf);
if(flag & QUERY_BASE_DEFENCE) if(flag & QUERY_BASE_DEFENCE)
base_defence = BufferIO::ReadInt32(buf); base_defense = BufferIO::ReadInt32(buf);
if(flag & QUERY_REASON) if(flag & QUERY_REASON)
reason = BufferIO::ReadInt32(buf); reason = BufferIO::ReadInt32(buf);
if(flag & QUERY_EQUIP_CARD) { if(flag & QUERY_EQUIP_CARD) {
...@@ -214,8 +214,8 @@ bool ClientCard::deck_sort_lv(code_pointer p1, code_pointer p2) { ...@@ -214,8 +214,8 @@ bool ClientCard::deck_sort_lv(code_pointer p1, code_pointer p2) {
return p1->second.level > p2->second.level; return p1->second.level > p2->second.level;
if(p1->second.attack != p2->second.attack) if(p1->second.attack != p2->second.attack)
return p1->second.attack > p2->second.attack; return p1->second.attack > p2->second.attack;
if(p1->second.defence != p2->second.defence) if(p1->second.defense != p2->second.defense)
return p1->second.defence > p2->second.defence; return p1->second.defense > p2->second.defense;
return p1->first < p2->first; return p1->first < p2->first;
} }
if((p1->second.type & 0xfffffff8) != (p2->second.type & 0xfffffff8)) if((p1->second.type & 0xfffffff8) != (p2->second.type & 0xfffffff8))
...@@ -228,8 +228,8 @@ bool ClientCard::deck_sort_atk(code_pointer p1, code_pointer p2) { ...@@ -228,8 +228,8 @@ bool ClientCard::deck_sort_atk(code_pointer p1, code_pointer p2) {
if((p1->second.type & 0x7) == 1) { if((p1->second.type & 0x7) == 1) {
if(p1->second.attack != p2->second.attack) if(p1->second.attack != p2->second.attack)
return p1->second.attack > p2->second.attack; return p1->second.attack > p2->second.attack;
if(p1->second.defence != p2->second.defence) if(p1->second.defense != p2->second.defense)
return p1->second.defence > p2->second.defence; return p1->second.defense > p2->second.defense;
if(p1->second.level != p2->second.level) if(p1->second.level != p2->second.level)
return p1->second.level > p2->second.level; return p1->second.level > p2->second.level;
int type1 = (p1->second.type & 0x8020c0) ? (p1->second.type & 0x8020c1) : (p1->second.type & 0x31); int type1 = (p1->second.type & 0x8020c0) ? (p1->second.type & 0x8020c1) : (p1->second.type & 0x31);
...@@ -246,8 +246,8 @@ bool ClientCard::deck_sort_def(code_pointer p1, code_pointer p2) { ...@@ -246,8 +246,8 @@ bool ClientCard::deck_sort_def(code_pointer p1, code_pointer p2) {
if((p1->second.type & 0x7) != (p2->second.type & 0x7)) if((p1->second.type & 0x7) != (p2->second.type & 0x7))
return (p1->second.type & 0x7) < (p2->second.type & 0x7); return (p1->second.type & 0x7) < (p2->second.type & 0x7);
if((p1->second.type & 0x7) == 1) { if((p1->second.type & 0x7) == 1) {
if(p1->second.defence != p2->second.defence) if(p1->second.defense != p2->second.defense)
return p1->second.defence > p2->second.defence; return p1->second.defense > p2->second.defense;
if(p1->second.attack != p2->second.attack) if(p1->second.attack != p2->second.attack)
return p1->second.attack > p2->second.attack; return p1->second.attack > p2->second.attack;
if(p1->second.level != p2->second.level) if(p1->second.level != p2->second.level)
......
...@@ -17,7 +17,7 @@ struct CardData { ...@@ -17,7 +17,7 @@ struct CardData {
unsigned int attribute; unsigned int attribute;
unsigned int race; unsigned int race;
int attack; int attack;
int defence; int defense;
unsigned int lscale; unsigned int lscale;
unsigned int rscale; unsigned int rscale;
}; };
...@@ -30,7 +30,7 @@ struct CardDataC { ...@@ -30,7 +30,7 @@ struct CardDataC {
unsigned int attribute; unsigned int attribute;
unsigned int race; unsigned int race;
int attack; int attack;
int defence; int defense;
unsigned int lscale; unsigned int lscale;
unsigned int rscale; unsigned int rscale;
unsigned int ot; unsigned int ot;
...@@ -73,9 +73,9 @@ public: ...@@ -73,9 +73,9 @@ public:
u32 attribute; u32 attribute;
u32 race; u32 race;
s32 attack; s32 attack;
s32 defence; s32 defense;
s32 base_attack; s32 base_attack;
s32 base_defence; s32 base_defense;
u32 lscale; u32 lscale;
u32 rscale; u32 rscale;
u32 reason; u32 reason;
......
...@@ -30,7 +30,7 @@ bool DataManager::LoadDB(const char* file) { ...@@ -30,7 +30,7 @@ bool DataManager::LoadDB(const char* file) {
cd.setcode = sqlite3_column_int64(pStmt, 3); cd.setcode = sqlite3_column_int64(pStmt, 3);
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.defence = sqlite3_column_int(pStmt, 6); cd.defense = sqlite3_column_int(pStmt, 6);
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;
......
...@@ -699,9 +699,9 @@ void DeckBuilder::FilterCards() { ...@@ -699,9 +699,9 @@ void DeckBuilder::FilterCards() {
continue; continue;
} }
if(filter_deftype) { if(filter_deftype) {
if((filter_deftype == 1 && data.defence != filter_def) || (filter_deftype == 2 && data.defence < filter_def) if((filter_deftype == 1 && data.defense != filter_def) || (filter_deftype == 2 && data.defense < filter_def)
|| (filter_deftype == 3 && data.defence <= filter_def) || (filter_deftype == 4 && (data.defence > filter_def || data.defence < 0)) || (filter_deftype == 3 && data.defense <= filter_def) || (filter_deftype == 4 && (data.defense > filter_def || data.defense < 0))
|| (filter_deftype == 5 && (data.defence >= filter_def || data.defence < 0)) || (filter_deftype == 6 && data.defence != -2)) || (filter_deftype == 5 && (data.defense >= filter_def || data.defense < 0)) || (filter_deftype == 6 && data.defense != -2))
continue; continue;
} }
if(filter_lvtype) { if(filter_lvtype) {
......
...@@ -415,7 +415,7 @@ void Game::DrawMisc() { ...@@ -415,7 +415,7 @@ void Game::DrawMisc() {
w = adFont->getDimension(pcard->defstring).Width; w = adFont->getDimension(pcard->defstring).Width;
adFont->draw(pcard->defstring, recti(m + 4, 416, m + 4 + w, 436), 0xff000000, false, false, 0); adFont->draw(pcard->defstring, recti(m + 4, 416, m + 4 + w, 436), 0xff000000, false, false, 0);
adFont->draw(pcard->defstring, recti(m + 5, 417, m + 5 + w, 437), adFont->draw(pcard->defstring, recti(m + 5, 417, m + 5 + w, 437),
pcard->defence > pcard->base_defence ? 0xffffff00 : pcard->defence < pcard->base_defence ? 0xffff2090 : 0xffffffff , false, false, 0); pcard->defense > pcard->base_defense ? 0xffffff00 : pcard->defense < pcard->base_defense ? 0xffff2090 : 0xffffffff , false, false, 0);
adFont->draw(pcard->lvstring, recti(473 + i * 80, 356, 475 + i * 80, 366), 0xff000000, false, false, 0); adFont->draw(pcard->lvstring, recti(473 + i * 80, 356, 475 + i * 80, 366), 0xff000000, false, false, 0);
adFont->draw(pcard->lvstring, recti(474 + i * 80, 357, 476 + i * 80, 367), adFont->draw(pcard->lvstring, recti(474 + i * 80, 357, 476 + i * 80, 367),
(pcard->type & TYPE_XYZ) ? 0xffff80ff : (pcard->type & TYPE_TUNER) ? 0xffffff00 : 0xffffffff, false, false, 0); (pcard->type & TYPE_XYZ) ? 0xffff80ff : (pcard->type & TYPE_TUNER) ? 0xffffff00 : 0xffffffff, false, false, 0);
...@@ -434,7 +434,7 @@ void Game::DrawMisc() { ...@@ -434,7 +434,7 @@ void Game::DrawMisc() {
w = adFont->getDimension(pcard->defstring).Width; w = adFont->getDimension(pcard->defstring).Width;
adFont->draw(pcard->defstring, recti(m + 4, 235, m + 4 + w, 255), 0xff000000, false, false, 0); adFont->draw(pcard->defstring, recti(m + 4, 235, m + 4 + w, 255), 0xff000000, false, false, 0);
adFont->draw(pcard->defstring, recti(m + 5, 236, m + 5 + w, 256), adFont->draw(pcard->defstring, recti(m + 5, 236, m + 5 + w, 256),
pcard->defence > pcard->base_defence ? 0xffffff00 : pcard->defence < pcard->base_defence ? 0xffff2090 : 0xffffffff , false, false, 0); pcard->defense > pcard->base_defense ? 0xffffff00 : pcard->defense < pcard->base_defense ? 0xffff2090 : 0xffffffff , false, false, 0);
adFont->draw(pcard->lvstring, recti(779 - i * 71, 272, 800 - i * 71, 292), 0xff000000, false, false, 0); adFont->draw(pcard->lvstring, recti(779 - i * 71, 272, 800 - i * 71, 292), 0xff000000, false, false, 0);
adFont->draw(pcard->lvstring, recti(780 - i * 71, 273, 800 - i * 71, 293), adFont->draw(pcard->lvstring, recti(780 - i * 71, 273, 800 - i * 71, 293),
(pcard->type & TYPE_XYZ) ? 0xffff80ff : (pcard->type & TYPE_TUNER) ? 0xffffff00 : 0xffffffff, false, false, 0); (pcard->type & TYPE_XYZ) ? 0xffff80ff : (pcard->type & TYPE_TUNER) ? 0xffffff00 : 0xffffffff, false, false, 0);
...@@ -967,13 +967,13 @@ void Game::DrawDeckBd() { ...@@ -967,13 +967,13 @@ void Game::DrawDeckBd() {
myswprintf(textBuffer, L"%ls/%ls %c%d", dataManager.FormatAttribute(ptr->second.attribute), dataManager.FormatRace(ptr->second.race), form, ptr->second.level); myswprintf(textBuffer, L"%ls/%ls %c%d", dataManager.FormatAttribute(ptr->second.attribute), dataManager.FormatRace(ptr->second.race), form, ptr->second.level);
textFont->draw(textBuffer, recti(859, 186 + i * 66, 955, 207 + i * 66), 0xff000000, false, false); textFont->draw(textBuffer, recti(859, 186 + i * 66, 955, 207 + i * 66), 0xff000000, false, false);
textFont->draw(textBuffer, recti(860, 187 + i * 66, 955, 207 + i * 66), 0xffffffff, false, false); textFont->draw(textBuffer, recti(860, 187 + i * 66, 955, 207 + i * 66), 0xffffffff, false, false);
if(ptr->second.attack < 0 && ptr->second.defence < 0) if(ptr->second.attack < 0 && ptr->second.defense < 0)
myswprintf(textBuffer, L"?/?"); myswprintf(textBuffer, L"?/?");
else if(ptr->second.attack < 0) else if(ptr->second.attack < 0)
myswprintf(textBuffer, L"?/%d", ptr->second.defence); myswprintf(textBuffer, L"?/%d", ptr->second.defense);
else if(ptr->second.defence < 0) else if(ptr->second.defense < 0)
myswprintf(textBuffer, L"%d/?", ptr->second.attack); myswprintf(textBuffer, L"%d/?", ptr->second.attack);
else myswprintf(textBuffer, L"%d/%d", ptr->second.attack, ptr->second.defence); else myswprintf(textBuffer, L"%d/%d", ptr->second.attack, ptr->second.defense);
if(ptr->second.type & TYPE_PENDULUM) { if(ptr->second.type & TYPE_PENDULUM) {
wchar_t scaleBuffer[16]; wchar_t scaleBuffer[16];
myswprintf(scaleBuffer, L" %d/%d", ptr->second.lscale, ptr->second.rscale); myswprintf(scaleBuffer, L" %d/%d", ptr->second.lscale, ptr->second.rscale);
......
...@@ -2754,8 +2754,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2754,8 +2754,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->attack = aatk; pcard->attack = aatk;
myswprintf(pcard->atkstring, L"%d", aatk); myswprintf(pcard->atkstring, L"%d", aatk);
} }
if(adef != pcard->defence) { if(adef != pcard->defense) {
pcard->defence = adef; pcard->defense = adef;
myswprintf(pcard->defstring, L"%d", adef); myswprintf(pcard->defstring, L"%d", adef);
} }
if(ld) { if(ld) {
...@@ -2764,8 +2764,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2764,8 +2764,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->attack = datk; pcard->attack = datk;
myswprintf(pcard->atkstring, L"%d", datk); myswprintf(pcard->atkstring, L"%d", datk);
} }
if(ddef != pcard->defence) { if(ddef != pcard->defense) {
pcard->defence = ddef; pcard->defense = ddef;
myswprintf(pcard->defstring, L"%d", ddef); myswprintf(pcard->defstring, L"%d", ddef);
} }
} }
......
...@@ -986,14 +986,14 @@ void Game::ShowCardInfo(int code) { ...@@ -986,14 +986,14 @@ void Game::ShowCardInfo(int code) {
if(cd.type & TYPE_XYZ) ++form; if(cd.type & TYPE_XYZ) ++form;
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.defence < 0) if(cd.attack < 0 && cd.defense < 0)
myswprintf(adBuffer, L"?/?"); myswprintf(adBuffer, L"?/?");
else if(cd.attack < 0) else if(cd.attack < 0)
myswprintf(adBuffer, L"?/%d", cd.defence); myswprintf(adBuffer, L"?/%d", cd.defense);
else if(cd.defence < 0) else if(cd.defense < 0)
myswprintf(adBuffer, L"%d/?", cd.attack); myswprintf(adBuffer, L"%d/?", cd.attack);
else else
myswprintf(adBuffer, L"%d/%d", cd.attack, cd.defence); myswprintf(adBuffer, L"%d/%d", cd.attack, cd.defense);
wcscat(formatBuffer, adBuffer); wcscat(formatBuffer, adBuffer);
if(cd.type & TYPE_PENDULUM) { if(cd.type & TYPE_PENDULUM) {
wchar_t scaleBuffer[16]; wchar_t scaleBuffer[16];
......
Subproject commit 7059fdaede394163a2f718ce6a50bafb151fe5f4 Subproject commit 8a34f83647a4f32667e7a35a00109d0c1aaeea68
Subproject commit 9f3a2f3659f31bcb50c188a2e92107980531af75 Subproject commit 2f8b6d0b0779b0cc3499e65ee347b6c5a1e4812b
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