Commit ce61b797 authored by mercury233's avatar mercury233

update

parent 6c067327
......@@ -1600,6 +1600,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->PlaySoundEffect(SOUND_REVEAL);
myswprintf(textBuffer, dataManager.GetSysString(207), count);
mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(0);
......@@ -1625,7 +1626,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_CONFIRM_CARDS: {
mainGame->PlaySoundEffect(SOUND_REVEAL);
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int count = BufferIO::ReadInt8(pbuf);
int code, c, l, s;
......@@ -1636,6 +1636,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pbuf += count * 7;
return true;
}
mainGame->PlaySoundEffect(SOUND_REVEAL);
myswprintf(textBuffer, dataManager.GetSysString(208), count);
mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(0);
......@@ -1727,7 +1728,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_SHUFFLE_DECK: {
mainGame->PlaySoundEffect(SOUND_SHUFFLE);
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
if(mainGame->dField.deck[player].size() < 2)
return true;
......@@ -1745,6 +1745,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.deck[player][i]->is_reversed = false;
}
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->PlaySoundEffect(SOUND_SHUFFLE);
for (int i = 0; i < 5; ++i) {
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ++cit) {
(*cit)->dPos = irr::core::vector3df(rand() * 0.4f / RAND_MAX - 0.2f, 0, 0);
......@@ -1769,6 +1770,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
/*int count = */BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->PlaySoundEffect(SOUND_SHUFFLE);
mainGame->WaitFrameSignal(5);
if(player == 1 && !mainGame->dInfo.isReplay && !mainGame->dInfo.isSingleMode) {
bool flip = false;
......@@ -1912,6 +1914,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->PlaySoundEffect(SOUND_SHUFFLE);
for (int i = 0; i < count; ++i) {
mainGame->dField.MoveCard(mc[i], 10);
for (cit = mc[i]->overlayed.begin(); cit != mc[i]->overlayed.end(); ++cit)
......@@ -1922,7 +1925,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_NEW_TURN: {
mainGame->PlaySoundEffect(SOUND_NEXT_TURN);
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
mainGame->dInfo.turn++;
if(!mainGame->dInfo.isTag && !mainGame->dInfo.isReplay && mainGame->dInfo.player_type < 7) {
......@@ -1949,6 +1951,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dInfo.tag_player[1] = !mainGame->dInfo.tag_player[1];
}
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->PlaySoundEffect(SOUND_NEXT_TURN);
mainGame->showcardcode = 10;
mainGame->showcarddif = 30;
mainGame->showcardp = 0;
......@@ -1959,7 +1962,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_NEW_PHASE: {
mainGame->PlaySoundEffect(SOUND_PHASE);
unsigned short phase = BufferIO::ReadInt16(pbuf);
mainGame->btnPhaseStatus->setVisible(false);
mainGame->btnBP->setVisible(false);
......@@ -1997,6 +1999,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnPhaseStatus->setPressed(true);
mainGame->btnPhaseStatus->setVisible(true);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->PlaySoundEffect(SOUND_PHASE);
mainGame->showcard = 101;
mainGame->WaitFrameSignal(40);
mainGame->showcard = 0;
......@@ -2014,10 +2017,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int cs = BufferIO::ReadInt8(pbuf);
int cp = BufferIO::ReadInt8(pbuf);
int reason = BufferIO::ReadInt32(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(cl & LOCATION_REMOVED)
mainGame->PlaySoundEffect(SOUND_BANISHED);
else if(reason & REASON_DESTROY && pl != cl)
mainGame->PlaySoundEffect(SOUND_DESTROYED);
}
if (pl == 0) {
ClientCard* pcard = new ClientCard();
pcard->position = cp;
......@@ -2233,12 +2238,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_SET: {
mainGame->PlaySoundEffect(SOUND_SET);
/*int code = */BufferIO::ReadInt32(pbuf);
/*int cc = mainGame->LocalPlayer*/(BufferIO::ReadInt8(pbuf));
/*int cl = */BufferIO::ReadInt8(pbuf);
/*int cs = */BufferIO::ReadInt8(pbuf);
/*int cp = */BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
mainGame->PlaySoundEffect(SOUND_SET);
myswprintf(event_string, dataManager.GetSysString(1601));
return true;
}
......@@ -2286,13 +2292,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_SUMMONING: {
mainGame->PlaySoundEffect(SOUND_SUMMON);
unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf);
/*int cc = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
/*int cl = */BufferIO::ReadInt8(pbuf);
/*int cs = */BufferIO::ReadInt8(pbuf);
/*int cp = */BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->PlaySoundEffect(SOUND_SUMMON);
myswprintf(event_string, dataManager.GetSysString(1603), dataManager.GetName(code));
mainGame->showcardcode = code;
mainGame->showcarddif = 0;
......@@ -2309,13 +2315,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_SPSUMMONING: {
mainGame->PlaySoundEffect(SOUND_SPECIAL_SUMMON);
unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf);
/*int cc = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
/*int cl = */BufferIO::ReadInt8(pbuf);
/*int cs = */BufferIO::ReadInt8(pbuf);
/*int cp = */BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->PlaySoundEffect(SOUND_SPECIAL_SUMMON);
myswprintf(event_string, dataManager.GetSysString(1605), dataManager.GetName(code));
mainGame->showcardcode = code;
mainGame->showcarddif = 1;
......@@ -2331,7 +2337,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_FLIPSUMMONING: {
mainGame->PlaySoundEffect(SOUND_FILP);
unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf);
int cc = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int cl = BufferIO::ReadInt8(pbuf);
......@@ -2341,6 +2346,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->SetCode(code);
pcard->position = cp;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->PlaySoundEffect(SOUND_FILP);
myswprintf(event_string, dataManager.GetSysString(1607), dataManager.GetName(code));
mainGame->dField.MoveCard(pcard, 10);
mainGame->WaitFrameSignal(11);
......@@ -2359,7 +2365,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_CHAINING: {
mainGame->PlaySoundEffect(SOUND_ACTIVATE);
unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf);
int pcc = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int pcl = BufferIO::ReadInt8(pbuf);
......@@ -2372,6 +2377,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int ct = */BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->PlaySoundEffect(SOUND_ACTIVATE);
ClientCard* pcard = mainGame->dField.GetCard(pcc, pcl, pcs, subs);
if(pcard->code != code) {
pcard->code = code;
......@@ -2557,7 +2563,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_DAMAGE: {
mainGame->PlaySoundEffect(SOUND_DAMAGE);
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int val = BufferIO::ReadInt32(pbuf);
int final = mainGame->dInfo.lp[player] - val;
......@@ -2568,6 +2573,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true;
}
mainGame->PlaySoundEffect(SOUND_DAMAGE);
mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10;
if (player == 0)
myswprintf(event_string, dataManager.GetSysString(1613), val);
......@@ -2588,7 +2594,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_RECOVER: {
mainGame->PlaySoundEffect(SOUND_RECOVER);
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int val = BufferIO::ReadInt32(pbuf);
int final = mainGame->dInfo.lp[player] + val;
......@@ -2597,6 +2602,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true;
}
mainGame->PlaySoundEffect(SOUND_RECOVER);
mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10;
if (player == 0)
myswprintf(event_string, dataManager.GetSysString(1615), val);
......@@ -2617,7 +2623,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_EQUIP: {
mainGame->PlaySoundEffect(SOUND_EQUIP);
int c1 = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int l1 = BufferIO::ReadInt8(pbuf);
int s1 = BufferIO::ReadInt8(pbuf);
......@@ -2634,6 +2639,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc1->equipTarget = pc2;
pc2->equipped.insert(pc1);
} else {
mainGame->PlaySoundEffect(SOUND_EQUIP);
mainGame->gMutex.Lock();
if(pc1->equipTarget) {
pc1->is_showequip = false;
......@@ -2742,7 +2748,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
break;
}
case MSG_PAY_LPCOST: {
mainGame->PlaySoundEffect(SOUND_DAMAGE);
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int cost = BufferIO::ReadInt32(pbuf);
int final = mainGame->dInfo.lp[player] - cost;
......@@ -2753,6 +2758,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true;
}
mainGame->PlaySoundEffect(SOUND_DAMAGE);
mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10;
mainGame->lpccolor = 0xff0000ff;
mainGame->lpplayer = player;
......@@ -2769,7 +2775,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_ADD_COUNTER: {
mainGame->PlaySoundEffect(SOUND_COUNTER_ADD);
int type = BufferIO::ReadInt16(pbuf);
int c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int l = BufferIO::ReadInt8(pbuf);
......@@ -2781,6 +2786,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else pc->counters[type] = count;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->PlaySoundEffect(SOUND_COUNTER_ADD);
myswprintf(textBuffer, dataManager.GetSysString(1617), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type));
pc->is_highlighting = true;
mainGame->gMutex.Lock();
......@@ -2792,7 +2798,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_REMOVE_COUNTER: {
mainGame->PlaySoundEffect(SOUND_COUNTER_REMOVE);
int type = BufferIO::ReadInt16(pbuf);
int c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int l = BufferIO::ReadInt8(pbuf);
......@@ -2804,6 +2809,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc->counters.erase(type);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->PlaySoundEffect(SOUND_COUNTER_REMOVE);
myswprintf(textBuffer, dataManager.GetSysString(1618), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type));
pc->is_highlighting = true;
mainGame->gMutex.Lock();
......@@ -2824,14 +2830,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int ld = BufferIO::ReadInt8(pbuf);
int sd = BufferIO::ReadInt8(pbuf);
BufferIO::ReadInt8(pbuf);
if(ld != 0)
mainGame->PlaySoundEffect(SOUND_ATTACK);
else
mainGame->PlaySoundEffect(SOUND_DIRECT_ATTACK);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
float sy;
if (ld != 0) {
mainGame->PlaySoundEffect(SOUND_ATTACK);
mainGame->dField.attack_target = mainGame->dField.GetCard(cd, ld, sd);
myswprintf(event_string, dataManager.GetSysString(1619), dataManager.GetName(mainGame->dField.attacker->code),
dataManager.GetName(mainGame->dField.attack_target->code));
......@@ -2846,6 +2849,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else
mainGame->atk_r = vector3df(0, 0, 3.1415926 - atan((xd - xa) / (yd - ya)));
} else {
mainGame->PlaySoundEffect(SOUND_DIRECT_ATTACK);
myswprintf(event_string, dataManager.GetSysString(1620), dataManager.GetName(mainGame->dField.attacker->code));
float xa = mainGame->dField.attacker->curPos.X;
float ya = mainGame->dField.attacker->curPos.Y;
......@@ -2927,7 +2931,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_TOSS_COIN: {
mainGame->PlaySoundEffect(SOUND_COIN);
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int count = BufferIO::ReadInt8(pbuf);
wchar_t* pwbuf = textBuffer;
......@@ -2941,6 +2944,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*pwbuf = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->PlaySoundEffect(SOUND_COIN);
mainGame->gMutex.Lock();
mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(0);
......@@ -2951,7 +2955,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true;
}
case MSG_TOSS_DICE: {
mainGame->PlaySoundEffect(SOUND_DICE);
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int count = BufferIO::ReadInt8(pbuf);
wchar_t* pwbuf = textBuffer;
......@@ -2965,6 +2968,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*pwbuf = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true;
mainGame->PlaySoundEffect(SOUND_DICE);
mainGame->gMutex.Lock();
mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(0);
......
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