Commit ce61b797 authored by mercury233's avatar mercury233

update

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