You need to sign in or sign up before continuing.
Commit 20879164 authored by nanahira's avatar nanahira

Merge branch 'attack' into another

parents 15cedd84 53398f28
No preview for this file type
...@@ -1549,6 +1549,7 @@ void ClientField::RefreshCardCountDisplay() { ...@@ -1549,6 +1549,7 @@ void ClientField::RefreshCardCountDisplay() {
ClientCard* pcard; ClientCard* pcard;
for(int p = 0; p < 2; ++p) { for(int p = 0; p < 2; ++p) {
mainGame->dInfo.card_count[p] = hand[p].size(); mainGame->dInfo.card_count[p] = hand[p].size();
mainGame->dInfo.total_attack[p] = 0;
for(auto it = mzone[p].begin(); it != mzone[p].end(); ++it) { for(auto it = mzone[p].begin(); it != mzone[p].end(); ++it) {
pcard = *it; pcard = *it;
if(pcard) { if(pcard) {
...@@ -1556,6 +1557,8 @@ void ClientField::RefreshCardCountDisplay() { ...@@ -1556,6 +1557,8 @@ void ClientField::RefreshCardCountDisplay() {
mainGame->dInfo.card_count[p] += pcard->link; mainGame->dInfo.card_count[p] += pcard->link;
else else
mainGame->dInfo.card_count[p]++; mainGame->dInfo.card_count[p]++;
if(pcard->position == POS_FACEUP_ATTACK && pcard->attack > 0 && (p == 1 || mainGame->dInfo.curMsg != MSG_SELECT_BATTLECMD || pcard->cmdFlag & COMMAND_ATTACK))
mainGame->dInfo.total_attack[p] += pcard->attack;
} }
} }
for(auto it = szone[p].begin(); it != szone[p].end(); ++it) { for(auto it = szone[p].begin(); it != szone[p].end(); ++it) {
...@@ -1564,6 +1567,7 @@ void ClientField::RefreshCardCountDisplay() { ...@@ -1564,6 +1567,7 @@ void ClientField::RefreshCardCountDisplay() {
mainGame->dInfo.card_count[p]++; mainGame->dInfo.card_count[p]++;
} }
myswprintf(mainGame->dInfo.str_card_count[p], L"%d", mainGame->dInfo.card_count[p]); myswprintf(mainGame->dInfo.str_card_count[p], L"%d", mainGame->dInfo.card_count[p]);
myswprintf(mainGame->dInfo.str_total_attack[p], L"%d", mainGame->dInfo.total_attack[p]);
} }
if(mainGame->dInfo.card_count[0] > mainGame->dInfo.card_count[1]) { if(mainGame->dInfo.card_count[0] > mainGame->dInfo.card_count[1]) {
mainGame->dInfo.card_count_color[0] = 0xffffff00; mainGame->dInfo.card_count_color[0] = 0xffffff00;
...@@ -1575,5 +1579,15 @@ void ClientField::RefreshCardCountDisplay() { ...@@ -1575,5 +1579,15 @@ void ClientField::RefreshCardCountDisplay() {
mainGame->dInfo.card_count_color[0] = 0xffffffff; mainGame->dInfo.card_count_color[0] = 0xffffffff;
mainGame->dInfo.card_count_color[1] = 0xffffffff; mainGame->dInfo.card_count_color[1] = 0xffffffff;
} }
if(mainGame->dInfo.total_attack[0] > mainGame->dInfo.total_attack[1]) {
mainGame->dInfo.total_attack_color[0] = 0xffffff00;
mainGame->dInfo.total_attack_color[1] = 0xffff0000;
} else if(mainGame->dInfo.total_attack[1] > mainGame->dInfo.total_attack[0]) {
mainGame->dInfo.total_attack_color[1] = 0xffffff00;
mainGame->dInfo.total_attack_color[0] = 0xffff0000;
} else {
mainGame->dInfo.total_attack_color[0] = 0xffffffff;
mainGame->dInfo.total_attack_color[1] = 0xffffffff;
}
} }
} }
...@@ -567,6 +567,12 @@ void Game::DrawMisc() { ...@@ -567,6 +567,12 @@ void Game::DrawMisc() {
DrawShadowText(numFont, dInfo.str_card_count[0], Resize(550, 31, 575, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[0], 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.str_card_count[0], Resize(550, 31, 575, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[0], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_card_count[1], Resize(757, 31, 782, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[1], 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.str_card_count[1], Resize(757, 31, 782, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[1], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_total_attack[0], Resize(486, 31, 536, 50), Resize(0, 1, 2, 0), dInfo.total_attack_color[0], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_total_attack[1], Resize(793, 31, 843, 50), Resize(0, 1, 2, 0), dInfo.total_attack_color[1], 0xff000000, true, false, 0);
driver->draw2DImage(imageManager.tAttack, ResizeCardMid(477, 32, 486, 50, 486, 41), recti(32, 0, 96, 128), 0, 0, true);
driver->draw2DImage(imageManager.tAttack, ResizeCardMid(784, 32, 793, 50, 793, 41), recti(32, 0, 96, 128), 0, 0, true);
/* /*
driver->draw2DRectangle(Resize(525, 34, 525 + dInfo.time_left[0] * 100 / dInfo.time_limit, 44), 0xa0e0e0e0, 0xa0e0e0e0, 0xa0c0c0c0, 0xa0c0c0c0); driver->draw2DRectangle(Resize(525, 34, 525 + dInfo.time_left[0] * 100 / dInfo.time_limit, 44), 0xa0e0e0e0, 0xa0e0e0e0, 0xa0c0c0c0, 0xa0c0c0c0);
driver->draw2DRectangleOutline(Resize(525, 34, 625, 44), 0xffffffff); driver->draw2DRectangleOutline(Resize(525, 34, 625, 44), 0xffffffff);
...@@ -580,6 +586,12 @@ void Game::DrawMisc() { ...@@ -580,6 +586,12 @@ void Game::DrawMisc() {
DrawShadowText(numFont, dInfo.str_card_count[0], Resize(600, 31, 625, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[0], 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.str_card_count[0], Resize(600, 31, 625, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[0], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_card_count[1], Resize(707, 31, 732, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[1], 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.str_card_count[1], Resize(707, 31, 732, 50), Resize(0, 1, 2, 0), dInfo.card_count_color[1], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_total_attack[0], Resize(536, 31, 586, 50), Resize(0, 1, 2, 0), dInfo.total_attack_color[0], 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.str_total_attack[1], Resize(743, 31, 793, 50), Resize(0, 1, 2, 0), dInfo.total_attack_color[1], 0xff000000, true, false, 0);
driver->draw2DImage(imageManager.tAttack, ResizeCardMid(527, 32, 536, 50, 536, 41), recti(32, 0, 96, 128), 0, 0, true);
driver->draw2DImage(imageManager.tAttack, ResizeCardMid(734, 32, 743, 50, 743, 41), recti(32, 0, 96, 128), 0, 0, true);
} }
DrawShadowText(numFont, dInfo.strLP[0], Resize(330, 12, 631, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.strLP[0], Resize(330, 12, 631, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0);
DrawShadowText(numFont, dInfo.strLP[1], Resize(691, 12, 992, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0); DrawShadowText(numFont, dInfo.strLP[1], Resize(691, 12, 992, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0);
......
...@@ -1276,6 +1276,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1276,6 +1276,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.attackable_cards.push_back(pcard); mainGame->dField.attackable_cards.push_back(pcard);
pcard->cmdFlag |= COMMAND_ATTACK; pcard->cmdFlag |= COMMAND_ATTACK;
} }
mainGame->dField.RefreshCardCountDisplay();
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
if(BufferIO::ReadInt8(pbuf)) { if(BufferIO::ReadInt8(pbuf)) {
mainGame->btnM2->setVisible(true); mainGame->btnM2->setVisible(true);
...@@ -2447,6 +2448,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2447,6 +2448,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnShuffle->setVisible(false); mainGame->btnShuffle->setVisible(false);
mainGame->showcarddif = 30; mainGame->showcarddif = 30;
mainGame->showcardp = 0; mainGame->showcardp = 0;
mainGame->dField.RefreshCardCountDisplay();
switch (phase) { switch (phase) {
case PHASE_DRAW: case PHASE_DRAW:
mainGame->btnPhaseStatus->setText(L"\xff24\xff30"); mainGame->btnPhaseStatus->setText(L"\xff24\xff30");
......
...@@ -74,6 +74,7 @@ struct DuelInfo { ...@@ -74,6 +74,7 @@ struct DuelInfo {
int lp[2]; int lp[2];
int start_lp[2]; int start_lp[2];
int card_count[2]; int card_count[2];
int total_attack[2];
int duel_rule; int duel_rule;
int turn; int turn;
short curMsg; short curMsg;
...@@ -90,7 +91,9 @@ struct DuelInfo { ...@@ -90,7 +91,9 @@ struct DuelInfo {
wchar_t str_time_left[2][16]; wchar_t str_time_left[2][16];
video::SColor time_color[2]; video::SColor time_color[2];
wchar_t str_card_count[2][16]; wchar_t str_card_count[2][16];
wchar_t str_total_attack[2][16];
video::SColor card_count_color[2]; video::SColor card_count_color[2];
video::SColor total_attack_color[2];
bool isReplaySwapped; bool isReplaySwapped;
bool isReconnected; bool isReconnected;
std::vector<unsigned int> announce_cache; std::vector<unsigned int> announce_cache;
......
Subproject commit beb61ff9ab0e46a62e6d88cd6d23da7aa55ad8e1 Subproject commit 7329a586f49de069af12f3fb1656ee6adfd3fd76
...@@ -939,3 +939,4 @@ ...@@ -939,3 +939,4 @@
!setname 0x121 魔妖 !setname 0x121 魔妖
!setname 0x122 女武神 Valkyrie !setname 0x122 女武神 Valkyrie
!setname 0x123 蔷薇龙 ローズ・ドラゴン !setname 0x123 蔷薇龙 ローズ・ドラゴン
!setname 0x124 机械天使 機械天使
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