comparison mm7_5.cpp @ 1396:e6908823897f

Research on #62
author Nomad
date Thu, 18 Jul 2013 17:29:20 +0200
parents 28f87f5234a1
children eb02a65e5c82
comparison
equal deleted inserted replaced
1395:8d4ec56416ef 1396:e6908823897f
1243 } 1243 }
1244 break; 1244 break;
1245 case SCREEN_REST://close rest screen 1245 case SCREEN_REST://close rest screen
1246 if ( dword_506F14 ) 1246 if ( dword_506F14 )
1247 { 1247 {
1248 Rest(_506F18_num_hours_to_sleep); 1248 Rest(_506F18_num_minutes_to_sleep);
1249 pParty->pPlayers[3].pConditions[2] = 0i64; 1249 pParty->pPlayers[3].pConditions[2] = 0i64;
1250 pParty->pPlayers[2].pConditions[2] = 0i64; 1250 pParty->pPlayers[2].pConditions[2] = 0i64;
1251 pParty->pPlayers[1].pConditions[2] = 0i64; 1251 pParty->pPlayers[1].pConditions[2] = 0i64;
1252 pParty->pPlayers[0].pConditions[2] = 0i64; 1252 pParty->pPlayers[0].pConditions[2] = 0i64;
1253 } 1253 }
1255 pTexture_RestUI_CurrentHourglassFrame->Release(); 1255 pTexture_RestUI_CurrentHourglassFrame->Release();
1256 pTexture_RestUI_CurrentHourglassFrame = 0; 1256 pTexture_RestUI_CurrentHourglassFrame = 0;
1257 pTexture_RestUI_CurrentSkyFrame = 0; 1257 pTexture_RestUI_CurrentSkyFrame = 0;
1258 pIcons_LOD->SyncLoadedFilesCount(); 1258 pIcons_LOD->SyncLoadedFilesCount();
1259 pIcons_LOD->_4114F2(); 1259 pIcons_LOD->_4114F2();
1260 _506F18_num_hours_to_sleep = 0; 1260 _506F18_num_minutes_to_sleep = 0;
1261 dword_506F14 = 0; 1261 dword_506F14 = 0;
1262 dword_507B94 = 1; 1262 dword_507B94 = 1;
1263 if ( pGUIWindow_Settings ) 1263 if ( pGUIWindow_Settings )
1264 { 1264 {
1265 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1265 if ( pCurrentScreen == SCREEN_CHARACTERS )
2461 continue; 2461 continue;
2462 } 2462 }
2463 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2, 2463 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2,
2464 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" 2464 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
2465 dword_506F14 = 1; 2465 dword_506F14 = 1;
2466 _506F18_num_hours_to_sleep = 5; 2466 _506F18_num_minutes_to_sleep = 5;
2467 continue; 2467 continue;
2468 case UIMSG_Wait1Hour: 2468 case UIMSG_Wait1Hour:
2469 if ( dword_506F14 == 2 ) 2469 if ( dword_506F14 == 2 )
2470 { 2470 {
2471 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" 2471 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
2473 continue; 2473 continue;
2474 } 2474 }
2475 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2, 2475 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2,
2476 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" 2476 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
2477 dword_506F14 = 1; 2477 dword_506F14 = 1;
2478 _506F18_num_hours_to_sleep = 60; 2478 _506F18_num_minutes_to_sleep = 60;
2479 continue; 2479 continue;
2480 case UIMSG_RentRoom: 2480 case UIMSG_RentRoom:
2481 dword_506F14 = 2; 2481 dword_506F14 = 2;
2482 RestUI_Load(); 2482 RestUI_Load();
2483 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute; 2483 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute;
2484 _506F18_num_hours_to_sleep = v86; 2484 _506F18_num_minutes_to_sleep = v86;
2485 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) 2485 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) // 107 = Emerald Isle tavern
2486 _506F18_num_hours_to_sleep = v86 + 720; 2486 _506F18_num_minutes_to_sleep = v86 + 12 * 60;
2487 dword_506F14 = 2; 2487 dword_506F14 = 2;
2488 pParty->RestAndHeal(); 2488 pParty->RestAndHeal();
2489 pParty->days_played_without_rest = 0; 2489 pParty->days_played_without_rest = 0;
2490 pParty->pPlayers[3].SetAsleep(1); 2490 pParty->pPlayers[3].SetAsleep(1);
2491 pParty->pPlayers[2].SetAsleep(1); 2491 pParty->pPlayers[2].SetAsleep(1);
2575 pPlayerNum = rand() % 4; 2575 pPlayerNum = rand() % 4;
2576 LODWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; 2576 LODWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0;
2577 HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; 2577 HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0;
2578 v95 = rand(); 2578 v95 = rand();
2579 Rest(v95 % 6 + 60); 2579 Rest(v95 % 6 + 60);
2580 _506F18_num_hours_to_sleep = 0; 2580 _506F18_num_minutes_to_sleep = 0;
2581 dword_506F14 = 0; 2581 dword_506F14 = 0;
2582 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 2582 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
2583 { 2583 {
2584 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; 2584 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
2585 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 2585 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
2591 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0); 2591 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0);
2592 continue; 2592 continue;
2593 } 2593 }
2594 } 2594 }
2595 Party::TakeFood(uRestUI_FoodRequiredToRest); 2595 Party::TakeFood(uRestUI_FoodRequiredToRest);
2596 _506F18_num_hours_to_sleep = 480; 2596 _506F18_num_minutes_to_sleep = 480;
2597 dword_506F14 = 2; 2597 dword_506F14 = 2;
2598 pParty->RestAndHeal(); 2598 pParty->RestAndHeal();
2599 pParty->days_played_without_rest = 0; 2599 pParty->days_played_without_rest = 0;
2600 pParty->pPlayers[3].SetAsleep(1); 2600 pParty->pPlayers[3].SetAsleep(1);
2601 pParty->pPlayers[2].SetAsleep(1); 2601 pParty->pPlayers[2].SetAsleep(1);
2612 } 2612 }
2613 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2, 2613 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2,
2614 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" 2614 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
2615 v97 = _494820_training_time(pParty->uCurrentHour); 2615 v97 = _494820_training_time(pParty->uCurrentHour);
2616 dword_506F14 = 1; 2616 dword_506F14 = 1;
2617 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; 2617 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute;
2618 continue; 2618 continue;
2619 case UIMSG_HintSelectRemoveQuickSpellBtn: 2619 case UIMSG_HintSelectRemoveQuickSpellBtn:
2620 if ( quick_spell_at_page && byte_506550 ) 2620 if ( quick_spell_at_page && byte_506550 )
2621 { 2621 {
2622 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; 2622 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName;