Commit 55536b64 authored by nanahira's avatar nanahira Committed by GitHub

update max value of LP bar (#2459)

parent 4a1b52e5
......@@ -517,12 +517,14 @@ void Game::DrawMisc() {
}
driver->draw2DImage(imageManager.tLPFrame, Resize(330, 10, 629, 30), recti(0, 0, 200, 20), 0, 0, true);
driver->draw2DImage(imageManager.tLPFrame, Resize(691, 10, 990, 30), recti(0, 0, 200, 20), 0, 0, true);
if(dInfo.lp[0] >= 8000)
driver->draw2DImage(imageManager.tLPBar, Resize(335, 12, 625, 28), recti(0, 0, 16, 16), 0, 0, true);
else driver->draw2DImage(imageManager.tLPBar, Resize(335, 12, 335 + 290 * dInfo.lp[0] / 8000, 28), recti(0, 0, 16, 16), 0, 0, true);
if(dInfo.lp[1] >= 8000)
driver->draw2DImage(imageManager.tLPBar, Resize(696, 12, 986, 28), recti(0, 0, 16, 16), 0, 0, true);
else driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * dInfo.lp[1] / 8000, 12, 986, 28), recti(0, 0, 16, 16), 0, 0, true);
if(dInfo.start_lp) {
if(dInfo.lp[0] >= dInfo.start_lp)
driver->draw2DImage(imageManager.tLPBar, Resize(335, 12, 625, 28), recti(0, 0, 16, 16), 0, 0, true);
else driver->draw2DImage(imageManager.tLPBar, Resize(335, 12, 335 + 290 * dInfo.lp[0] / dInfo.start_lp, 28), recti(0, 0, 16, 16), 0, 0, true);
if(dInfo.lp[1] >= dInfo.start_lp)
driver->draw2DImage(imageManager.tLPBar, Resize(696, 12, 986, 28), recti(0, 0, 16, 16), 0, 0, true);
else driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * dInfo.lp[1] / dInfo.start_lp, 12, 986, 28), recti(0, 0, 16, 16), 0, 0, true);
}
if(lpframe) {
dInfo.lp[lpplayer] -= lpd;
myswprintf(dInfo.strLP[lpplayer], L"%d", dInfo.lp[lpplayer]);
......
......@@ -495,6 +495,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->wChat->setVisible(true);
mainGame->gMutex.unlock();
mainGame->dInfo.duel_rule = pkt->info.duel_rule;
mainGame->dInfo.start_lp = pkt->info.start_lp;
watching = 0;
connect_state |= 0x4;
break;
......
......@@ -75,6 +75,7 @@ struct DuelInfo {
bool is_shuffling;
bool tag_player[2];
int lp[2];
int start_lp;
int duel_rule;
int turn;
short curMsg;
......
......@@ -175,6 +175,7 @@ bool ReplayMode::StartDuel() {
set_player_info(pduel, 1, start_lp, start_hand, draw_count);
mainGame->dInfo.lp[0] = start_lp;
mainGame->dInfo.lp[1] = start_lp;
mainGame->dInfo.start_lp = start_lp;
myswprintf(mainGame->dInfo.strLP[0], L"%d", mainGame->dInfo.lp[0]);
myswprintf(mainGame->dInfo.strLP[1], L"%d", mainGame->dInfo.lp[1]);
mainGame->dInfo.turn = 0;
......
......@@ -44,6 +44,7 @@ int SingleMode::SinglePlayThread() {
set_player_info(pduel, 1, start_lp, start_hand, draw_count);
mainGame->dInfo.lp[0] = start_lp;
mainGame->dInfo.lp[1] = start_lp;
mainGame->dInfo.start_lp = start_lp;
myswprintf(mainGame->dInfo.strLP[0], L"%d", mainGame->dInfo.lp[0]);
myswprintf(mainGame->dInfo.strLP[1], L"%d", mainGame->dInfo.lp[1]);
BufferIO::CopyWStr(mainGame->ebNickName->getText(), mainGame->dInfo.hostname, 20);
......
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