From 19a0234c74f66cbc17702276b39214331ffbd28e Mon Sep 17 00:00:00 2001 From: jummy Date: Sat, 31 Aug 2024 23:22:24 -0500 Subject: [PATCH] yeah --- Speedy Eggbert 2 Source.vcxproj | 19 +- Speedy Eggbert 2 Source.vcxproj.filters | 33 +- Speedy Eggbert 2 Source.vcxproj.user | 12 - resource/Eggbert2.rc | Bin 15090 -> 15386 bytes resource/cursor1.cur | Bin 0 -> 326 bytes src/action.h | 16 - src/actions.h | 14 - src/blupi.cpp | 690 +- src/button.cpp | 2 +- src/button.h | 8 +- src/decblock.cpp | 781 ++ src/decblupi.cpp | 4209 ++++++++- src/decdesign.cpp | 655 ++ src/decio.cpp | 49 + src/decmove.cpp | 2213 +++++ src/decmove.h | 4 - src/decnet.cpp | 197 + src/decor.cpp | 10161 +++------------------ src/decor.h | 1284 +-- src/dectables.cpp | 21 - src/dectables.h | 10518 ++-------------------- src/def.h | 1602 +++- src/event.cpp | 1387 +-- src/event.h | 59 +- src/fifo.h | 33 - src/jauge.cpp | 4 +- src/jauge.h | 16 +- src/menu.h | 5 +- src/misc.h | 7 +- src/movie.cpp | 8 +- src/movie.h | 4 +- src/network.cpp | 2 +- src/network.h | 22 - src/obstacle.h | 589 ++ src/pixmap.cpp | 134 +- src/pixmap.h | 10 +- src/resource.h | 2 +- src/sound.cpp | 458 +- src/sound.h | 115 +- src/text.cpp | 69 +- src/text.h | 2 +- 41 files changed, 13286 insertions(+), 22128 deletions(-) delete mode 100644 Speedy Eggbert 2 Source.vcxproj.user create mode 100644 resource/cursor1.cur delete mode 100644 src/action.h delete mode 100644 src/actions.h create mode 100644 src/decblock.cpp create mode 100644 src/decdesign.cpp create mode 100644 src/decio.cpp create mode 100644 src/decmove.cpp delete mode 100644 src/decmove.h create mode 100644 src/decnet.cpp delete mode 100644 src/dectables.cpp delete mode 100644 src/fifo.h create mode 100644 src/obstacle.h diff --git a/Speedy Eggbert 2 Source.vcxproj b/Speedy Eggbert 2 Source.vcxproj index d5bbafa..8c66b5a 100644 --- a/Speedy Eggbert 2 Source.vcxproj +++ b/Speedy Eggbert 2 Source.vcxproj @@ -74,9 +74,11 @@ Level3 false - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true dxsdk3\sdk\inc + UNICODE;_UNICODE + Windows @@ -84,6 +86,7 @@ /FORCE:MULTIPLE /DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE dxsdk3\sdk\lib;%(AdditionalLibraryDirectories) false + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -95,6 +98,7 @@ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true dxsdk3\sdk\inc + UNICODE;_UNICODE Console @@ -111,6 +115,7 @@ _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true dxsdk3\sdk\inc + UNICODE;_UNICODE Console @@ -127,6 +132,7 @@ NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true dxsdk3\sdk\inc + UNICODE;_UNICODE Console @@ -157,9 +163,13 @@ + + + + + - @@ -172,21 +182,18 @@ - - - - + diff --git a/Speedy Eggbert 2 Source.vcxproj.filters b/Speedy Eggbert 2 Source.vcxproj.filters index 51edba5..6758e97 100644 --- a/Speedy Eggbert 2 Source.vcxproj.filters +++ b/Speedy Eggbert 2 Source.vcxproj.filters @@ -80,9 +80,6 @@ Source Files - - Source Files - Source Files @@ -113,6 +110,21 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -121,9 +133,6 @@ Source Files - - Source Files - Source Files @@ -136,9 +145,6 @@ Source Files - - Source Files - Source Files @@ -169,18 +175,15 @@ Source Files - - Source Files - - - Source Files - Source Files Source Files + + Source Files + diff --git a/Speedy Eggbert 2 Source.vcxproj.user b/Speedy Eggbert 2 Source.vcxproj.user deleted file mode 100644 index 644d638..0000000 --- a/Speedy Eggbert 2 Source.vcxproj.user +++ /dev/null @@ -1,12 +0,0 @@ - - - - WindowsLocalDebugger - KAYLABARKS-PC:4027 - NativeOnly - C:\BlupiDebug\Debug - true - C:\BlupiDebug\Debug\Speedy Eggbert 2 Source.exe - C:\BlupiDebug\Debug - - \ No newline at end of file diff --git a/resource/Eggbert2.rc b/resource/Eggbert2.rc index 1c3a64ec930ed96ad9a1a795a0526c37958ef786..5b40d06fe68c8c71497d98e9b87cc901ed94aa06 100644 GIT binary patch delta 200 zcmexVI;&zr8+$QB5koSA{$xfr@r`r-u}^FhVAP*HlcO2JSjZ_nS&y>>#_5DHL?_#E zl_5AM5FFvj0o-sI;mJ3UISD*SGB0>4UMDzJtA&k#_P`8xwcY{SX P|L0d{g0NJD&T0SvjDOplh?3pc>O=KjAYP0L~&SQ~&?~ diff --git a/resource/cursor1.cur b/resource/cursor1.cur new file mode 100644 index 0000000000000000000000000000000000000000..aa9f335f706cb06bd03bf3c854da0e47910f2847 GIT binary patch literal 326 zcmbV`Ar1mD6hx;~tOJK4X(bYg+dT?L;0E+)Jp~$%AwjT$WO%JXtb+M@Kl4X)DyOkmA;qD_A>l6iA8!2#G$2H`Hnt27*?HSg{Kt23OSi9h_W eGSZf4`qJ)qXY{Pm4_$ntrAE8Z6aec1Ht+#%!FHkm literal 0 HcmV?d00001 diff --git a/src/action.h b/src/action.h deleted file mode 100644 index 4227fcf..0000000 --- a/src/action.h +++ /dev/null @@ -1,16 +0,0 @@ - - -extern -BOOL Action(short action, short direct, - short &phase, short &step, - short &channel, short &icon, POINT &pos, short &posZ, - short &sound); - -extern -BOOL Rotate (short &icon, short direct); - -extern -int GetIconDirect(short icon); - -extern -int GetAmplitude(short action); diff --git a/src/actions.h b/src/actions.h deleted file mode 100644 index f877bfa..0000000 --- a/src/actions.h +++ /dev/null @@ -1,14 +0,0 @@ -#define OPTERM 0 -#define OPLIST 1 -#define OPREPEAT 2 -#define OPSOUND 3 - -typedef enum -{ - obj_squaretech0, - obj_squaretech1, - obj_squaretech2, - obj_triangulartech_left0, - -} -Object; \ No newline at end of file diff --git a/src/blupi.cpp b/src/blupi.cpp index f55152a..5eaa863 100644 --- a/src/blupi.cpp +++ b/src/blupi.cpp @@ -7,8 +7,6 @@ #pragma comment(lib, "winmm.lib") -using namespace std; - #include #include #include @@ -16,7 +14,7 @@ using namespace std; #include #include #include -#include +// #include #include #include "def.h" #include "resource.h" @@ -37,50 +35,52 @@ using namespace std; // Define Globals #define NAME "Blupi" +#ifdef _EGAMES #define TITLE "Eggbert" +#else +#define TITLE "Blupi" +#endif + #define MMTIMER TRUE #define THREAD FALSE // Variables Globals -HWND g_hWnd; // handle � la fen�tre -CEvent* g_pEvent = NULL; +HWND g_hWnd; // handle à la fenètre +CEvent* g_pEvent = NULL; CPixmap* g_pPixmap = NULL; // pixmap principal -CSound* g_pSound = NULL; // sound principal -CMovie* g_pMovie = NULL; // movie principal -CDecor* g_pDecor = NULL; +CSound* g_pSound = NULL; // sound principal +CMovie* g_pMovie = NULL; // movie principal +CDecor* g_pDecor = NULL; CNetwork* g_pNetwork; -char g_CDPath[MAX_PATH]; // chemin d'acc�s au CD-Rom +char g_CDPath[MAX_PATH]; // chemin d'accès au CD-Rom BOOL g_bFullScreen = FALSE; // FALSE si mode de test int g_speedRate = 1; int g_timerInterval = 50; // inverval = 50ms int g_mouseType = MOUSETYPEGRA; int g_benchmark; BOOL g_bBenchmarkSuccess; -BOOL g_bTrueColor; BOOL g_bTrueColorBack; BOOL g_bTrueColorDecor; -MMRESULT g_updateTimer; // timer g�n�ral +BOOL g_bCDAudio; +int g_something; +MMRESULT g_updateTimer; // timer général BOOL g_bActive = TRUE; // is application active ? BOOL g_bTermInit = FALSE; // initialisation en cours -int g_bTimer; -int g_nbTimer; -HANDLE g_hScreenMutex; -HANDLE g_hRunMutex; -HANDLE g_threadNr; -HANDLE g_hThread; -LPDWORD* g_threadID; -int g_objectMax; -int g_elementMax; -int g_blupiMax; -int g_exploMax; -short g_object[6]; -short g_element[6]; -short g_blupiCh[6]; -short g_explo[6]; +int g_timer; +int g_nbIconPackObject; +int g_nbIconPackElement; +int g_nbIconPackBlupi; +int g_nbIconPackExplo; +IconPack g_iconPackObject[]; +IconPack g_iconPackElement[]; +IconPack g_iconPackBlupi[]; +IconPack g_iconPackExplo[]; UINT g_lastPhase = 999; +// Lit un numéro décimal. + int GetNum(char *p) { int n = 0; @@ -94,56 +94,56 @@ int GetNum(char *p) return n; } -BOOL ReadConfig (LPSTR lpCmdLine) +BOOL ReadConfig(LPSTR lpCmdLine) { - FILE* file = NULL; - char buffer[200]; - char* pText; - int nb; + FILE* file = NULL; + char buffer[200]; + char* pText; + int nb; int i; - _MEMORYSTATUS memstatus; + MEMORYSTATUS mem; - file = fopen("data\\config.def", "rb"); - if ( file == NULL ) return FALSE; - nb = fread(buffer, sizeof(char), 200-1, file); - buffer[nb] = 0; - fclose(file); + file = fopen("data\\config.def", "rb"); + if (file == NULL) return FALSE; + nb = fread(buffer, sizeof(char), 200 - 1, file); + buffer[nb] = 0; + fclose(file); -#if 0 - pText = strstr(buffer, "CD-Rom="); - if ( pText == NULL ) - { +#if _CD + pText = strstr(buffer, "CD-Rom="); + if (pText == NULL) + { #if _DEMO - GetCurrentDirectory(MAX_PATH, g_CDPath); - i = strlen (g_CDPath); - if ( i > 0 && g_CDPath [i-1] != '\\' ) - { - g_CDPath[i++] = '\\'; - g_CDPath[i] = 0; - } + GetCurrentDirectory(MAX_PATH, g_CDPath); + i = strlen(g_CDPath); + if (i > 0 && g_CDPath[i - 1] != '\\') + { + g_CDPath[i++] = '\\'; + g_CDPath[i] = 0; + } #else - return FALSE; -#endif + return FALSE; +#endif // _DEMO } else { pText += 7; i = 0; - while ( pText[i] != 0 && pText[i] != '\n' && pText[i] != '\r' ) + while (pText[i] != 0 && pText[i] != '\n' && pText[i] != '\r') { g_CDPath[i] = pText[i]; - i ++; + i++; } - if ( i > 0 && g_CDPath[i-1] != '\\' ) + if (i > 0 && g_CDPath[i - 1] != '\\') { g_CDPath[i++] = '\\'; } g_CDPath[i] = 0; // met le terminateur } -#if !_DEMO & !_EGAMES - if ( strstr(lpCmdLine, "-nocd") == NULL ) +#if !_DEMO && !_EGAMES + if (strstr(lpCmdLine, "-nocd") == NULL) { char drive[10]; @@ -152,200 +152,192 @@ BOOL ReadConfig (LPSTR lpCmdLine) drive[2] = '\\'; drive[3] = 0; nb = GetDriveType(drive); - if ( nb != DRIVE_CDROM ) return FALSE; + if (nb != DRIVE_CDROM) return FALSE; } -#endif -#endif +#endif // !_DEMO && !_EGAMES +#endif // _CD pText = strstr(buffer, "SpeedRate="); - if ( pText != NULL ) + if (pText != NULL) { - g_speedRate = GetNum(pText+10); - if ( g_speedRate < 1 ) g_speedRate = 1; - if ( g_speedRate > 2 ) g_speedRate = 2; + g_speedRate = GetNum(pText + 10); + if (g_speedRate < 1) g_speedRate = 1; + if (g_speedRate > 2) g_speedRate = 2; } pText = strstr(buffer, "Timer="); - if ( pText != NULL ) + if (pText != NULL) { - g_timerInterval = GetNum(pText+6); - if ( g_timerInterval < 10 ) g_timerInterval = 10; - if ( g_timerInterval > 1000 ) g_timerInterval = 1000; + g_timerInterval = GetNum(pText + 6); + if (g_timerInterval < 10) g_timerInterval = 10; + if (g_timerInterval > 1000) g_timerInterval = 1000; } pText = strstr(buffer, "FullScreen="); - if ( pText != NULL ) + if (pText != NULL) { - g_bFullScreen = GetNum(pText+11); - if ( g_bFullScreen != 0 ) g_bFullScreen = 1; + g_bFullScreen = GetNum(pText + 11); + if (g_bFullScreen != 0) g_bFullScreen = 1; } pText = strstr(buffer, "MouseType="); - if ( pText != NULL ) + if (pText != NULL) { - g_mouseType = GetNum(pText+10); - if ( g_mouseType < 1 ) g_mouseType = 1; - if ( g_mouseType > 9 ) g_mouseType = 9; + g_mouseType = GetNum(pText + 10); + if (g_mouseType < 1) g_mouseType = 1; + if (g_mouseType > 9) g_mouseType = 9; } pText = strstr(buffer, "Benchmark="); - if ( pText != NULL ) + if (pText != NULL) { - g_benchmark = GetNum(pText+10); - if ( g_benchmark < 0 ) g_benchmark = 0; - if ( g_benchmark > 100000 ) g_benchmark = 100000; - if ( g_benchmark > 3099 ) g_bBenchmarkSuccess = 1, g_bTrueColor = 1, g_bTrueColorDecor; + g_benchmark = GetNum(pText + 10); + if (g_benchmark < 0) g_benchmark = 0; + if (g_benchmark > 100000) g_benchmark = 100000; + if (g_benchmark > 3099) + { + g_bBenchmarkSuccess = TRUE; + g_bTrueColorBack = TRUE; + g_bTrueColorDecor = TRUE; + } } pText = strstr(buffer, "TrueColor="); - if ( pText != NULL ) + if (pText != NULL) { i = GetNum(pText + 10); - if (i == 8) g_bTrueColor = FALSE; - if (i == 16) g_bTrueColor = TRUE; - g_bTrueColorDecor = g_bTrueColor; + if (i == 8) g_bTrueColorBack = FALSE; + if (i == 16) g_bTrueColorBack = TRUE; + g_bTrueColorDecor = g_bTrueColorBack; } pText = strstr(buffer, "TrueColorBack="); - if ( pText != NULL ) + if (pText != NULL) { - i = GetNum(pText+14); - if (i == 8) g_bTrueColor = FALSE; - - if (i == 16) g_bTrueColor = TRUE; + i = GetNum(pText + 14); + if (i == 8) g_bTrueColorBack = FALSE; + if (i == 16) g_bTrueColorBack = TRUE; } pText = strstr(buffer, "TrueColorDecor="); - if ( pText != NULL ) + if (pText != NULL) { i = GetNum(pText + 15); if (i == 8) g_bTrueColorDecor = FALSE; - if (i == 16) g_bTrueColorDecor = TRUE; } - memstatus.dwLength = 32; - GlobalMemoryStatus(&memstatus); - if (memstatus.dwTotalPhys < 32000000) + pText = strstr(buffer, "CDAudio="); + if (pText != NULL) { - g_bBenchmarkSuccess = FALSE; + i = GetNum(pText + 8); + g_bCDAudio = (i == TRUE); } - if (g_bBenchmarkSuccess == FALSE) + + mem.dwLength = sizeof(MEMORYSTATUS); + GlobalMemoryStatus(&mem); + + if (mem.dwTotalPhys < 32000000) g_bBenchmarkSuccess = FALSE; + + if (!g_bBenchmarkSuccess) { g_bTrueColorBack = FALSE; g_bTrueColorDecor = FALSE; } + return TRUE; } -// Rewrite Variables - void UpdateFrame(void) { - RECT clip, rcRect; - UINT phase; - BOOL type; - POINT posMouse; - int i, term, speed, targetlevel; + int phase, term; g_pEvent->ReadInput(); phase = g_pEvent->GetPhase(); - - if (phase == g_lastPhase && - phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD) + if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD) { - type = g_pDecor->GetPause(); - if (type == FALSE) + if (!g_pDecor->GetPause()) { - speed = g_pEvent->GetSpeed(); - term = 0; - speed = speed * g_speedRate; - if (0 < speed) + for (int i = 0; i < g_pEvent->GetSpeed() * g_speedRate; i++) { - do { - g_pDecor->MoveStep(); - g_pEvent->DemoStep(); - term++; - } while (term < speed); + g_pDecor->MoveStep(); + g_pEvent->DemoStep(); } } + } - if (phase == WM_PHASE_INIT) - { - g_pEvent->DemoStep(); // d�marre �v. d�mo automatique - } + if (phase == WM_PHASE_INIT) + { + g_pEvent->DemoStep(); // d?marre ?v. d?mo automatique + } - if (phase == WM_PHASE_PLAYMOVIE || phase == WM_PHASE_WINMOVIE || phase == WM_PHASE_WINMOVIEDESIGN || phase == WM_PHASE_WINMOVIEMULTI) - { - g_pEvent->MovieToStart(); - } + if (phase == WM_PHASE_PLAYMOVIE || phase == WM_PHASE_WINMOVIE || WM_PHASE_WINMOVIEDESIGN || WM_PHASE_WINMOVIEMULTI) + { + g_pEvent->MovieToStart(); + } - if (phase == WM_PHASE_INSERT) - { - g_pEvent->TryInsert(); - } + if (phase == WM_PHASE_INSERT) + { + g_pEvent->TryInsert(); + } - if (phase == WM_PHASE_PLAY) + if (phase == WM_PHASE_PLAY) + { + if (g_pEvent->IsPrivate() == FALSE) { - if (g_pEvent->IsPrivate() == FALSE) + if (g_pEvent->IsMulti() == FALSE) { - if (g_pEvent->IsMulti() == FALSE) + if (g_pDecor->IsTerminated() == -1) { - if (g_pDecor->IsTerminated() == -1) - { - g_pEvent->GetWorldGroup(); - g_pEvent->SetLives(g_pDecor->GetNbVies()); - g_pEvent->ChangePhase(WM_PHASE_LOST); - } - if (g_pDecor->IsTerminated() == -2) - { - g_pEvent->SetLives(g_pDecor->GetNbVies()); - g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); - } - if (0 < g_pDecor->IsTerminated()) - { - g_pEvent->SetLives(g_pDecor->GetNbVies()); - g_pEvent->SetMission(g_pDecor->IsTerminated()); - g_pEvent->ChangePhase(WM_PHASE_PLAY); - } + g_pEvent->GetWorldGroup(); + g_pEvent->SetLives(g_pDecor->GetNbVies()); + g_pEvent->ChangePhase(WM_PHASE_LOST); } - else + if (g_pDecor->IsTerminated() == -2) { - if (g_pDecor->IsTerminated() == -1) - { - g_pEvent->ChangePhase(WM_PHASE_WINm); - return; - } - if (g_pDecor->IsTerminated() != 0) - { - g_pEvent->ChangePhase(WM_PHASE_WINMOVIEm); - return; - } + g_pEvent->SetLives(g_pDecor->GetNbVies()); + g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); + } + if (0 < g_pDecor->IsTerminated()) + { + g_pEvent->SetLives(g_pDecor->GetNbVies()); + g_pEvent->SetMission(g_pDecor->IsTerminated()); + g_pEvent->ChangePhase(WM_PHASE_PLAY); } } else { if (g_pDecor->IsTerminated() == -1) { - g_pEvent->ChangePhase(WM_PHASE_LOSTd); + g_pEvent->ChangePhase(WM_PHASE_WINMULTI); return; } if (g_pDecor->IsTerminated() != 0) { - g_pEvent->ChangePhase(WM_PHASE_WINMOVIEd); + g_pEvent->ChangePhase(WM_PHASE_WINMOVIEMULTI); return; } } } + else + { + if (g_pDecor->IsTerminated() == -1) + { + g_pEvent->ChangePhase(WM_PHASE_LOSTDESIGN); + return; + } + if (g_pDecor->IsTerminated() != 0) + { + g_pEvent->ChangePhase(WM_PHASE_WINMOVIEDESIGN); + return; + } + } } - return; } - - // Incomplete -void SetDecor() +void SetDecor(void) { RECT rect; UINT phase; @@ -353,46 +345,46 @@ void SetDecor() char test[12]; g_pPixmap->MouseBackClear(); - g_pEvent->GetLastMousePos(); + posMouse = g_pEvent->GetLastMousePos(); + phase = g_pEvent->GetPhase(); + rect = { 0, 0, LXIMAGE, LYIMAGE }; + if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD) { - rect.top = 0; - rect.left = 0; - rect.bottom = LYIMAGE; - rect.right = LXIMAGE; g_pDecor->Build(rect); } - else - { - rect.top = 0; - rect.left = 0; - rect.bottom = LYIMAGE; - rect.right = LXIMAGE; - g_pPixmap->DrawImage(-1, CHBACK, rect, 1); + else { + g_pPixmap->DrawImage(-1, 0, rect, 1); } + g_pEvent->DrawButtons(); g_lastPhase = phase; g_pPixmap->MouseBackDraw(); - return; } +// Restitue le jeu après une activation en mode fullScreen. + BOOL RestoreGame() { - if ( g_pPixmap == NULL ) return FALSE; + if (g_pPixmap == NULL) return FALSE; g_pEvent->RestoreGame(); return g_pPixmap->Restore(); } +// Libère le jeu avant une désactivation en mode fullScreen. + BOOL FlushGame() { - if ( g_pPixmap == NULL ) return FALSE; + if (g_pPixmap == NULL) return FALSE; return g_pPixmap->Flush(); } +// Finished with all objects we use; release them. + static void FinishObjects(void) { if ( g_pMovie != NULL ) @@ -436,167 +428,185 @@ static void FinishObjects(void) } } -LRESULT CALLBACK WindowProc (HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, + WPARAM wParam, LPARAM lParam) { static HINSTANCE hInstance; POINT mousePos, totalDim, iconDim; - if ( message == WM_SYSKEYDOWN && wParam == VK_F10 ) + // La touche F10 envoie un autre message pour activer + // le menu dans les applications Windows standard ! + //[The F10 key sends another message to activate the menu in standard Windows apps!] + if (message == WM_SYSKEYDOWN && wParam == VK_F10) { message = WM_KEYDOWN; } - if ( message == WM_SYSKEYUP && wParam == VK_F10 ) + if (message == WM_SYSKEYUP && wParam == VK_F10) { message = WM_KEYUP; } - if ( g_pEvent != NULL && - g_pEvent->TreatEvent(message, wParam, lParam) ) return 0; + if (g_pEvent != NULL && + g_pEvent->TreatEvent(message, wParam, lParam)) return 0; - switch( message ) + switch (message) { - case WM_TIMER: - case WM_SYSCOLORCHANGE: - OutputDebug("Event WM_SYSCOLORCHANGE\n"); - break; - case WM_CREATE: - hInstance = ((LPCREATESTRUCT)lParam)->hInstance; - return 0; - break; - - case WM_ACTIVATEAPP: - g_bActive = (wParam != 0); - if (g_pEvent != NULL) + case WM_TIMER: + case WM_UPDATE: + if (g_pEvent != NULL && !g_pEvent->IsMovie() && !g_pEvent->IsMouseRelease()) // pas de film en cours ? + { + g_pEvent->GetPhase(); // ? + if (g_bActive) { - g_pEvent->FlushInput(); + UpdateFrame(); + SetDecor(); } - if ( g_bActive ) - { - if ( g_bFullScreen ) - { - RestoreGame(); - g_lastPhase = 999; - } - if ( !g_bFullScreen && g_bTermInit ) - { - totalDim.x = 256; - totalDim.y = 96; - iconDim.x = DIMLITTLEX; - iconDim.y = DIMLITTLEY; - g_pPixmap->BackgroundCache(CHLITTLE, "little.blp", totalDim, iconDim, TRUE); - g_pPixmap->SetTransparent(CHLITTLE, RGB(0,0,255)); + g_pPixmap->Display(); + } + if (g_something > 0) g_something--; + break; + case WM_SYSCOLORCHANGE: + OutputDebug("Event WM_SYSCOLORCHANGE\n"); + break; + case WM_CREATE: + hInstance = ((LPCREATESTRUCT)lParam)->hInstance; + return 0; + break; - g_pPixmap->SavePalette(); - g_pPixmap->InitSysPalette(); - } - SetWindowTextA(hWnd, "Blupi"); - if ( g_pSound != NULL ) g_pSound->RestartMusic(); + case WM_ACTIVATEAPP: + g_bActive = (wParam != 0); + if (g_pEvent != NULL) + { + g_pEvent->FlushInput(); + } + if (g_bActive) + { + if (g_bFullScreen) + { + RestoreGame(); + g_lastPhase = 999; + } + if (!g_bFullScreen && g_bTermInit) + { + g_pPixmap->BackgroundCache(CHLITTLE, "little.blp", { 256, 96 }, { DIMLITTLEX , DIMLITTLEY }, TRUE); + g_pPixmap->SetTransparent(CHLITTLE, RGB(0, 0, 255)); // bleu + + g_pPixmap->SavePalette(); + g_pPixmap->InitSysPalette(); + } + SetWindowTextA(hWnd, "Blupi"); + if (g_pSound != NULL) g_pSound->RestartMusic(); + } + else // désactive ? + { + if (g_bFullScreen) + { + FlushGame(); + } + SetWindowTextA(hWnd, "Blupi -- stop"); + if (g_pSound != NULL) g_pSound->SuspendMusic(); + } + return 0; + + case WM_DISPLAYCHANGE: + OutputDebug("Event WM_DISPLAYCHANGE\n"); + break; + + case WM_QUERYNEWPALETTE: + OutputDebug("Event WM_QUERYNEWPALETTE\n"); + break; + + case WM_PALETTECHANGED: + OutputDebug("Event WM_PALLETECHANGED\n"); + break; + + case MM_MCINOTIFY: + OutputDebug("Event MM_MCINOTIFY\n"); + if (g_pEvent->IsMovie()) // film en cours ? + { + if (wParam == MCI_NOTIFY_SUCCESSFUL) + { + g_pEvent->StopMovie(); + } + } + else + { + // music over, play it again + g_pSound->SuspendMusic(); + // if music finished, play it again. Otherwise assume that + // it was aborted by the user or otherwise + if (wParam == MCI_NOTIFY_SUCCESSFUL) + { + OutputDebug("Event MCI_NOTIFY_SUCCESSFUL\n"); + g_pSound->RestartMusic(); } else { - if ( g_bFullScreen ) - { - FlushGame(); - } - SetWindowTextA(hWnd, "Blupi -- stop"); - if ( g_pSound != NULL ) g_pSound->SuspendMusic(); + char s[50]; + sprintf(s, "wParam=%d\n", wParam); + OutputDebug(s); } - return 0; + } + break; - case WM_KEYDOWN: - switch( wParam ) - { - case VK_F5: - g_pEvent->SetSpeed(1); - break; - case VK_F6: - g_pEvent->SetSpeed(2); - break; - case VK_F7: - g_pEvent->SetSpeed(4); - break; - case VK_F8: - g_pEvent->SetSpeed(8); - break; - } - break; + case WM_SETCURSOR: + // ChangeSprite(); + // SetCursor(NULL); // pas de souris visible ! + return TRUE; - case WM_DISPLAYCHANGE: - OutputDebug("Event WM_DISPLAYCHANGE\n"); - break; - case WM_QUERYNEWPALETTE: - OutputDebug("Event WM_QUERYNEWPALETTE\n"); - break; - case WM_PALETTECHANGED: - OutputDebug("Event WM_PALLETECHANGED\n"); - break; - case MM_MCINOTIFY: - OutputDebug("Event MM_MCINOTIFY\n"); - if ( g_pEvent->IsMovie() ) - { - if ( wParam == MCI_NOTIFY_SUCCESSFUL ) - { - g_pEvent->StopMovie(); - } - } - else - { - g_pSound->SuspendMusic(); - if ( wParam == MCI_NOTIFY_SUCCESSFUL ) - { - OutputDebug("Event MCI_NOTIFY_SUCCESSFUL\n"); - g_pSound->RestartMusic(); - } - else - { - char s[50]; - sprintf(s, "wParam=%d\n", wParam); - OutputDebug(s); - } - } - break; + case WM_LBUTTONDOWN: + //? Benchmark(); + GetCursorPos(&mousePos); + ScreenToClient(hWnd, &mousePos); + break; - case WM_LBUTTONDOWN: - GetCursorPos(&mousePos); - ScreenToClient(hWnd, &mousePos); - break; + case WM_RBUTTONDOWN: + break; - case WM_DESTROY: - KillTimer(g_hWnd, 1); - FinishObjects(); - PostQuitMessage(0); + case WM_MOUSEMOVE: + break; + + case WM_KEYDOWN: + switch (wParam) + { + case VK_F5: + g_pEvent->SetSpeed(1); break; - case WM_SETCURSOR: -// ChangeSprite(); -// SetCursor(NULL); - return TRUE; - case WM_UPDATE: - if ( !g_pEvent->IsMovie() ) - { - if ( g_bActive ) - { - UpdateFrame(); - } - g_pPixmap->Display(); - } + case VK_F6: + g_pEvent->SetSpeed(2); break; + case VK_F7: + g_pEvent->SetSpeed(4); + break; + case VK_F8: + g_pEvent->SetSpeed(8); + break; + } + break; + + case WM_DESTROY: + timeKillEvent((UINT)g_hWnd); + FinishObjects(); + PostQuitMessage(0); + break; + } return DefWindowProc(hWnd, message, wParam, lParam); - } LPTIMECALLBACK TimerStep() { - if ((g_bActive != FALSE) && (g_bTimer == 0)) + if (g_bActive && g_timer == 0) { - g_bTimer = 1; - PostAppMessageA(g_hWnd, 1025, 0, 0); + g_timer = 1; + PostMessageA(g_hWnd, WM_UPDATE, 0, 0); } return NULL; } +// Erreur dans DoInit. + BOOL InitFail(const char *msg, BOOL bDirectX) { char buffer[100]; @@ -614,13 +624,13 @@ BOOL InitFail(const char *msg, BOOL bDirectX) int Benchmark() { - struct _timeb tstruct; + struct timeb tstruct; int i, j, t1, t2, time; RECT rect; POINT dest; _MEMORYSTATUS mem; - _ftime(&tstruct); + ftime(&tstruct); t1 = tstruct.millitm; for (j = 0; j < 10; j++) @@ -630,7 +640,7 @@ int Benchmark() g_pPixmap->Display(); } - _ftime(&tstruct); + ftime(&tstruct); t2 = tstruct.millitm; if (t1 > t2) t2 += 1000; @@ -656,22 +666,25 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) RECT rcRect; BOOL bOK; - bOK = ReadConfig(lpCmdLine); + bOK = ReadConfig(lpCmdLine); // lit le fichier config.def InitHInstance(hInstance); + // Set up and register window class. wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; - wc.hIcon = LoadIconA(hInstance, "IDR_MAINFRAME"); - wc.hCursor = LoadCursorA(hInstance, "IDC_POINTER"); + //? wc.hIcon = LoadIcon(hInstance, IDI_APPLICATION); + wc.hIcon = LoadIcon(hInstance, "IDR_MAINFRAME"); + wc.hCursor = LoadCursor(hInstance, "IDC_POINTER"); wc.hbrBackground = GetStockBrush(BLACK_BRUSH); wc.lpszMenuName = NAME; wc.lpszClassName = NAME; RegisterClassA(&wc); + // Create a window. if (g_bFullScreen) { g_hWnd = CreateWindowExA @@ -722,42 +735,34 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) UpdateWindow(g_hWnd); SetFocus(g_hWnd); - ChangeSprite(SPRITE_WAIT); + ChangeSprite(SPRITE_WAIT); // met le sablier maison - ZeroMemory(&g_pPixmap, sizeof(7068)); - - if (!bOK) + if (!bOK) // config.def pas correct ? { return InitFail("Game not correctly installed", FALSE); } - + // Crée le pixmap principal. g_pPixmap = new CPixmap; if (g_pPixmap == NULL) return InitFail("New pixmap", TRUE); totalDim.x = LXIMAGE; totalDim.y = LYIMAGE; - if (!g_pPixmap->Create(g_hWnd, totalDim, g_bFullScreen, g_mouseType, g_bTrueColor, g_bTrueColorDecor)) + if (!g_pPixmap->Create(g_hWnd, totalDim, g_bFullScreen, g_mouseType, g_bTrueColorBack, g_bTrueColorDecor)) return InitFail("Create pixmap", TRUE); - g_pPixmap->SetBenchmarkSuccess(g_bBenchmarkSuccess); OutputDebug("Image: init\n"); totalDim.x = LXIMAGE; totalDim.y = LYIMAGE; iconDim.x = 0; iconDim.y = 0; - if (!g_pPixmap->CacheAll(TRUE, g_hWnd, g_bFullScreen, g_bTrueColor, g_bTrueColorDecor, g_mouseType, "init.blp", 0)) - return InitFail("CacheAll", TRUE); - + if (!g_pPixmap->CacheAll(TRUE, g_hWnd, g_bFullScreen, g_bTrueColorBack, g_bTrueColorDecor, g_mouseType, "init.blp", 0)) + return FALSE; OutputDebug("SavePalette\n"); g_pPixmap->SavePalette(); OutputDebug("InitSysPalette\n"); g_pPixmap->InitSysPalette(); - g_pPixmap->SetTrueColor(TRUE); - g_pPixmap->SetTrueColorDecor(TRUE); - - ZeroMemory(&g_pSound, sizeof(644)); g_pSound = new CSound; if (g_pSound == NULL) return InitFail("New sound", TRUE); @@ -765,52 +770,37 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) g_pSound->Create(g_hWnd); g_pSound->CacheAll(); g_pSound->SetState(TRUE); + g_pSound->SetCDAudio(g_bCDAudio); - ZeroMemory(&g_pMovie, sizeof(164)); + g_pNetwork = new CNetwork; + if (g_pNetwork == NULL) return InitFail("New network", TRUE); g_pMovie = new CMovie; if (g_pMovie == NULL) return InitFail("New movie", FALSE); g_pMovie->Create(); - ZeroMemory(&g_pDecor, sizeof(156448)); - g_pDecor = new CDecor; if (g_pDecor == NULL) return InitFail("New decor", FALSE); g_pDecor->Create(g_hWnd, g_pSound, g_pPixmap, g_pNetwork); - ZeroMemory(&g_pEvent, sizeof(39904)); - g_pEvent = new CEvent; if (g_pEvent == NULL) return InitFail("New event", FALSE); - g_pEvent->Create(hInstance, g_hWnd, g_pPixmap, g_pDecor, g_pSound, g_pMovie, g_pNetwork); + g_pEvent->Create(hInstance, g_hWnd, g_pPixmap, g_pDecor, g_pSound, g_pNetwork, g_pMovie); g_pEvent->SetFullScreen(g_bFullScreen); g_pEvent->SetMouseType(g_mouseType); +#if _INTRO + g_pEvent->ChangePhase(WM_PHASE_INTRO1); +#else g_pEvent->ChangePhase(WM_PHASE_INIT); - - ZeroMemory(&g_pNetwork, sizeof(20)); - - g_pNetwork = new CNetwork; - if (g_pNetwork == NULL) return InitFail("New network", FALSE); - g_pNetwork->CreateProvider(0); +#endif g_bTermInit = TRUE; return TRUE; } -#if MMTIMER -void CALLBACK UpdateTimer_Proc(UINT uIDm, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) -{ - if (g_bActive && g_nbTimer == 0) - { - g_nbTimer++; - PostMessageA(g_hWnd, WM_UPDATE, NULL, NULL); - } -} -#endif - int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { @@ -825,9 +815,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, Benchmark(); #if MMTIMER - g_updateTimer = timeSetEvent(g_timerInterval, g_timerInterval / 4, UpdateTimer_Proc, NULL, TIME_PERIODIC); - - + g_updateTimer = timeSetEvent(g_timerInterval, g_timerInterval / 4, TimerStep(), NULL, TIME_PERIODIC); #else SetTimer(g_hWnd, 1, g_timerInterval, NULL); #endif @@ -838,22 +826,22 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, g_threadNr = 0; g_hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadDisplay, 0, DETACHED_PROCESS, &g_threadID); - #endif while ( TRUE ) { - if ( PeekMessageA(&msg, NULL, 0,0, PM_NOREMOVE) ) + if ( PeekMessage(&msg, NULL, 0,0, PM_NOREMOVE) ) { if ( !GetMessage(&msg, NULL, 0, 0) ) { return msg.wParam; } TranslateMessage(&msg); - DispatchMessageA(&msg); + DispatchMessage(&msg); } else { + // make sure we go to sleep if we have nothing else to do if ( !g_bActive ) WaitMessage(); } } diff --git a/src/button.cpp b/src/button.cpp index 947cc60..f5c3b7c 100644 --- a/src/button.cpp +++ b/src/button.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +// #include #include #include "def.h" #include "pixmap.h" diff --git a/src/button.h b/src/button.h index 38544a3..8b54053 100644 --- a/src/button.h +++ b/src/button.h @@ -1,13 +1,11 @@ -#include +#pragma once + +// #include #include #include "decor.h" #include "sound.h" #include "pixmap.h" -#pragma once - -using namespace std; - class CButton { public: diff --git a/src/decblock.cpp b/src/decblock.cpp new file mode 100644 index 0000000..d4e18fb --- /dev/null +++ b/src/decblock.cpp @@ -0,0 +1,781 @@ +// DecBlock.cpp +// + +#include "def.h" +#include "decor.h" +#include "misc.h" +#include "obstacle.h" +#include "dectables.h" + +BOOL CDecor::BlitzActif(POINT cel) +{ + if (m_phase == WM_PHASE_BUILD) { + //TODO: rewrite this like a human + int foo = m_time >> 31; + return 1 - (((m_time ^ foo) - foo & 1 ^ foo) == foo); + } + + POINT pos = { cel.x * DIMOBJX, cel.y * DIMOBJY }; + + int num = m_time % 100; + + if (m_blupiPos.x >= pos.x - 80 && m_blupiPos.x <= pos.x + 80 && + m_blupiPos.y >= pos.y - 500 && m_blupiPos.y <= pos.y + 500) + { + if (m_time % 100 < 70 && cel.y > 0 && m_decor[cel.x][cel.y - 1].icon == 0x130) + { + PlaySound(SOUND_BLITZ, pos, 0); + } + + for (int i = 0; table_blitz[i] != -1; i++) + { + if (m_time % 100 == i) return TRUE; + } + } + + return FALSE; +} + +int CDecor::SoundEnviron(int sound, int obstacle) +{ + if ((obstacle >= 32 && obstacle <= 34) || (obstacle >= 41 && obstacle <= 47) || (obstacle >= 139 && obstacle <= 143)) + { + if (sound == SOUND_JUMPTOC) + { + return 79; + } + if (sound == SOUND_JUMPEND) + { + return 78; + } + } + if ((obstacle >= 1 && obstacle <= 28) || (obstacle >= 78 && obstacle <= 90) || (obstacle >= 250 && obstacle <= 260) || (obstacle >= 311 && obstacle <= 316) || (obstacle >= 324 && obstacle <= 329)) + { + if (sound == SOUND_JUMPTOC) + { + return 81; + } + if (sound == SOUND_JUMPEND) + { + return 80; + } + } + if ((obstacle >= 284 && obstacle <= 303) || obstacle == 338) + { + if (sound == SOUND_JUMPTOC) + { + return 83; + } + if (sound == SOUND_JUMPEND) + { + return 82; + } + } + if (obstacle >= 341 && obstacle <= 363) + { + if (sound == SOUND_JUMPTOC) + { + return 85; + } + if (sound == SOUND_JUMPEND) + { + return 84; + } + } + if (obstacle >= 215 && obstacle <= 234) + { + if (sound == SOUND_JUMPTOC) + { + return 87; + } + if (sound == SOUND_JUMPEND) + { + return 86; + } + } + if (obstacle >= 246 && obstacle <= 249) + { + if (sound == SOUND_JUMPTOC) + { + return 89; + } + if (sound == SOUND_JUMPEND) + { + return 88; + } + } + if (obstacle >= 107 && obstacle <= 109) + { + if (sound == SOUND_JUMPTOC) + { + return 91; + } + if (sound == SOUND_JUMPEND) + { + return 90; + } + } + return sound; +} + + +int CDecor::IsWorld(POINT pos) +{ + pos.x += 30; + pos.y += 30; + if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) + { + return -1; + } + int icon = m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon; + if (icon >= 158 && icon <= 165) + { + return icon - 158 + 1; + } + if (icon >= 166 && icon <= 173) + { + return icon - 166 + 1; + } + if (icon == 309 || icon == 310) + { + return 9; + } + if (icon >= 411 && icon <= 415) + { + return icon - 411 + 10; + } + if (icon >= 416 && icon <= 420) + { + return icon - 416 + 10; + } + if (icon >= 174 && icon <= 181) + { + return icon - 174 + 1; + } + if (icon == 184) + { + return 199; + } + return -1; +} + +void CDecor::ActiveSwitch(BOOL bState, POINT cel) +{ + POINT pos; + pos.x = cel.x * DIMOBJX; + pos.y = cel.y * DIMOBJY; + ModifDecor(pos, bState ? 384 : 385); + PlaySound(bState ? 77 : 76, pos); + cel.x -= 20; + for (int i = 0; i < 41; i++) + { + if (cel.x >= 0 && cel.x < 100 && m_decor[cel.x][cel.y].icon == (bState ? 379 : 378)) + { + pos.x = cel.x * DIMOBJX; + pos.y = cel.y * DIMOBJY; + ModifDecor(pos, bState ? 378 : 379); + } + cel.x++; + } +} + +int CDecor::GetTypeBarre(POINT pos) +{ + POINT pos2 = pos; + pos.x += 30; + pos.y += 22; + if (pos.y % 64 > 44) + { + return 0; + } + if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) + { + return 0; + } + int icon = m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon; + if (icon != 138 && icon != 202) + { + return 0; + } + if (pos.y >= 6336) + { + return 1; + } + icon = m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY + 1].icon; + if (IsPassIcon(icon)) + { + return 2; + } + RECT rect = BlupiRect(pos2); + rect.top = pos2.y + 60 - 2; + rect.bottom = pos2.y + 60 - 1; + if (DecorDetect(rect, TRUE)) + { + return 2; + } + return 1; +} + +BOOL CDecor::IsLave(POINT pos) +{ + pos.x += 30; + return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 68; +} + +BOOL CDecor::IsPiege(POINT pos) +{ + pos.x += 30; + pos.y += 60; + return pos.x % 64 >= 15 && pos.x % 64 <= 49 && pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 373; +} + +BOOL CDecor::IsGoutte(POINT pos, BOOL bAlways) +{ + pos.x += 30; + if (pos.x % 64 < 15 || pos.x % 64 > 49) + { + return FALSE; + } + if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) + { + return FALSE; + } + int icon = m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon; + if (bAlways) + { + return icon == 404 || icon == 410; + } + return icon == 404; +} + +BOOL CDecor::IsScie(POINT pos) +{ + pos.x += 30; + return pos.x % 64 >= 4 && pos.x % 64 <= 60 && pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 378; +} + +BOOL CDecor::IsSwitch(POINT pos, POINT celSwitch) +{ + pos.x += 30; + if (pos.x % 64 < 4 || pos.x % 64 > 60) + { + return FALSE; + } + if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) + { + return FALSE; + } + celSwitch.x = pos.x / DIMOBJX; + celSwitch.y = pos.y / DIMOBJY; + return m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 384 || m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 385; +} + +BOOL CDecor::IsEcraseur(POINT pos) +{ + if (m_time / 3 % 10 > 2) + { + return FALSE; + } + pos.x += 30; + return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 317; +} + +BOOL CDecor::IsBlitz(POINT pos, BOOL bAlways) +{ + pos.x += 30; + if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) + { + return FALSE; + } + POINT tinyPoint; + tinyPoint.x = pos.x / DIMOBJX; + tinyPoint.y = pos.y / DIMOBJY; + return m_decor[tinyPoint.x][tinyPoint.y].icon == 305 && (bAlways || BlitzActif(tinyPoint)); +} + +BOOL CDecor::IsRessort(POINT pos) +{ + pos.x += 30; + pos.y += 60; + return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 211; +} + +BOOL CDecor::IsTemp(POINT pos) +{ + pos.x += 30; + pos.y += 60; + return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 324; +} + +BOOL CDecor::IsBridge(POINT pos, POINT celBridge) +{ + pos.x += 30; + pos.y += 60; + if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 364) + { + celBridge.x = pos.x / DIMOBJX; + celBridge.y = pos.y / DIMOBJY; + return TRUE; + } + pos.y -= 60; + if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 364) + { + celBridge.x = pos.x / DIMOBJX; + celBridge.y = pos.y / DIMOBJY; + return TRUE; + } + return FALSE; + +} + +int CDecor::IsDoor(POINT pos, POINT celPorte) +{ + int num; + if (m_blupiDir == 1) + { + num = -60; + } + else + { + num = 60; + } + pos.x += 30; + for (int i = 0; i < 2; i++) + { + if (pos.x >= 0 && pos.x < DIMOBJX * MAXCELX && pos.y >= 0 && pos.y < DIMOBJY * MAXCELY && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon >= 334 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon <= 336) + { + celPorte.x = pos.x / DIMOBJX; + celPorte.y = pos.y / DIMOBJY; + return m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon; + } + pos.x += num; + } + return -1; +} + +int CDecor::IsTeleporte(POINT pos) +{ + if (pos.x % DIMOBJX > 6) + { + return -1; + } + pos.x += 30; + pos.y -= 60; + if (pos.x < 0 || pos.x >= DIMOBJX * MAXCELX || pos.y < 0 || pos.y >= DIMOBJY * MAXCELY) + { + return -1; + } + if (m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon >= 330 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon <= 333) + { + return m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon; + } + return -1; +} + +BOOL CDecor::SearchTeleporte(POINT pos, POINT newpos) +{ + int num = IsTeleporte(pos); + if (num == -1) + { + return FALSE; + } + for (int i = 0; i < 100; i++) + { + for (int j = 0; j < 100; j++) + { + if (num == m_decor[i][j].icon) + { + newpos.x = i * 64; + newpos.y = j * 64 + 60; + if (newpos.x < pos.x - 40 || newpos.x > pos.x + 40 || newpos.y < pos.y - 40 || newpos.y > pos.y + 40) + { + return TRUE; + } + } + } + } + return FALSE; +} + +BOOL CDecor::IsSurfWater(POINT pos) +{ + if (pos.y % 64 < 64 - BLUPISURF) + { + return FALSE; + } + int icon = m_decor[(pos.x + 30) / 64][pos.y / DIMOBJY].icon; + int icon2 = m_decor[(pos.x + 30) / 64][(pos.y + BLUPISURF) / 64].icon; + return icon != 92 && icon2 == 92; +} + +BOOL CDecor::IsDeepWater(POINT pos) +{ + int num = (pos.x + 30) / 64; + int num2 = pos.y / DIMOBJY; + if (num < 0 || num >= 100 || num2 < 0 || num2 >= 100) + { + return FALSE; + } + int icon = m_decor[num][num2].icon; + return icon == 91 || icon == 92; +} + +BOOL CDecor::IsOutWater(POINT pos) +{ + int icon = m_decor[(pos.x + 30) / 64][(pos.y + 30) / 64].icon; + return icon != 91 && icon != 92 && IsPassIcon(icon); +} + +BOOL CDecor::IsPassIcon(int icon) +{ + if (icon == 324 && m_time / 4 % 20 >= 18) + { + return TRUE; + } + if (icon >= 0 && icon < MAXQUART) + { + for (int i = 0; i < 16; i++) + { + if (table_decor_quart[icon * 16 + i] != 0) + { + return FALSE; + } + } + } + return TRUE; +} + +BOOL CDecor::IsBlocIcon(int icon) +{ + if (icon < 0 || icon >= MAXQUART) + { + return FALSE; + } + if (icon == 324 && m_time / 4 % 20 < 18) + { + return FALSE; + } + for (int i = 0; i < 16; i++) + { + if (table_decor_quart[icon * 16 + i] == 0) + { + return FALSE; + } + } + return FALSE; +} + +BOOL CDecor::IsVentillo(POINT pos) +{ + int num = 0; + BOOL flag = FALSE; + POINT tinyPoint; + pos.x += 30; + pos.y += 30; + if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) + { + return FALSE; + } + int icon = m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon; + if (icon < 126 || icon > 137) + { + return FALSE; + } + if (icon == 126) + { + if (pos.x % 64 <= 16) + { + flag = TRUE; + } + tinyPoint.x = -64; + tinyPoint.y = 0; + num = 110; + } + if (icon == 129) + { + if (pos.x % 64 >= 48) + { + flag = TRUE; + } + tinyPoint.x = 64; + tinyPoint.y = 0; + num = 114; + } + if (icon == 132) + { + if (pos.y % 64 <= 32) + { + flag = TRUE;; + } + tinyPoint.x = 0; + tinyPoint.y = -64; + num = 118; + } + if (icon == 135) + { + if (pos.y % 64 >= 48) + { + flag = TRUE; + } + tinyPoint.x = 0; + tinyPoint.y = 64; + num = 122; + } + if (!flag) + { + return FALSE; + } + ModifDecor(pos, -1); + do + { + pos.x += tinyPoint.x; + pos.y += tinyPoint.y; + if (num != m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon) + { + break; + } + ModifDecor(pos, -1); + } while (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400); + return TRUE; +} + +void CDecor::ModifDecor(POINT pos, int icon, BOOL bMulti) +{// TODO: this + int icon2 = m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon; + if (icon == -1 && icon >= 126 && icon2 <= 137) + { + + } + m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon = icon; +} + +void CDecor::ModifDecor(POINT pos, int icon) +{ + ModifDecor(pos, icon, TRUE); +} + +BOOL CDecor::IsRightBorder(POINT pos, POINT offset) +{ + return FALSE; // TODO +} + + +BOOL CDecor::IsFromage(POINT cel) +{ + if (!IsValidCel(cel)) return FALSE; + + int icon = m_decor[cel.x][cel.y].icon; + return (icon >= 246 && icon <= 249) || icon == 339; +} + +BOOL CDecor::IsGrotte(POINT cel) +{ + if (!IsValidCel(cel)) return FALSE; + + int icon = m_decor[cel.x][cel.y].icon; + return icon = 284 || icon == 301 || icon == 337; +} + +void CDecor::AdaptMidBorder(POINT cel) +{ + if (!IsValidCel(cel)) return; + + int num = 15; + if (!IsRightBorder({ cel.x, cel.y + 1 }, { 0, -1 })) + { + num &= -2; + } + if (!IsRightBorder({ cel.x, cel.y + 1 }, { 0, 1 })) + { + num &= -3; + } + if (!IsRightBorder({ cel.x + 1, cel.y }, { -1, 0 })) + { + num &= -5; + } + if (!IsRightBorder({ cel.x - 1, cel.y }, { 1, 0 })) + { + num &= -9; + } + int num2 = m_decor[cel.x][cel.y].icon; + if (num2 == 156) + { + num2 = 35; + } + if (num2 == 252 || num2 == 253) + { + num2 = 251; + } + if (num2 == 255) + { + num2 = 254; + } + if (num2 == 362) + { + num2 = 347; + } + if (num2 == 363) + { + num2 = 348; + } + if (num2 >= 341 && num2 <= 346) + { + num2 = 341; + } + for (int i = 0; i < 144; i++) + { + if (num2 == table_adapt_decor[i]) + { + num2 = table_adapt_decor[i / 16 * 16 + num]; + if (num2 == 35 && rand() % 2 == 0) + { + num2 = 156; + } + if (num2 == 251) + { + num2 = Random(251, 253); + } + if (num2 == 254 && rand() % 2 == 0) + { + num2 = 255; + } + if (num2 == 347 && rand() % 2 == 0) + { + num2 = 362; + } + if (num2 == 348 && rand() % 2 == 0) + { + num2 = 363; + } + if (num2 == 341) + { + num2 = Random(341, 346); + } + m_decor[cel.x][cel.y].icon = num2; + return; + } + } + num2 = m_decor[cel.x][cel.y].icon; + if (num2 == -1 || (num2 >= 264 && num2 <= 282)) + { + num = 15; + if (!IsFromage(cel + POINT{ 0,1 })) + { + num &= -2; + } + if (!IsFromage(cel - POINT{ 0,1 })) + { + num &= -3; + } + if (!IsFromage(cel + POINT{ 1,0 })) + { + num &= -5; + } + if (!IsFromage(cel - POINT{ 1,0 })) + { + num &= -9; + } + num2 = table_adapt_fromage[num]; + if (num2 == 268 && rand() % 2 == 0) + { + num2 = 279; + } + if (num2 == 269 && rand() % 2 == 0) + { + num2 = 280; + } + if (num2 == 264 && rand() % 2 == 0) + { + num2 = 281; + } + if (num2 == 265 && rand() % 2 == 0) + { + num2 = 282; + } + m_decor[cel.x][cel.y].icon = num2; + } + num2 = m_decor[cel.x][cel.y].icon; + if (num2 == -1 || (num2 >= 285 && num2 <= 303 && num2 != 301)) + { + num = 15; + if (!IsGrotte(cel+POINT{0,1})) + { + num &= -2; + } + if (!IsGrotte(cel-POINT{0,1})) + { + num &= -3; + } + if (!IsGrotte(cel+POINT{1,0})) + { + num &= -5; + } + if (!IsGrotte(cel-POINT{1,0})) + { + num &= -9; + } + num2 = table_adapt_fromage[num + 16]; + if (num2 == 289 && rand() % 2 == 0) + { + num2 = 300; + } + if (num2 == 285 && rand() % 2 == 0) + { + num2 = 302; + } + if (num2 == 286 && rand() % 2 == 0) + { + num2 = 303; + } + m_decor[cel.x][cel.y].icon = num2; + } +} + +void CDecor::AdaptBorder(POINT cel) +{ + AdaptMidBorder(cel); + AdaptMidBorder(cel + POINT{1, 0}); + AdaptMidBorder(cel - POINT{1, 0}); + AdaptMidBorder(cel + POINT{ 0,1 }); + AdaptMidBorder(cel - POINT{ 0,1 }); + int icon = m_decor[cel.x][cel.y].icon; + if (icon != -1 && !IsPassIcon(icon)) + { + MoveObjectDelete(cel); + } + icon = m_decor[cel.x][cel.y].icon; + if (icon == 304) + { + for (int i = 0; i < 4; i++) + { + cel.y++; + if (cel.y >= 100) + { + break; + } + icon = m_decor[cel.x][cel.y].icon; + if (icon != -1) + { + break; + } + m_decor[cel.x][cel.y].icon = 305; + } + } + if (icon == -1) + { + for (int i = 0; i < 4; i++) + { + cel.y++; + if (cel.y >= 100) + { + return; + } + icon = m_decor[cel.x][cel.y].icon; + if (icon != 305) + { + return; + } + m_decor[cel.x][cel.y].icon = -1; + } + } +} \ No newline at end of file diff --git a/src/decblupi.cpp b/src/decblupi.cpp index a74aba4..9c51af7 100644 --- a/src/decblupi.cpp +++ b/src/decblupi.cpp @@ -3,40 +3,4191 @@ #include "DEF.H" #include "DECOR.H" -#include "ACTION.H" #include "MISC.H" #include "RESOURCE.H" +#include "dectables.h" -void CDecor::BlupiCheat(int cheat) +int CDecor::GetBlupiChannelStandard() { - int rank; - Perso *persos; - PersoType persosType; - - m_persos = persos; - - for (rank = 0; rank < MAXBLUPI; rank++) - { - if (cheat == 2) - { - if (persosType == perso_bomb || - persosType == perso_hangingbomb || - persosType == perso_homingbomb || - persosType == perso_hombingbombactive || - persosType == perso_bulldozer || - persosType == perso_movingbomb) - } - } + if (m_bMulti && m_blupiChannel == CHBLUPI && m_team > 0) { + return m_team + CHBLUPI1 - 1; + } + else { + return m_blupiChannel; + } } -/* -void CDecor::GetBlupiHitbox(RECT *out, POINT pos) +int CDecor::GetBlupiChannelActual() { - int rect.top; - int rect.bottom; - int rect.left; - int rect.right; - - if + if (m_bMulti && m_team > 0) { + return m_team + CHBLUPI1 - 1; + } + return CHBLUPI; } -*/ \ No newline at end of file + +void CDecor::GetBlupiInfo(BOOL* bHelico, BOOL* bJeep, BOOL* bSkate, BOOL* bNage) +{ + *bHelico = m_blupiHelico; + *bJeep = m_blupiJeep | m_blupiTank; + *bSkate = m_blupiSkate; + *bNage = m_blupiNage | m_blupiSurf; +} + +void CDecor::BlupiSearchIcon() +{ + int num = 0; + int num2 = 2; + int num3 = m_blupiAction; + if (m_blupiVent && m_blupiHelico && m_blupiOver) + { + if (num3 == 1) + { + num3 = 8; + } + if (num3 == 2) + { + num3 = 14; + } + } + if (m_blupiHelico) + { + if (num3 == 1) + { + num3 = 15; + } + if (num3 == 2) + { + num3 = 16; + } + if (num3 == 3) + { + num3 = 17; + } + if (num3 == 10) + { + num3 = 15; + } + if (num3 == 9) + { + num3 = 15; + } + } + if (m_blupiOver) + { + if (num3 == 1) + { + num3 = 67; + } + if (num3 == 2) + { + num3 = 68; + } + if (num3 == 3) + { + num3 = 69; + } + if (num3 == 10) + { + num3 = 67; + } + if (num3 == 9) + { + num3 = 67; + } + } + if (m_blupiJeep) + { + if (num3 == 1) + { + num3 = 25; + } + if (num3 == 2) + { + num3 = 26; + } + if (num3 == 10) + { + num3 = 26; + } + if (num3 == 3) + { + num3 = 27; + } + } + if (m_blupiTank) + { + if (num3 == 1) + { + num3 = 50; + } + if (num3 == 2) + { + num3 = 51; + } + if (num3 == 10) + { + num3 = 51; + } + if (num3 == 3) + { + num3 = 52; + } + } + +} + +BOOL CDecor::BlupiIsGround() +{ + if (m_blupiTransport == -1) + { + RECT rect = BlupiRect(m_blupiPos); + rect.top = m_blupiPos.y + DIMBLUPIY - 2; + rect.bottom = m_blupiPos.y + DIMBLUPIY - 1; + return DecorDetect(rect, TRUE); + } + else { + return FALSE; + } +} + +RECT CDecor::BlupiRect(POINT pos) +{ + RECT result; + if (m_blupiNage || m_blupiSurf) + { + result.left = pos.x + 12; + result.right = pos.x + DIMBLUPIX - 12; + if (m_blupiAction == ACTION_STOP) + { + result.top = pos.y + 5; + result.bottom = pos.y + DIMBLUPIY - 10; + } + else + { + result.top = pos.y + 15; + result.bottom = pos.y + DIMBLUPIY - 10; + } + } + else if (m_blupiJeep) + { + result.left = pos.x + 2; + result.right = pos.x + DIMBLUPIX - 2; + result.top = pos.y + 10; + result.bottom = pos.y + DIMBLUPIY - 2; + } + else if (m_blupiTank) + { + result.left = pos.x + 2; + result.right = pos.x + DIMBLUPIX - 2; + result.top = pos.y + 10; + result.bottom = pos.y + DIMBLUPIY - 2; + } + else if (m_blupiOver) + { + result.left = pos.x + 2; + result.right = pos.x + DIMBLUPIX - 2; + result.top = pos.y + 2; + result.bottom = pos.y + DIMBLUPIY - 2; + } + else if (m_blupiBalloon) + { + result.left = pos.x + 10; + result.right = pos.x + DIMBLUPIX - 10; + result.top = pos.y + 5; + result.bottom = pos.y + DIMBLUPIY - 2; + } + else if (m_blupiEcrase) + { + result.left = pos.x + 5; + result.right = pos.x + DIMBLUPIX - 5; + result.top = pos.y + 39; + result.bottom = pos.y + DIMBLUPIY - 2; + } + else + { + result.left = pos.x + 12; + result.right = pos.x + DIMBLUPIX - 12; + result.top = pos.y + 11; + result.bottom = pos.y + DIMBLUPIY - 2; + } + return result; +} + +void CDecor::BlupiAdjust() +{ + RECT tinyRect = BlupiRect(m_blupiPos); + + if (DecorDetect(tinyRect)) + { + return; + } + for (int i = 0; i < 50; i++) + { + RECT rect = tinyRect; + rect.bottom = rect.top + 2; + rect.left = m_blupiPos.x + 12; + rect.right = m_blupiPos.x + 60 - 12; + if (DecorDetect(rect)) + { + break; + } + tinyRect.top += 2; + tinyRect.bottom += 2; + m_blupiPos.y = m_blupiPos.y + 2; + } + for (int i = 0; i < 50; i++) + { + RECT rect = tinyRect; + rect.right = rect.left + 2; + rect.top = m_blupiPos.y + 11; + rect.bottom = m_blupiPos.y + 60 - 2; + if (DecorDetect(rect)) + { + break; + } + tinyRect.left += 2; + tinyRect.right += 2; + m_blupiPos.x = m_blupiPos.x + 2; + } + for (int i = 0; i < 50; i++) + { + RECT rect = tinyRect; + rect.left = rect.right - 2; + rect.top = m_blupiPos.y + 11; + rect.bottom = m_blupiPos.y + 60 - 2; + if (DecorDetect(rect)) + { + break; + } + tinyRect.left -= 2; + tinyRect.right -= 2; + m_blupiPos.x = m_blupiPos.x - 2; + } + for (int i = 0; i < 50; i++) + { + RECT rect = tinyRect; + rect.right = rect.left + 2; + if (DecorDetect(rect)) + { + break; + } + tinyRect.left += 2; + tinyRect.right += 2; + m_blupiPos.x = m_blupiPos.x + 2; + } + for (int i = 0; i < 50; i++) + { + RECT rect = tinyRect; + rect.left = rect.right - 2; + if (DecorDetect(rect)) + { + return; + } + tinyRect.left -= 2; + tinyRect.right -= 2; + m_blupiPos.x = m_blupiPos.x - 2; + } +} + +BOOL CDecor::BlupiBloque(POINT pos, int dir) +{ + RECT rect = BlupiRect(pos); + rect.top = rect.bottom - 20; + rect.bottom -= 2; + if (dir > 0) + { + rect.left = rect.right - 2; + } + if (dir < 0) + { + rect.right = rect.left + 2; + } + return DecorDetect(rect); +} + +void CDecor::BlupiStep() +{ + int m_blupiSpeedX = 0; // + int m_blupiSpeedY = 0; // lol. lmao even + POINT tinyPoint; + POINT tinyPoint2; + BlupiAdjust(); + //m_blupiLastPos = m_blupiPos; + POINT tinyPoint3 = m_blupiPos; + BOOL flag = m_blupiAir; + int blupiAction = m_blupiAction; + BOOL flag2 = FALSE; + BOOL flag3 = FALSE; + tinyPoint3.x += m_blupiVector.x; + tinyPoint3.y += m_blupiVector.y; + if (m_blupiFocus && (tinyPoint3.y + 30) / 64 >= 99) + { + BlupiDead(75, -1); + m_blupiRestart = TRUE; + m_blupiAir = TRUE; + m_blupiPos.y = m_blupiPos.y / DIMOBJY * 64 + BLUPIOFFY; + PlaySound(8, m_blupiPos); + return; + } + RECT rect; + if (m_blupiVector.x != 0 || m_blupiVector.y != 0) + { + rect = BlupiRect(m_blupiPos); + rect.top = m_blupiPos.y + 11; + rect.bottom = m_blupiPos.y + 60 - 2; + TestPath(rect, m_blupiPos, tinyPoint3); + } + m_blupiVent = FALSE; + int num; + if (m_blupiTransport == -1 && !m_blupiJeep && !m_blupiTank && !m_blupiSkate + && m_blupiFocus) + { + num = m_decor[(tinyPoint3.x + 30) / 64][(tinyPoint3.y + 30) / 64].icon; + if (num == 110) + { + tinyPoint3.x -= 9; + } + if (num == 114) + { + tinyPoint3.x += 9; + } + if (num == 118) + { + tinyPoint3.y -= 20; + } + if (num == 122) + { + tinyPoint3.y += 20; + } + if (num >= 110 && num <= 125) + { + m_blupiVent = TRUE; + rect.left = m_blupiPos.x + 12; + rect.right = m_blupiPos.x + 60 - 12; + rect.top = m_blupiPos.y + 11; + rect.bottom = m_blupiPos.y + 60 - 2; + TestPath(rect, m_blupiPos, tinyPoint3); + } + } + BOOL flag4; + if (m_blupiTransport == -1) + { + rect = BlupiRect(tinyPoint3); + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60 - 1; + flag = !DecorDetect(rect); + } + else + { + flag4 = FALSE; + } + rect = BlupiRect(tinyPoint3); + rect.top = tinyPoint3.y + 10; + rect.bottom = tinyPoint3.y + 20; + BOOL flag5 = DecorDetect(rect); + int detectIcon = m_detectIcon; + if (!m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && flag4 && m_blupiFocus) + { + if (m_blupiFocus) + { + m_blupiAction = 5; + m_blupiPhase = 0; + } + m_blupiVitesse.y = 1; + m_blupiAir = true; + flag = true; + } + if (!m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiAir && IsRessort(tinyPoint3)) + { + if ((m_blupiHelico || m_blupiOver) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + m_blupiHelico = false; + m_blupiOver = false; + tinyPoint.x = tinyPoint3.x - 34; + tinyPoint.y = tinyPoint3.y - 34; + ObjectStart(tinyPoint, 9, 0); + m_decorAction = 1; + m_decorPhase = 0; + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(10, m_blupiPos); + } + if (m_blupiJeep && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + m_blupiJeep = false; + tinyPoint.x = tinyPoint3.x - 34; + tinyPoint.y = tinyPoint3.y - 34; + ObjectStart(tinyPoint, 9, 0); + m_decorAction = 1; + m_decorPhase = 0; + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(10, m_blupiPos); + } + if (m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + m_blupiTank = false; + tinyPoint.x = tinyPoint3.x - 34; + tinyPoint.y = tinyPoint3.y - 34; + ObjectStart(tinyPoint, 9, 0); + m_decorAction = 1; + m_decorPhase = 0; + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(10, m_blupiPos); + } + if (m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + m_blupiSkate = false; + tinyPoint.x = tinyPoint3.x - 34; + tinyPoint.y = tinyPoint3.y - 34; + ObjectStart(tinyPoint, 9, 0); + m_decorAction = 1; + m_decorPhase = 0; + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(10, m_blupiPos); + } + if (m_blupiFocus && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81) + { + m_blupiAction = 5; + m_blupiPhase = 0; + } + if ((m_keyPress & 1) != 0 && m_blupiFocus) + { + m_blupiVitesse.y = (m_blupiPower ? -25 : -19); + } + else + { + m_blupiVitesse.y = (m_blupiPower ? -16 : -10); + } + m_blupiAir = true; + flag = true; + PlaySound(41, tinyPoint3); + } + if ((m_keyPress & 1) != 0 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + if (m_blupiAction != 4 && m_blupiAction != 3 && !m_blupiAir) + { + m_blupiAction = 4; + m_blupiPhase = 0; + } + if (m_blupiAction == 4 && m_blupiPhase == 3) + { + m_blupiAction = 5; + m_blupiPhase = 0; + if (m_blupiSkate) + { + PlaySound(1, tinyPoint3); + m_blupiVitesse.y = (m_blupiPower ? -17 : -13); + } + else + { + PlaySound(1, tinyPoint3); + if (/*IsNormalJump(tinyPoint3)*/FALSE) + { + m_blupiVitesse.y = (m_blupiPower ? -26 : -16); + } + else + { + m_blupiVitesse.y = (m_blupiPower ? -16 : -12); + } + } + m_blupiAir = true; + flag = true; + } + } + if (m_blupiAir) + { + if (flag5 && m_blupiVitesse.y < 0) + { + if (m_blupiVitesse.y < -14 && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81 && !m_blupiSkate) + { + m_blupiJumpAie = true; + PlaySound(40, tinyPoint3); + } + else + { + PlaySound(SoundEnviron(4, detectIcon), tinyPoint3); + } + m_blupiVitesse.y = 1; + } + tinyPoint3.y += (int)(m_blupiVitesse.y * 2); + if (m_blupiVitesse.y < 20) + { + m_blupiVitesse.y += 2; + } + rect = BlupiRect(tinyPoint3); + rect.top = tinyPoint3.y + 60 - 30; + rect.bottom = tinyPoint3.y + 60 - 1; + if (m_blupiVitesse.y >= 0 && DecorDetect(rect)) + { + tinyPoint3.y = tinyPoint3.y / 32 * 32 + BLUPIOFFY; + if (!IsRessort(tinyPoint3)) + { + PlaySound(SoundEnviron(3, m_detectIcon), tinyPoint3); + } + if (m_blupiFocus) + { + if (m_blupiVitesse.y > 20) + { + m_blupiAction = 61; + } + else + { + m_blupiAction = 61; + } + m_blupiPhase = 0; + } + m_blupiAir = false; + if (m_blupiJumpAie) + { + m_blupiJumpAie = false; + m_blupiAction = 36; + m_blupiPhase = 0; + } + } + rect.left = tinyPoint3.x + 20; + rect.right = tinyPoint3.x + 60 - 20; + rect.top = tinyPoint3.y + 60 - 33; + rect.bottom = tinyPoint3.y + 60 - 1; + num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); + if (m_blupiVitesse.y >= 0 && num != -1) + { + m_blupiTransport = num; + flag4 = false; + PlaySound(3, tinyPoint3); + tinyPoint3.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY; + if (m_blupiFocus) + { + if (m_blupiVitesse.y > 20) + { + m_blupiAction = 61; + } + else + { + m_blupiAction = 61; + } + m_blupiPhase = 0; + } + m_blupiAir = false; + if (m_blupiJumpAie) + { + m_blupiJumpAie = false; + m_blupiAction = 36; + m_blupiPhase = 0; + } + } + } + if (m_blupiAction == 36 && m_blupiPhase == 30) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + if (m_blupiAction == 56 && m_blupiPhase == 64) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + m_blupiCloud = true; + m_blupiTimeShield = 100; + m_jauges[1].SetHide(false); + PlaySound(55, tinyPoint3); + } + if (m_blupiAction == 58) + { + if (m_blupiPhase == 8) + { + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y + 40; + if (m_blupiVitesse.y > 0) + { + tinyPoint.y += (int)(m_blupiVitesse.y * 4); + } + m_blupiVitesse.y -= 10; + if (ObjectStart(tinyPoint, 23, 55) != -1) + { + PlaySound(52, m_blupiPos); + m_blupiTimeFire = 10; + m_blupiBullet--; + } + } + if (m_blupiPhase == 14) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + } + if ((m_blupiAction == 44 || m_blupiAction == 45) && m_blupiPhase == 29) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + if (m_blupiAction == 46 && m_blupiPhase == 32) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + if (m_blupiAction == 47 && m_blupiPhase == 34) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + BOOL flag6; + if (m_blupiAction == 48 && m_blupiPhase == 40) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + num = MoveObjectDetect(tinyPoint3, &flag6); + if (num != -1 && !flag6 && tinyPoint3.y - BLUPIFLOOR == m_moveObject[num].posCurrent.y) + { + if (m_blupiDir == 2 && tinyPoint3.x < m_moveObject[num].posCurrent.x) + { + tinyPoint.x = tinyPoint3.x - 16; + tinyPoint.y = tinyPoint3.y; + int num2 = MoveObjectDetect(tinyPoint, &flag6); + if (num2 == -1) + { + m_blupiAction = 9; + m_blupiPhase = 0; + } + } + if (m_blupiDir == 1 && tinyPoint3.x > m_moveObject[num].posCurrent.x) + { + tinyPoint.x = tinyPoint3.x + 16; + tinyPoint.y = tinyPoint3.y; + int num2 = MoveObjectDetect(tinyPoint, &flag6); + if (num2 == -1) + { + m_blupiAction = 9; + m_blupiPhase = 0; + } + } + } + } + if (m_blupiAction == 65) + { + if (m_blupiPhase == 4) + { + PlaySound(47, m_blupiPos); + } + if (m_blupiPhase == 44) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + } + if (m_blupiAction == 63) + { + if (m_blupiPhase == 1) + { + PlaySound(65, m_blupiPos); + m_blupiTimeMockery = 300; + } + if (m_blupiPhase == 92) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + } + if (m_blupiAction == 64) + { + if (m_blupiPhase == 6) + { + PlaySound(65, m_blupiPos); + m_blupiTimeMockery = 300; + } + if (m_blupiPhase == 104) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + } + if (m_blupiAction == 83) + { + if (m_blupiPhase == 4) + { + PlaySound(47, m_blupiPos); + } + if (m_blupiPhase == 60) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + } + if (m_blupiAction == 84 && m_blupiPhase == 18) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + if (m_blupiAction == 60 && m_blupiPhase == 3) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_blupiAction == 61 && m_blupiPhase == 5) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_blupiAction == 62 && m_blupiPhase == 2) + { + m_blupiAction = 5; + m_blupiPhase = 0; + m_blupiVitesse.y = -12; + m_blupiAir = true; + flag = true; + } + if (m_blupiAction == 49 && m_blupiPhase == 32) + { + //ObjectStart(m_sucettePos, m_sucetteType, 0); // respawn item (winphone behavior) + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + m_blupiPower = true; + m_blupiTimeShield = 100; + m_blupiPosMagic = m_blupiPos; + m_jauges[1].SetHide(false); + PlaySound(44, tinyPoint3); + } + if (m_blupiAction == 55 && m_blupiPhase == 36) + { + //ObjectStart(m_sucettePos, m_sucetteType, 0); // respawn item (winphone behavior) + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + m_blupiHide = true; + m_blupiTimeShield = 100; + m_blupiPosMagic = m_blupiPos; + m_jauges[1].SetHide(false); + PlaySound(62, tinyPoint3); + } + if ( m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + m_blupiAction = 7; + m_blupiPhase = 0; + } + if (m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if ( m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 6 && m_blupiAction != 28 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + m_blupiAction = 6; + m_blupiPhase = 0; + } + if ( (m_keyPress & 1) == 0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 6 && m_blupiAction != 28 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + m_blupiAction = 6; + m_blupiPhase = 0; + } + if (m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_blupiAction == 7 && m_blupiPhase == 4) + { + m_scrollAdd.y = -150; + PlaySound(21, tinyPoint3); + } + if (m_blupiAction == 6 && m_blupiPhase == 4) + { + m_scrollAdd.y = 150; + PlaySound(7, tinyPoint3); + } + if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + if ( (m_keyPress & 1) == 0 && m_blupiAction != 28 && m_blupiDir == 1 && (num = CaisseInFront()) != -1) + { + tinyPoint3.x = m_moveObject[num].posCurrent.x + 64 - 5; + m_blupiAction = 28; + m_blupiPhase = 0; + m_scrollAdd.y = 0; + PlaySound(39, tinyPoint3); + } + if ( (m_keyPress & 1) == 0 && m_blupiAction != 29 && m_blupiDir == 1 && CaisseInFront() != -1) + { + m_blupiAction = 29; + m_blupiPhase = 0; + m_scrollAdd.y = 0; + PlaySound(39, tinyPoint3); + } + if ( (m_keyPress & 1) == 0 && m_blupiAction != 28 && m_blupiDir == 2 && (num = CaisseInFront()) != -1) + { + tinyPoint3.x = m_moveObject[num].posCurrent.x - 60 + 5; + m_blupiAction = 28; + m_blupiPhase = 0; + m_scrollAdd.y = 0; + PlaySound(39, tinyPoint3); + } + if ((m_keyPress & 1) == 0 && m_blupiAction != 29 && m_blupiDir == 2 && CaisseInFront() != -1) + { + m_blupiAction = 29; + m_blupiPhase = 0; + m_scrollAdd.y = 0; + PlaySound(39, tinyPoint3); + } + if (m_blupiAction == 29 && m_blupiActionOuf != 47) + { + m_blupiActionOuf = 47; + m_blupiTimeOuf = 0; + } + } + if (m_blupiAction != 28 && m_blupiAction != 29 && m_blupiFocus) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + int num3; + int num4; + if (m_blupiFocus) + { + if (m_blupiDir == 2 && m_blupiAction != 3 && m_blupiAction != 59 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && ((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || abs(m_blupiVitesse.x) <= 8)) + { + if (m_blupiAir) + { + PlaySound(5, tinyPoint3); + m_blupiAction = 59; + m_blupiPhase = 0; + m_blupiDir = 1; + } + else + { + PlaySound(5, tinyPoint3); + m_blupiAction = 3; + m_blupiPhase = 0; + } + } + if (m_blupiDir == 1 && m_blupiAction != 2 && m_blupiAction != 14 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiAir) + { + m_blupiAction = 2; + m_blupiPhase = 0; + } + if (m_blupiDir == 1 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend) + { + if (m_blupiAction == 14) + { + tinyPoint3.x -= CaisseGetMove(5); + } + else + { + num3 = m_blupiPhase; + if (num3 > 3 || m_blupiAir) + { + num3 = 3; + } + num4 = table_vitesse_march[num3]; + if (m_blupiPower) + { + num4 *= 3; + num4 /= 2; + } + //tinyPoint3.x += Misc.Speed(m_blupiSpeedX, num4); + } + } + if (m_blupiDir == 2 && m_blupiAction == 29) + { + tinyPoint3.x -= CaisseGetMove(3); + } + } + if (m_blupiFocus) + { + if (m_blupiDir == 1 && m_blupiAction != 3 && m_blupiAction != 59 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && ((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || abs(m_blupiVitesse.x) <= 8)) + { + if (m_blupiAir) + { + PlaySound(5, tinyPoint3); + m_blupiAction = 59; + m_blupiPhase = 0; + m_blupiDir = 2; + } + else + { + PlaySound(5, tinyPoint3); + m_blupiAction = 3; + m_blupiPhase = 0; + } + } + if (m_blupiDir == 2 && m_blupiAction != 2 && m_blupiAction != 14 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiAir) + { + m_blupiAction = 2; + m_blupiPhase = 0; + } + if (m_blupiDir == 2 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend) + { + if (m_blupiAction == 14) + { + tinyPoint3.x += CaisseGetMove(5); + } + else + { + num3 = m_blupiPhase; + if (num3 > 3 || m_blupiAir) + { + num3 = 3; + } + num4 = table_vitesse_march[num3]; + if (m_blupiPower) + { + num4 *= 3; + num4 /= 2; + } + } + } + if (m_blupiDir == 1 && m_blupiAction == 29) + { + tinyPoint3.x += CaisseGetMove(3); + } + } + if (m_blupiHelico) + { + if (m_blupiAction == 3 && m_blupiPhase == 10) + { + m_blupiAction = 2; + if (m_blupiDir == 1) + { + m_blupiDir = 2; + } + else + { + m_blupiDir = 1; + } + } + } + else if (m_blupiOver) + { + if (m_blupiAction == 3 && m_blupiPhase == 7) + { + m_blupiAction = 2; + if (m_blupiDir == 1) + { + m_blupiDir = 2; + } + else + { + m_blupiDir = 1; + } + } + } + else if (m_blupiJeep) + { + if (m_blupiAction == 3 && m_blupiPhase == 7) + { + m_blupiAction = 1; + m_blupiPhase = 0; + if (m_blupiDir == 1) + { + m_blupiDir = 2; + } + else + { + m_blupiDir = 1; + } + } + } + else if (m_blupiTank) + { + if (m_blupiAction == 3 && m_blupiPhase == 12) + { + m_blupiAction = 1; + m_blupiPhase = 0; + if (m_blupiDir == 1) + { + m_blupiDir = 2; + } + else + { + m_blupiDir = 1; + } + } + } + else if (m_blupiSkate) + { + if (m_blupiAction == 3 && m_blupiPhase == 14) + { + m_blupiAction = 1; + m_blupiPhase = 0; + if (m_blupiDir == 1) + { + m_blupiDir = 2; + } + else + { + m_blupiDir = 1; + } + } + } + else if (m_blupiNage || m_blupiSurf) + { + if (m_blupiAction == 3 && m_blupiPhase == 10) + { + m_blupiAction = 2; + if (m_blupiDir == 1) + { + m_blupiDir = 2; + } + else + { + m_blupiDir = 1; + } + } + } + else if (m_blupiSuspend) + { + if (m_blupiAction == 3 && m_blupiPhase == 10) + { + m_blupiAction = 1; + m_blupiPhase = 0; + if (m_blupiDir == 1) + { + m_blupiDir = 2; + } + else + { + m_blupiDir = 1; + } + } + } + else + { + if (m_blupiAction == 3 && m_blupiPhase == 6) + { + m_blupiAction = 1; + m_blupiPhase = 0; + if (m_blupiDir == 1) + { + m_blupiDir = 2; + } + else + { + m_blupiDir = 1; + } + } + if (m_blupiAction == 59 && m_blupiPhase == 6) + { + m_blupiAction = 5; + m_blupiPhase = 0; + } + } + if (!m_blupiSuspend && m_blupiAction == 4 && m_blupiPhase == 3) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_blupiSpeedX == 0 && m_blupiSpeedY == 0 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) + { + if (m_blupiAction == 14 || m_blupiAction == 7) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_blupiAction == 2) + { + if (m_blupiSuspend || m_blupiPhase < 10) + { + m_blupiAction = 1; + } + else + { + m_blupiAction = 60; + } + m_blupiPhase = 0; + } + if (m_blupiAction == 6) + { + m_blupiAction = 1; + m_blupiPhase = 0; + PlaySound(20, tinyPoint3); + } + m_scrollAdd.y = 0; + if (blupiAction == 14) + { + StopSound(38); + } + if (blupiAction == 29 || blupiAction == 28) + { + StopSound(39); + } + } + if (!m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) + { + if (m_blupiAction == 9 && m_blupiDir == 1) + { + tinyPoint3.x += 4; + } + if (m_blupiAction == 9 && m_blupiDir == 2) + { + tinyPoint3.x -= 4; + } + if (m_blupiAction == 10 && m_blupiDir == 1) + { + tinyPoint3.x -= 4; + } + if (m_blupiAction == 10 && m_blupiDir == 2) + { + tinyPoint3.x += 4; + } + } + if ((m_keyPress & -3) == 0 && m_blupiSpeedX == 0 && m_blupiSpeedY == 0 && (m_blupiJeep || m_blupiTank || m_blupiSkate) && m_blupiFocus) + { + if (m_blupiAction == 10 && m_blupiDir == 1) + { + tinyPoint3.x -= 5; + } + if (m_blupiAction == 10 && m_blupiDir == 2) + { + tinyPoint3.x += 5; + } + } + if ((m_keyPress & -3) == 0 && m_blupiNage && m_blupiFocus && m_blupiAction == 2) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if ((m_keyPress & -3) == 0 && m_blupiSurf && m_blupiFocus && m_blupiAction == 2) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_blupiHelico && (m_blupiFocus || m_blupiAction == 58)) + { + if ((m_keyPress & 2) != 0 && m_blupiTimeFire == 0 && m_blupiAction != 3 && m_blupiAction != 58 && flag4) + { + if (m_blupiBullet == 0) + { + PlaySound(53, m_blupiPos); + } + else + { + m_blupiAction = 58; + m_blupiPhase = 0; + m_blupiFocus = false; + } + } + ////m_blupiMotorHigh = flag4; + if (m_blupiAction != 3 && m_blupiAction != 58) + { + if (flag4) + { + m_blupiAction = 2; + } + else + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiVitesse.y = 0; + } + } + + { + if (m_blupiSpeedY <= -1 || (m_keyPress & 1) != 0) + { + if (m_blupiVitesse.y > -10) + { + m_blupiVitesse.y -= 0.5; + } + } + else if (m_blupiSpeedY >= 1) + { + if (m_blupiVitesse.y < 12) + { + m_blupiVitesse.y += 0.5; + } + } + else + { + if (m_blupiVitesse.y > 1) + { + m_blupiVitesse.y -= 1; + } + if (m_blupiVitesse.y < 1) + { + m_blupiVitesse.y += 1; + } + } + tinyPoint3.y += (int)m_blupiVitesse.y; + } + if (FALSE) + { + if (m_blupiSpeedX <= -1) + { + int num5 = (int)(m_blupiSpeedX * 12); + if (m_blupiVitesse.x > num5) + { + m_blupiVitesse.x -= 0.5; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, -1)) + { + m_blupiVitesse.x = 0; + } + } + else if (m_blupiSpeedX >= 1) + { + int num6 = (int)(m_blupiSpeedX * 12); + if (m_blupiVitesse.x < num6) + { + m_blupiVitesse.x += 0.5; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, 1)) + { + m_blupiVitesse.x = 0; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 2; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 2; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + tinyPoint3.x += (int)m_blupiVitesse.x; + } + else + { + if (m_blupiSpeedX <= -1) + { + int num7 = (int)(m_blupiSpeedX * 16); + if (m_blupiVitesse.x > num7) + { + m_blupiVitesse.x -= 1; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, -1)) + { + m_blupiVitesse.x = 0; + } + } + else if (m_blupiSpeedX >= 1) + { + int num8 = (int)(m_blupiSpeedX * 16); + if (m_blupiVitesse.x < num8) + { + m_blupiVitesse.x += 1; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, 1)) + { + m_blupiVitesse.x = 0; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 2; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 2; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + tinyPoint3.x += (int)m_blupiVitesse.x; + } + MoveObjectPollution(); + if ( !flag4 && m_blupiTransport == -1) + { + + rect.left = m_blupiPos.x + 20; + rect.right = m_blupiPos.x + 22; + rect.top = m_blupiPos.y + 60 - 2; + rect.bottom = m_blupiPos.y + 60; + flag2 = !DecorDetect(rect); + rect.left = m_blupiPos.x + 60 - 22; + rect.right = m_blupiPos.x + 60 - 20; + rect.top = m_blupiPos.y + 60 - 2; + rect.bottom = m_blupiPos.y + 60; + flag3 = !DecorDetect(rect); + if (!flag2 && !flag3) + { + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; + ObjectStart(tinyPoint, 13, 0); + m_blupiHelico = false; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiPosHelico = m_blupiPos; + m_blupiFocus = true; + StopSound(16); + StopSound(18); + PlaySound(17, m_blupiPos); + } + } + } + if (m_blupiOver && (m_blupiFocus || m_blupiAction == 58)) + { + ////m_blupiMotorHigh = flag4; + if (m_blupiAction != 3) + { + if (flag4) + { + m_blupiAction = 2; + } + else + { + if (m_blupiAction != 1) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + m_blupiVitesse.y = 0; + } + } + rect = BlupiRect(tinyPoint3); + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60 + OVERHEIGHT - 1; + bool flag7 = !DecorDetect(rect); + num = MoveAscenseurDetect(m_blupiPos, OVERHEIGHT); + if (num != -1) + { + flag7 = false; + } + if (((m_keyPress & 1) != 0) && !flag7) + { + if (m_blupiVitesse.y == 0 && num != -1) + { + m_blupiVitesse.y = -5; + } + else if (m_blupiVitesse.y > -5) + { + m_blupiVitesse.y -= 1; + } + } + else if (m_blupiSpeedY > 0) + { + if (m_blupiVitesse.y < 12) + { + m_blupiVitesse.y += 5; + } + } + else if (m_blupiVitesse.y < 12 && m_time % 2 == 0) + { + m_blupiVitesse.y += 1; + } + tinyPoint3.y += (int)m_blupiVitesse.y; + if (m_blupiSpeedX < 0 && flag4) + { + int num9 = (int)(m_blupiSpeedX * 12); + if (m_blupiVitesse.x > num9) + { + m_blupiVitesse.x -= 1; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, -1)) + { + m_blupiVitesse.x = 0; + } + } + else if (m_blupiSpeedX > 0 && flag4) + { + int num10 = (int)(m_blupiSpeedX * 12); + if (m_blupiVitesse.x < num10) + { + m_blupiVitesse.x += 1; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, 1)) + { + m_blupiVitesse.x = 0; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 1; + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 1; + } + } + tinyPoint3.x += (int)m_blupiVitesse.x; + MoveObjectPollution(); + if ( !flag4 && m_blupiTransport == -1) + { + + rect.left = m_blupiPos.x + 20; + rect.right = m_blupiPos.x + 22; + rect.top = m_blupiPos.y + 60 - 2; + rect.bottom = m_blupiPos.y + 60; + flag2 = !DecorDetect(rect); + rect.left = m_blupiPos.x + 60 - 22; + rect.right = m_blupiPos.x + 60 - 20; + rect.top = m_blupiPos.y + 60 - 2; + rect.bottom = m_blupiPos.y + 60; + flag3 = !DecorDetect(rect); + if (!flag2 && !flag3) + { + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; + ObjectStart(tinyPoint, 46, 0); + m_blupiOver = false; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiPosHelico = m_blupiPos; + m_blupiFocus = true; + StopSound(16); + StopSound(18); + PlaySound(17, m_blupiPos); + } + } + } + if (m_blupiBalloon && m_blupiFocus) + { + if ((m_keyPress & 1) != 0) + { + if (m_blupiVitesse.y > -5 && m_time % 6 == 0) + { + m_blupiVitesse.y -= 1; + } + } + else if (m_blupiSpeedY > 0) + { + if (m_blupiVitesse.y < 0 && m_time % 6 == 0) + { + m_blupiVitesse.y += 1; + } + } + else if (m_blupiVitesse.y > -3 && m_time % 6 == 0) + { + m_blupiVitesse.y -= 1; + } + tinyPoint3.y += (int)m_blupiVitesse.y; + if (m_blupiSpeedX < 0) + { + int num11 = (int)(m_blupiSpeedX * 10); + if (m_blupiVitesse.x > num11) + { + m_blupiVitesse.x -= 1; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, -1)) + { + m_blupiVitesse.x = 0; + } + } + else if (m_blupiSpeedX > 0) + { + int num12 = (int)(m_blupiSpeedX * 10); + if (m_blupiVitesse.x < num12) + { + m_blupiVitesse.x += 1; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, 1)) + { + m_blupiVitesse.x = 0; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 2; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 2; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + tinyPoint3.x += (int)m_blupiVitesse.x; + } + if (m_blupiEcrase && m_blupiFocus) + { + if (flag4) + { + if (m_blupiVitesse.y < 2) + { + m_blupiVitesse.y += 1; + } + } + else + { + m_blupiVitesse.y = 0; + } + tinyPoint3.y += (int)m_blupiVitesse.y; + if (flag4) + { + num3 = 7; + } + else + { + num3 = 4; + } + num3 = (int)(num3 * m_blupiSpeedX); + if (m_blupiSpeedX < 0) + { + if (m_blupiVitesse.x > num3) + { + m_blupiVitesse.x -= 1; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, -1)) + { + m_blupiVitesse.x = 0; + } + } + else if (m_blupiSpeedX > 0) + { + if (m_blupiVitesse.x < num3) + { + m_blupiVitesse.x += 1; + } + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; + if (BlupiBloque(tinyPoint, 1)) + { + m_blupiVitesse.x = 0; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 2; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 2; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + if (m_blupiVitesse.x == 0 && !flag4) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + tinyPoint3.x += (int)m_blupiVitesse.x; + } + if (m_blupiJeep && m_blupiFocus) + { + if (m_blupiVitesse.x == 0 && m_blupiAction == 2) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + //m_blupiMotorHigh = (m_blupiAction != 1); + rect = BlupiRect(tinyPoint3); + rect.right -= 40; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60 - 1; + bool flag8 = !DecorDetect(rect); + rect.left += 40; + rect.right += 40; + bool flag9 = !DecorDetect(rect); + if (flag4) + { + if (m_blupiVitesse.y < 50) + { + m_blupiVitesse.y += 5; + } + } + else + { + if (m_blupiVitesse.y != 0) + { + PlaySound(3, m_blupiPos); + } + m_blupiVitesse.y = 0; + } + tinyPoint3.y += (int)m_blupiVitesse.y; + if (m_blupiTransport == -1) + { + rect.left = tinyPoint3.x + 20; + rect.right = tinyPoint3.x + 60 - 20; + rect.top = tinyPoint3.y + 60 - 35; + rect.bottom = tinyPoint3.y + 60 - 1; + num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); + if (m_blupiVitesse.y >= 0 && num != -1) + { + m_blupiTransport = num; + flag4 = false; + PlaySound(3, tinyPoint3); + tinyPoint3.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY; + } + } + if (flag8 && !flag9) + { + int num13 = -20; + if (m_blupiVitesse.x > num13) + { + m_blupiVitesse.x -= 1; + } + } + else if (!flag8 && flag9) + { + int num14 = 20; + if (m_blupiVitesse.x < num14) + { + m_blupiVitesse.x += 1; + } + } + else if (m_blupiSpeedX < 0) + { + int num15 = (int)(m_blupiSpeedX * 20); + if (m_blupiVitesse.x > num15) + { + m_blupiVitesse.x -= 1; + } + } + else if (m_blupiSpeedX > 0) + { + int num16 = (int)(m_blupiSpeedX * 20); + if (m_blupiVitesse.x < num16) + { + m_blupiVitesse.x += 1; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 2; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 2; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + if (m_blupiAction == 3) + { + m_blupiVitesse.x = 0; + } + tinyPoint3.x += (int)m_blupiVitesse.x; + MoveObjectPollution(); + if ( !flag4 && m_blupiTransport == -1) + { + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; + ObjectStart(tinyPoint, 19, 0); + m_blupiJeep = false; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiPosHelico = m_blupiPos; + StopSound(29); + StopSound(31); + PlaySound(30, m_blupiPos); + } + } + if (m_blupiTank && m_blupiFocus) + { + if (m_blupiAction == 53 && m_blupiPhase == 6) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if ((m_keyPress & 2) != 0 && m_blupiTimeFire == 0 && m_blupiAction != 3) + { + if (m_blupiBullet == 0) + { + PlaySound(53, m_blupiPos); + } + else + { + if (m_blupiDir == 1) + { + tinyPoint.x = m_blupiPos.x - 35; + tinyPoint.y = m_blupiPos.y; + num4 = -5; + m_blupiVitesse.x += 12; + } + else + { + tinyPoint.x = m_blupiPos.x + 35; + tinyPoint.y = m_blupiPos.y; + num4 = 5; + m_blupiVitesse.x -= 12; + } + if (ObjectStart(tinyPoint, 23, num4) != -1) + { + m_blupiAction = 53; + m_blupiPhase = 0; + PlaySound(52, m_blupiPos); + m_blupiTimeFire = 10; + m_blupiBullet--; + } + } + } + if (m_blupiVitesse.x == 0 && m_blupiAction == 2) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + //m_blupiMotorHigh = (m_blupiAction != 1); + if (flag4) + { + if (m_blupiVitesse.y < 50) + { + m_blupiVitesse.y += 5; + } + } + else + { + if (m_blupiVitesse.y != 0) + { + PlaySound(3, m_blupiPos); + } + m_blupiVitesse.y = 0; + } + tinyPoint3.y += (int)m_blupiVitesse.y; + if (m_blupiTransport == -1) + { + rect.left = tinyPoint3.x + 20; + rect.right = tinyPoint3.x + 60 - 20; + rect.top = tinyPoint3.y + 60 - 35; + rect.bottom = tinyPoint3.y + 60 - 1; + num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); + if (m_blupiVitesse.y >= 0 && num != -1) + { + m_blupiTransport = num; + flag4 = false; + PlaySound(3, tinyPoint3); + tinyPoint3.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY; + } + } + if (m_blupiSpeedX < 0) + { + int num17 = (int)(m_blupiSpeedX * 12); + if (m_blupiVitesse.x > num17) + { + m_blupiVitesse.x -= 1; + } + } + else if (m_blupiSpeedX > 0) + { + int num18 = (int)(m_blupiSpeedX * 12); + if (m_blupiVitesse.x < num18) + { + m_blupiVitesse.x += 1; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 3; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 3; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + if (m_blupiAction == 3) + { + m_blupiVitesse.x = 0; + } + tinyPoint3.x += (int)m_blupiVitesse.x; + MoveObjectPollution(); + if ( !flag4 && m_blupiTransport == -1) + { + + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y; + ObjectStart(tinyPoint, 28, 0); + m_blupiTank = false; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiPosHelico = m_blupiPos; + StopSound(29); + StopSound(31); + PlaySound(30, m_blupiPos); + } + } + if (m_blupiSkate && m_blupiFocus) + { + if (m_blupiVitesse.x == 0 && m_blupiAction == 2) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_blupiSpeedX < 0) + { + int num19 = (int)(m_blupiSpeedX * 15); + if (m_blupiVitesse.x > num19) + { + m_blupiVitesse.x -= 1; + } + } + else if (m_blupiSpeedX > 0) + { + int num20 = (int)(m_blupiSpeedX * 15); + if (m_blupiVitesse.x < num20) + { + m_blupiVitesse.x += 1; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 1; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 1; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + if (m_blupiAction == 3) + { + m_blupiVitesse.x = 0; + } + tinyPoint3.x += (int)m_blupiVitesse.x; + if ( !flag4 && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesse.x < 8) + { + + m_blupiSkate = false; + m_blupiAction = 43; + m_blupiPhase = 0; + m_blupiFocus = false; + m_blupiPosHelico = m_blupiPos; + } + } + if (m_blupiAction == 42) + { + if (m_blupiPhase == 8) + { + num = MoveObjectDetect(m_blupiPos, &flag6); + if (num != -1) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + } + } + if (m_blupiPhase == 20) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + } + if (m_blupiAction == 43) + { + if (m_blupiPhase == 12) + { + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - BLUPIFLOOR + 1; + ObjectStart(tinyPoint, 24, 0); + } + if (m_blupiPhase == 20) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + } + if (m_blupiNage && m_blupiFocus) + { + if (m_blupiTransport == -1) + { + if ((m_keyPress & 1) != 0) + { + if (m_blupiVitesse.y > -5) + { + m_blupiVitesse.y -= 1; + } + } + else if (m_blupiVitesse.y < 5) + { + m_blupiVitesse.y += 1; + + } + else + { + if (m_blupiAction == 1) + { + num3 = -1; + } + else + { + num3 = 0; + } + if (m_blupiVitesse.y > num3) + { + m_blupiVitesse.y -= 1; + } + if (m_blupiVitesse.y < num3) + { + m_blupiVitesse.y += 1; + } + } + tinyPoint3.y += (int)m_blupiVitesse.y; + } + if (m_blupiSpeedX < 0) + { + int num21 = (int)(m_blupiSpeedX * 8); + if (m_blupiVitesse.x > num21) + { + m_blupiVitesse.x -= 1; + } + } + else if (m_blupiSpeedX > 0) + { + int num22 = (int)(m_blupiSpeedX * 8); + if (m_blupiVitesse.x < num22) + { + m_blupiVitesse.x += 1; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 2; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 2; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + num = table_vitesse_nage[m_blupiPhase % 14 / 2]; + tinyPoint3.x += (int)(m_blupiVitesse.x * num / 7); + if (m_time % 70 == 0 || m_time % 70 == 28) + { + MoveObjectBlup(tinyPoint3); + } + if (m_time % 5 == 0) + { + if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + m_blupiLevel--; + } + if (m_blupiLevel == 25) + { + //m_jauges[0].SetMode(1); + } + m_jauges[0].SetLevel(m_blupiLevel); + if (m_blupiLevel == 0) + { + m_blupiAction = 24; + m_blupiPhase = 0; + m_blupiFocus = false; + m_blupiHelico = false; + m_blupiOver = false; + m_blupiJeep = false; + m_blupiTank = false; + m_blupiSkate = false; + m_blupiNage = false; + m_blupiSurf = false; + m_blupiSuspend = false; + m_blupiJumpAie = false; + m_blupiShield = false; + m_blupiPower = false; + m_blupiCloud = false; + m_blupiHide = false; + m_blupiInvert = false; + m_blupiBalloon = false; + m_blupiEcrase = false; + m_blupiAir = false; + m_blupiRestart = true; + m_blupiActionOuf = 0; + m_jauges[0].SetHide(true); + m_jauges[1].SetHide(true); + PlaySound(26, tinyPoint3); + } + } + } + if (m_blupiSurf && m_blupiFocus) + { + if (m_blupiTransport == -1) + { + if ((m_keyPress & 1) != 0) + { + if (m_blupiVitesse.y > -5) + { + m_blupiVitesse.y -= 1; + } + } + else if (m_blupiSpeedY > 0) + { + if (m_blupiVitesse.y < 5) + { + m_blupiVitesse.y += 1; + } + } + else + { + if (m_blupiVitesse.y > -2) + { + m_blupiVitesse.y -= 1; + } + if (m_blupiVitesse.y < -2) + { + m_blupiVitesse.y += 1; + } + } + tinyPoint3.y += (int)m_blupiVitesse.y; + tinyPoint3.y += BLUPISURF; + if (tinyPoint3.y % 64 > 30) + { + tinyPoint3.y += 64 - tinyPoint3.y % 64; + } + tinyPoint3.y -= BLUPISURF; + } + if (m_blupiSpeedX < 0) + { + int num23 = (int)(m_blupiSpeedX * 8); + if (m_blupiVitesse.x > num23) + { + m_blupiVitesse.x -= 1; + } + } + else if (m_blupiSpeedX > 0) + { + int num24 = (int)(m_blupiSpeedX * 8); + if (m_blupiVitesse.x < num24) + { + m_blupiVitesse.x += 1; + } + } + else + { + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x -= 2; + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x = 0; + } + } + if (m_blupiVitesse.x < 0) + { + m_blupiVitesse.x += 2; + if (m_blupiVitesse.x > 0) + { + m_blupiVitesse.x = 0; + } + } + } + num = table_vitesse_surf[m_blupiPhase % 12 / 2]; + tinyPoint3.x += (int)(m_blupiVitesse.x * num / 10); + } + POINT tinyPoint4; + if (m_blupiSuspend && m_blupiFocus) + { + if (m_blupiSpeedX < 0 && m_blupiAction == 2) + { + int num25 = (int)(m_blupiSpeedX * 5); + tinyPoint3.x += num25; + } + if (m_blupiSpeedX > 0 && m_blupiAction == 2) + { + int num26 = (int)(m_blupiSpeedX * 5); + tinyPoint3.x += num26; + } + num = GetTypeBarre(tinyPoint3); + if (num == 2) + { + tinyPoint4.x = tinyPoint3.x; + tinyPoint4.y = tinyPoint3.y / 64 * 64 + BLUPIOFFY; + rect = BlupiRect(tinyPoint4); + if (!DecorDetect(rect, true)) + { + m_blupiSuspend = false; + m_blupiAction = 1; + m_blupiPhase = 0; + tinyPoint3 = tinyPoint4; + m_blupiPos = tinyPoint3; + } + } + if ((m_blupiSpeedY > 0 && m_blupiPhase > 5) || num == 0) + { + m_blupiSuspend = false; + m_blupiAir = true; + m_blupiAction = 5; + tinyPoint3.y = tinyPoint3.y; + m_blupiVitesse.y = 0; + m_blupiNoBarre = 5; + m_blupiActionOuf = 65; + m_blupiTimeOuf = 0; + } + if (((m_keyPress & 1) != 0 || m_blupiSpeedY < 0) && m_blupiAction != 4 && m_blupiAction != 3) + { + m_blupiAction = 4; + m_blupiPhase = 0; + } + if ((m_keyPress & 1) == 0 && m_blupiSpeedY == 0 && m_blupiAction == 4) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_blupiAction == 4 && m_blupiPhase == 10) + { + m_blupiSuspend = false; + m_blupiAir = true; + m_blupiAction = 5; + m_blupiPhase = 0; + tinyPoint3.y -= 2; + m_blupiVitesse.y = -11; + m_blupiNoBarre = 5; + PlaySound(35, tinyPoint3); + } + } + if ( !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiTank && !m_blupiJeep && !m_blupiSkate && !flag4 && m_blupiTransport == -1 && m_blupiFocus) + { + if (m_blupiDynamite > 0) + { + + rect.left = tinyPoint3.x + 18; + rect.right = tinyPoint3.x + 20; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag2 = !DecorDetect(rect); + rect.left = tinyPoint3.x + 60 - 20; + rect.right = tinyPoint3.x + 60 - 18; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag3 = !DecorDetect(rect); + if (!flag2 && !flag3 && ObjectStart(tinyPoint3, 56, 0) != -1) + { + m_blupiAction = 87; + m_blupiPhase = 0; + m_blupiFocus = false; + PlaySound(61, tinyPoint3); + m_blupiDynamite--; + } + } + else if (m_blupiPerso > 0) + { + num = MoveObjectDetect(tinyPoint3, &flag6); + if (num == -1 || m_moveObject[num].type != 200) + { + rect.left = tinyPoint3.x + 18; + rect.right = tinyPoint3.x + 20; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag2 = !DecorDetect(rect); + rect.left = tinyPoint3.x + 60 - 20; + rect.right = tinyPoint3.x + 60 - 18; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag3 = !DecorDetect(rect); + num = MoveChargeDetect(tinyPoint3); + if (num == -1 && !flag2 && !flag3 && ObjectStart(tinyPoint3, 200, 0) != -1) + { + m_blupiAction = 46; + m_blupiPhase = 0; + m_blupiFocus = false; + PlaySound(61, tinyPoint3); + m_blupiPerso--; + } + } + if (m_blupiFocus) + { + m_blupiAction = 47; + m_blupiPhase = 0; + PlaySound(27, tinyPoint3); + } + } + } + rect = BlupiRect(m_blupiPos); + tinyPoint4 = tinyPoint3; + TestPath(rect, m_blupiPos,tinyPoint3); + if (flag && m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) + { + tinyPoint3.y = tinyPoint4.y; + TestPath(rect, m_blupiPos, tinyPoint3); + } + if (m_blupiVent && m_blupiPos.y == tinyPoint3.y && m_blupiPos.y != tinyPoint4.y) + { + tinyPoint3.x = tinyPoint4.x; + TestPath(rect, m_blupiPos, tinyPoint3); + } + if (m_blupiTransport != -1 && m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) + { + tinyPoint3.y = tinyPoint4.y; + TestPath(rect, m_blupiPos, tinyPoint3); + } + if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate || m_blupiNage) + { + if (m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) + { + tinyPoint3.y = tinyPoint4.y; + TestPath(rect, m_blupiPos, tinyPoint3); + } + else if (m_blupiPos.y == tinyPoint3.y && m_blupiPos.y != tinyPoint4.y) + { + tinyPoint3.x = tinyPoint4.x; + TestPath(rect, m_blupiPos, tinyPoint3); + } + } + POINT blupiPos = m_blupiPos; + m_blupiPos = tinyPoint3; + if ((m_blupiAction == 1 || m_blupiAction == 60 || m_blupiAction == 7 || m_blupiAction == 6) && !m_blupiAir && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + if (m_blupiTransport != -1) + { + AscenseurVertigo(m_blupiTransport, &flag2, &flag3); + } + else + { + rect.left = tinyPoint3.x + 24; + rect.right = tinyPoint3.x + 26; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag2 = !DecorDetect(rect); + rect.left = tinyPoint3.x + 60 - 26; + rect.right = tinyPoint3.x + 60 - 24; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag3 = !DecorDetect(rect); + } + if (m_blupiDir == 1 && flag2 && !flag3) + { + if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport)) + { + m_blupiAction = 9; + m_blupiPhase = 0; + } + else + { + PlaySound(6, tinyPoint3); + m_blupiAction = 8; + m_blupiPhase = 0; + } + } + if (m_blupiDir == 2 && !flag2 && flag3) + { + if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport)) + { + m_blupiAction = 9; + m_blupiPhase = 0; + } + else + { + PlaySound(6, tinyPoint3); + m_blupiAction = 8; + m_blupiPhase = 0; + } + } + if (m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && (flag2 || flag3)) + { + if (!m_blupiHelico && !m_blupiOver) + { + PlaySound(6, tinyPoint3); + } + m_blupiAction = 10; + m_blupiPhase = 0; + } + } + if (m_blupiAction == 1 && m_blupiJeep && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + if (m_blupiTransport != -1) + { + AscenseurVertigo(m_blupiTransport, &flag2, &flag3); + } + else + { + rect.left = tinyPoint3.x + 2; + rect.right = tinyPoint3.x + 18; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag2 = !DecorDetect(rect); + rect.left = tinyPoint3.x + 60 - 18; + rect.right = tinyPoint3.x + 60 - 2; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag3 = !DecorDetect(rect); + } + if (flag2 && !flag3) + { + m_blupiAction = 10; + m_blupiPhase = 0; + } + if (flag3 && !flag2) + { + m_blupiAction = 10; + m_blupiPhase = 0; + } + } + if (m_blupiAction == 1 && m_blupiTank && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + if (m_blupiTransport != -1) + { + AscenseurVertigo(m_blupiTransport, &flag2, &flag3); + } + else + { + rect.left = tinyPoint3.x + 2; + rect.right = tinyPoint3.x + 18; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag2 = !DecorDetect(rect); + rect.left = tinyPoint3.x + 60 - 18; + rect.right = tinyPoint3.x + 60 - 2; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag3 = !DecorDetect(rect); + } + if (flag2 && !flag3) + { + m_blupiAction = 10; + m_blupiPhase = 0; + } + if (flag3 && !flag2) + { + m_blupiAction = 10; + m_blupiPhase = 0; + } + } + if (m_blupiAction == 1 && m_blupiSkate && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + if (m_blupiTransport != -1) + { + AscenseurVertigo(m_blupiTransport, &flag2, &flag3); + } + else + { + rect.left = tinyPoint3.x + 12; + rect.right = tinyPoint3.x + 19; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag2 = !DecorDetect(rect); + rect.left = tinyPoint3.x + 60 - 19; + rect.right = tinyPoint3.x + 60 - 12; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; + flag3 = !DecorDetect(rect); + } + if (flag2 && !flag3) + { + m_blupiAction = 10; + m_blupiPhase = 0; + } + if (flag3 && !flag2) + { + m_blupiAction = 10; + m_blupiPhase = 0; + } + } + if (m_blupiFocus) + { + if (m_blupiAction == 8 && m_blupiPhase == 16) + { + m_blupiAction = 9; + m_blupiPhase = 0; + } + if (m_blupiAction == 9 && m_blupiPhase == 3) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiActionOuf = 0; + } + num3 = 5; + if (m_blupiJeep) + { + num3 = 10; + } + if (m_blupiTank) + { + num3 = 10; + } + if (m_blupiSkate) + { + num3 = 10; + } + if (m_blupiAction == 10 && m_blupiPhase == num3) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + } + BlupiSearchIcon(); + if (m_blupiShield) + { + if (m_blupiTimeShield == 10) + { + PlaySound(43, m_blupiPos); + } + if (m_blupiTimeShield == 0) + { + m_blupiShield = false; + m_jauges[1].SetHide(true); + } + else if (m_time % 5 == 0) + { + m_blupiTimeShield--; + m_jauges[1].SetLevel(m_blupiTimeShield); + } + } + if (m_blupiPower) + { + if (m_blupiTimeShield == 20) + { + PlaySound(45, m_blupiPos); + } + if (m_blupiTimeShield == 0) + { + m_blupiPower = false; + m_jauges[1].SetHide(true); + } + else if (m_time % 3 == 0) + { + m_blupiTimeShield--; + m_jauges[1].SetLevel(m_blupiTimeShield); + } + } + if (m_blupiCloud) + { + if (m_blupiTimeShield == 25) + { + PlaySound(56, m_blupiPos); + } + if (m_blupiTimeShield == 0) + { + m_blupiCloud = false; + m_jauges[1].SetHide(true); + } + else if (m_time % 4 == 0) + { + m_blupiTimeShield--; + m_jauges[1].SetLevel(m_blupiTimeShield); + } + } + if (m_blupiHide) + { + if (m_blupiTimeShield == 20) + { + PlaySound(63, m_blupiPos); + } + if (m_blupiTimeShield == 0) + { + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + else if (m_time % 4 == 0) + { + m_blupiTimeShield--; + m_jauges[1].SetLevel(m_blupiTimeShield); + } + } + if (m_blupiInvert) + { + if (m_blupiTimeShield == 0) + { + m_blupiInvert = false; + m_jauges[1].SetHide(true); + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y + 100; + ObjectStart(tinyPoint, 42, -60); + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - 100; + ObjectStart(tinyPoint, 42, 60); + tinyPoint.x = m_blupiPos.x - 100; + tinyPoint.y = m_blupiPos.y; + ObjectStart(tinyPoint, 42, 10); + tinyPoint.x = m_blupiPos.x + 100; + tinyPoint.y = m_blupiPos.y; + ObjectStart(tinyPoint, 42, -10); + PlaySound(67, tinyPoint3); + } + else if (m_time % 3 == 0) + { + m_blupiTimeShield--; + m_jauges[1].SetLevel(m_blupiTimeShield); + } + } + if (m_blupiBalloon) + { + if (m_blupiTimeShield == 0) + { + m_blupiBalloon = false; + m_jauges[1].SetHide(true); + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; + ObjectStart(tinyPoint, 91, 0); + PlaySound(41, m_blupiPos); + } + else if (m_time % 2 == 0) + { + m_blupiTimeShield--; + m_jauges[1].SetLevel(m_blupiTimeShield); + } + } + if (m_blupiEcrase) + { + if (m_blupiTimeShield == 0) + { + m_blupiEcrase = false; + m_blupiAir = true; + m_jauges[1].SetHide(true); + ObjectStart(m_blupiPos, 41, -60); + ObjectStart(m_blupiPos, 41, 60); + ObjectStart(m_blupiPos, 41, 10); + ObjectStart(m_blupiPos, 41, -10); + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; + ObjectStart(tinyPoint, 90, 0); + PlaySound(41, m_blupiPos); + } + else if (m_time % 2 == 0) + { + m_blupiTimeShield--; + m_jauges[1].SetLevel(m_blupiTimeShield); + } + } + if (m_blupiPower && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40) + { + num = MoveObjectFree(); + if (num != -1) + { + m_moveObject[num].type = 27; + m_moveObject[num].phase = 0; + m_moveObject[num].posCurrent = m_blupiPos; + m_moveObject[num].posStart = m_moveObject[num].posCurrent; + m_moveObject[num].posEnd = m_moveObject[num].posCurrent; + m_moveObject[num].step = 1; + m_moveObject[num].time = 0; + MoveObjectStepIcon(num); + m_blupiPosMagic = m_blupiPos; + } + } + if (m_blupiShield && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40) + { + num = MoveObjectFree(); + if (num != -1) + { + m_moveObject[num].type = 57; + m_moveObject[num].phase = 0; + m_moveObject[num].posCurrent = m_blupiPos; + m_moveObject[num].posStart = m_moveObject[num].posCurrent; + m_moveObject[num].posEnd = m_moveObject[num].posCurrent; + m_moveObject[num].step = 1; + m_moveObject[num].time = 0; + MoveObjectStepIcon(num); + m_blupiPosMagic = m_blupiPos; + } + } + if (m_blupiHide && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 10) + { + num = MoveObjectFree(); + if (num != -1) + { + m_moveObject[num].type = 58; + m_moveObject[num].icon = m_blupiIcon; + m_moveObject[num].channel = 2; + m_moveObject[num].phase = 0; + m_moveObject[num].posCurrent = m_blupiPos; + m_moveObject[num].posStart = m_moveObject[num].posCurrent; + m_moveObject[num].posEnd = m_moveObject[num].posCurrent; + m_moveObject[num].step = 1; + m_moveObject[num].time = 0; + MoveObjectStepIcon(num); + m_blupiPosMagic = m_blupiPos; + } + } + if (m_blupiTimeNoAsc > 0) + { + m_blupiTimeNoAsc--; + } + if (m_blupiHelico && m_blupiPos.y > 2 && m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + rect = BlupiRect(tinyPoint3); + rect.top = tinyPoint3.y + 4; + rect.bottom = tinyPoint3.y + 20; + if (DecorDetect(rect)) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiHelico = false; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; + ObjectStart(tinyPoint, 9, 0); + m_decorAction = 1; + m_decorPhase = 0; + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(10, m_blupiPos); + } + } + if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) + { + if (!m_blupiNage && !m_blupiSurf && IsSurfWater(m_blupiPos)) + { + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; + m_blupiAir = false; + m_blupiNage = false; + m_blupiSurf = true; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = 0; + MoveObjectPlouf(m_blupiPos); + if (m_blupiTransport != -1) + { + m_blupiPos.y = m_blupiPos.y - 10; + m_blupiTransport = -1; + } + if (m_blupiCloud) + { + m_blupiCloud = false; + m_jauges[1].SetHide(true); + } + } + if (!m_blupiNage && !IsSurfWater(m_blupiPos) && IsDeepWater(m_blupiPos)) + { + if (!m_blupiSurf) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = 0; + MoveObjectPlouf(m_blupiPos); + } + m_blupiAir = false; + m_blupiSurf = false; + m_blupiNage = true; + m_blupiLevel = 100; + m_jauges[0].SetLevel(m_blupiLevel); + //m_jauges[0].SetMode(2); + m_jauges[0].SetHide(false); + } + if (m_blupiNage && IsSurfWater(m_blupiPos)) + { + m_blupiAir = false; + m_blupiNage = false; + m_blupiSurf = true; + PlaySound(25, m_blupiPos); + m_jauges[0].SetHide(true); + } + tinyPoint4.x = m_blupiPos.x; + tinyPoint4.y = m_blupiPos.y - 60; + if ((m_blupiSurf || m_blupiNage) && (m_blupiPos.y % 64 == 64 - BLUPISURF || m_blupiPos.y % 64 == 32) && IsOutWater(tinyPoint4) && (m_keyPress & 1) != 0) + { + m_blupiNage = false; + m_blupiSurf = false; + m_blupiAir = true; + m_blupiAction = 5; + m_blupiPhase = 0; + m_blupiVitesse.x = 0; + if (m_blupiPower) + { + m_blupiVitesse.y = -16; + } + else + { + m_blupiVitesse.y = -12; + } + MoveObjectTiplouf(m_blupiPos); + PlaySound(22, m_blupiPos); + m_jauges[0].SetHide(true); + } + if ((m_blupiSurf || m_blupiNage) && IsOutWater(m_blupiPos)) + { + if (m_blupiVitesse.y < 0) + { + if (m_blupiTransport == -1) + { + m_blupiPos = blupiPos; + } + else + { + m_blupiTransport = -1; + m_blupiNage = false; + m_blupiSurf = false; + m_blupiAir = true; + m_blupiAction = 5; + m_blupiPhase = 0; + m_blupiPos.y = m_blupiPos.y - 10; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = -10; + PlaySound(22, m_blupiPos); + m_jauges[0].SetHide(true); + } + } + else if (m_blupiVitesse.y > 0) + { + m_blupiNage = false; + m_blupiSurf = false; + m_blupiAir = false; + m_blupiAction = 5; + m_blupiPhase = 0; + m_blupiPos.y = m_blupiPos.y + 30; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = 0; + PlaySound(22, m_blupiPos); + m_jauges[0].SetHide(true); + } + else + { + m_blupiNage = false; + m_blupiSurf = false; + m_blupiAir = false; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiPos.y = m_blupiPos.y - 10; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = 0; + PlaySound(22, m_blupiPos); + m_jauges[0].SetHide(true); + } + } + if ((m_blupiSurf || m_blupiNage) && m_blupiActionOuf != 44) + { + m_blupiActionOuf = 44; + m_blupiTimeOuf = 0; + } + } + if ((m_blupiHelico || m_blupiOver || m_blupiJeep || m_blupiTank || m_blupiSkate) && m_blupiFocus && (IsSurfWater(m_blupiPos) || IsDeepWater(m_blupiPos))) + { + + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiHelico = false; + m_blupiOver = false; + m_blupiJeep = false; + m_blupiTank = false; + m_blupiSkate = false; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; + ObjectStart(tinyPoint, 9, 0); + m_decorAction = 1; + m_decorPhase = 0; + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(10, m_blupiPos); + } + if (m_blupiFocus && !m_blupiSuspend && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiNoBarre == 0 && GetTypeBarre(m_blupiPos) == 1) + { + tinyPoint4.x = m_blupiPos.x; + tinyPoint4.y = (m_blupiPos.y + 22) / 64 * 64 + BLUPISUSPEND; + rect = BlupiRect(tinyPoint4); + if (!DecorDetect(rect, true)) + { + m_blupiPos = tinyPoint4; + m_blupiSuspend = true; + m_blupiAir = false; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiActionOuf = 0; + PlaySound(34, m_blupiPos); + } + } + if (m_blupiNoBarre > 0) + { + m_blupiNoBarre--; + } + if (IsVentillo(m_blupiPos)) + { + if (m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + BlupiDead(11, 75); + } + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; + ObjectStart(tinyPoint, 11, 0); + m_decorAction = 2; + m_decorPhase = 0; + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(10, m_blupiPos); + } + if (m_blupiAction != 30 && m_blupiFocus) + { + num = IsWorld(m_blupiPos); + if (num != -1) + { + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(32, m_blupiPos); + m_blupiAction = 30; + m_blupiPhase = 0; + m_blupiFocus = false; + m_blupiFront = true; + } + } + int num27 = MoveObjectDetect(m_blupiPos, &flag6); + POINT tinyPoint5; + if (m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81) + { + if (IsLave(m_blupiPos) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + BlupiDead(76, -1); + m_blupiRestart = true; + m_blupiPos.y = m_blupiPos.y / DIMOBJY * 64 + BLUPIOFFY; + PlaySound(8, m_blupiPos); + } + if (IsPiege(m_blupiPos) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) + { + BlupiDead(54, -1); + m_blupiRestart = true; + m_blupiAir = true; + ObjectStart(m_blupiPos, 53, 0); + PlaySound(51, m_blupiPos); + } + if (IsGoutte(m_blupiPos, false) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) + { + BlupiDead(54, -1); + m_blupiRestart = true; + m_blupiAir = true; + PlaySound(51, m_blupiPos); + } + if (IsScie(m_blupiPos) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) + { + BlupiDead(77, -1); + m_blupiFront = true; + m_blupiRestart = true; + m_blupiAir = true; + } + if ( (num27 == -1 || !flag6) && IsSwitch(m_blupiPos, tinyPoint) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) + { + + ActiveSwitch(m_decor[tinyPoint.x][tinyPoint.y].icon == 385, tinyPoint); + m_blupiAction = 82; + m_blupiPhase = 0; + m_blupiFocus = false; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = 0; + } + if (IsBlitz(m_blupiPos, false) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + BlupiDead(11, -1); + m_blupiRestart = true; + m_blupiAir = true; + m_blupiPos.y = m_blupiPos.y / DIMOBJY * 64 + BLUPIOFFY; + PlaySound(8, m_blupiPos); + } + if (IsEcraseur(m_blupiPos) && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = 0; + m_blupiEcrase = true; + m_blupiBalloon = false; + m_blupiAir = false; + m_blupiHelico = false; + m_blupiOver = false; + m_blupiJeep = false; + m_blupiTank = false; + m_blupiSkate = false; + m_blupiNage = false; + m_blupiSurf = false; + m_blupiSuspend = false; + m_blupiJumpAie = false; + m_blupiShield = false; + m_blupiPower = false; + m_blupiCloud = false; + m_blupiHide = false; + m_blupiTimeShield = 100; + m_blupiPosMagic = m_blupiPos; + m_jauges[1].SetHide(false); + if (!m_blupiJeep && !m_blupiTank) + { + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + } + PlaySound(70, m_blupiPos); + ObjectStart(m_blupiPos, 41, -60); + ObjectStart(m_blupiPos, 41, 60); + ObjectStart(m_blupiPos, 41, 10); + ObjectStart(m_blupiPos, 41, -10); + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; + ObjectStart(tinyPoint, 90, 0); + m_decorAction = 2; + m_decorPhase = 0; + } + if (IsTeleporte(m_blupiPos) != -1 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiAir && m_blupiFocus && m_blupiPosHelico.x == -1) + { + m_blupiAction = 74; + m_blupiPhase = 0; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = 0; + m_blupiFocus = false; + m_blupiPos.x = m_blupiPos.x / DIMOBJX * 64; + PlaySound(71, m_blupiPos); + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - 5; + ObjectStart(tinyPoint, 92, 0); + } + if (IsBridge(m_blupiPos, tinyPoint2) && m_blupiFocus) + { + tinyPoint2.x *= 64; + tinyPoint2.y *= 64; + ObjectStart(tinyPoint2, 52, 0); + } + int num2 = IsDoor(m_blupiPos, tinyPoint2); + if (num2 != -1 && (m_blupiCle & 1 << num2 - 334) != 0) + { + OpenDoor(tinyPoint2); + m_blupiCle &= ~(1 << num2 - 334); + tinyPoint.x = 520; + tinyPoint.y = 418; + tinyPoint5.x = tinyPoint2.x * 64 - m_posDecor.x; + tinyPoint5.y = tinyPoint2.y * 64 - m_posDecor.y; + ////VoyageInit(tinyPoint, m_pPixmap->HotSpotToHud(tinyPoint5), 214 + (num2 - 334) * 7, 10); + } + } + if (!m_blupiHelico && !m_blupiSuspend && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiSkate && !m_blupiJeep && !m_blupiTank && !m_blupiJeep && m_blupiFocus) + { + num = MockeryDetect(m_blupiPos); + if (num != 0) + { + m_blupiActionOuf = num; + m_blupiTimeOuf = 0; + } + } + MoveObjectFollow(m_blupiPos); + num = num27; + if (num != -1 && !flag6 && m_moveObject[num].type == 2 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiShield && !m_bSuperBlupi && m_blupiFocus) + { + m_blupiActionOuf = 48; + m_blupiTimeOuf = 0; + } + if (num != -1 && flag6) + { + if (m_moveObject[num].type == 13 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; + m_blupiAir = false; + m_blupiHelico = true; + m_blupiVitesse.x = 0; + if (m_blupiCloud || m_blupiHide) + { + m_blupiCloud = false; + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + } + if (m_moveObject[num].type == 46 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; + m_blupiAir = false; + m_blupiOver = true; + m_blupiVitesse.x = 0; + if (m_blupiCloud || m_blupiHide) + { + m_blupiCloud = false; + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + } + if (m_moveObject[num].type == 19 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiAir = false; + m_blupiJeep = true; + m_blupiVitesse.x = 0; + if (m_blupiCloud || m_blupiHide) + { + m_blupiCloud = false; + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + } + if ( m_moveObject[num].type == 28 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiAir = false; + m_blupiTank = true; + m_blupiVitesse.x = 0; + if (m_blupiCloud || m_blupiHide) + { + m_blupiCloud = false; + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + } + if (m_moveObject[num].type == 29 && m_blupiFocus && m_blupiBullet < 10) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + tinyPoint5.x = 570; + tinyPoint5.y = 430; + ////VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), tinyPoint5, 177, 10); + m_blupiBullet += 10; + if (m_blupiBullet > 10) + { + m_blupiBullet = 10; + } + } + if ( m_moveObject[num].type == 24 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + { + + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; + m_blupiAction = 42; + m_blupiPhase = 0; + m_blupiPos.y = m_moveObject[num].posCurrent.y / 64 * 64 + BLUPIOFFY; + m_blupiFocus = false; + m_blupiAir = false; + m_blupiSkate = true; + m_blupiVitesse.x = 0; + if (m_blupiCloud || m_blupiHide) + { + m_blupiCloud = false; + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + } + if ((m_moveObject[num].type == 3 || m_moveObject[num].type == 16 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97) && m_blupiBalloon && m_blupiPosHelico.x == -1) + { + m_blupiBalloon = false; + m_blupiAir = true; + m_blupiTimeShield = 0; + m_jauges[1].SetHide(true); + m_decorAction = 0; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; + ObjectStart(tinyPoint, 91, 0); + PlaySound(41, m_blupiPos); + m_blupiPos.y = m_blupiPos.y + 4; + m_blupiVitesse.y = 0; + m_blupiPosHelico = m_blupiPos; + } + else if ((m_moveObject[num].type == 2 || m_moveObject[num].type == 3 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97 || m_moveObject[num].type == 16 || m_moveObject[num].type == 4 || m_moveObject[num].type == 17 || m_moveObject[num].type == 20) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPosHelico.x == -1) + { + if (!m_blupiJeep && !m_blupiTank && !m_blupiSkate && (m_blupiFocus || m_blupiAction == 5 || m_blupiAction == 36)) + { + if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase) + { + m_blupiAir = true; + } + BlupiDead(11, 75); + } + if (m_moveObject[num].type == 17 || m_moveObject[num].type == 20) + { + tinyPoint = m_moveObject[num].posCurrent; + ObjectDelete(tinyPoint, m_moveObject[num].type); + tinyPoint.x -= 34; + tinyPoint.y -= 34; + ObjectStart(tinyPoint, 10, 0); + m_decorAction = 2; + m_decorPhase = 0; + } + else + { + tinyPoint = m_moveObject[num].posCurrent; + ObjectDelete(tinyPoint, m_moveObject[num].type); + tinyPoint.x -= 34; + tinyPoint.y -= 34; + ObjectStart(tinyPoint, 8, 0); + m_decorAction = 1; + m_decorPhase = 0; + } + if (!m_blupiJeep && !m_blupiTank) + { + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + } + PlaySound(10, m_moveObject[num].posCurrent); + } + if (m_moveObject[num].type == 44 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiVitesse.x = 0; + m_blupiVitesse.y = 0; + m_blupiBalloon = true; + m_blupiEcrase = false; + m_blupiAir = false; + m_blupiHelico = false; + m_blupiOver = false; + m_blupiJeep = false; + m_blupiTank = false; + m_blupiSkate = false; + m_blupiNage = false; + m_blupiSurf = false; + m_blupiSuspend = false; + m_blupiJumpAie = false; + m_blupiShield = false; + m_blupiPower = false; + m_blupiCloud = false; + m_blupiHide = false; + m_blupiTimeShield = 100; + m_blupiPosMagic = m_blupiPos; + m_jauges[1].SetHide(false); + if (!m_blupiJeep && !m_blupiTank) + { + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + } + PlaySound(40, m_moveObject[num].posCurrent); + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; + ObjectStart(tinyPoint, 90, 0); + m_decorAction = 5; + m_decorPhase = 0; + } + if (m_moveObject[num].type == 54 && m_moveObject[num].step != 2 && m_moveObject[num].step != 4 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = (m_blupiPos.y + 64 - 10) / 64 * 64 + 4; + ObjectStart(tinyPoint, 53, 0); + m_blupiAction = 54; + m_blupiPhase = 0; + m_blupiSuspend = false; + m_blupiJumpAie = false; + m_blupiFocus = false; + m_blupiRestart = true; + if (flag4) + { + m_blupiAir = true; + } + if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate) + { + m_blupiHelico = false; + m_blupiOver = false; + m_blupiBalloon = false; + m_blupiEcrase = false; + m_blupiJeep = false; + m_blupiTank = false; + m_blupiSkate = false; + tinyPoint = m_moveObject[num].posCurrent; + tinyPoint.x -= 34; + tinyPoint.y -= 34; + ObjectStart(tinyPoint, 10, 0); + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(10, m_moveObject[num].posCurrent); + m_decorAction = 1; + m_decorPhase = 0; + } + else + { + PlaySound(51, m_moveObject[num].posCurrent); + } + m_blupiCloud = false; + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + if (m_moveObject[num].type == 23 && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiAction != 13 && m_blupiAction != 30 && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81 && m_blupiAction != 54 && m_blupiAction != 57 && m_blupiAction != 35) + { + + tinyPoint = m_moveObject[num].posCurrent; + ObjectDelete(tinyPoint, m_moveObject[num].type); + m_blupiAction = 54; + m_blupiPhase = 0; + m_blupiSuspend = false; + m_blupiJumpAie = false; + m_blupiFocus = false; + m_blupiRestart = true; + if (flag4) + { + m_blupiAir = true; + } + if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate) + { + m_blupiHelico = false; + m_blupiOver = false; + m_blupiBalloon = false; + m_blupiEcrase = false; + m_blupiJeep = false; + m_blupiTank = false; + m_blupiSkate = false; + } + StartSploutchGlu(m_moveObject[num].posCurrent); + m_blupiCloud = false; + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + if (m_moveObject[num].type == 5) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + POINT end; + end.x = 430; + end.y = 430; + //VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), end, 6, 10); + ObjectStart(m_moveObject[num].posCurrent, 39, -60); + ObjectStart(m_moveObject[num].posCurrent, 39, 60); + ObjectStart(m_moveObject[num].posCurrent, 39, 10); + ObjectStart(m_moveObject[num].posCurrent, 39, -10); + } + if (m_moveObject[num].type == 49 && (m_voyageIcon != 215 || m_voyageChannel != 10) && (m_blupiCle & 1) == 0) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + POINT end2; + end2.x = 520; + end2.y = 418; + //VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), end2, 215, 10); + ObjectStart(m_moveObject[num].posCurrent, 39, -60); + ObjectStart(m_moveObject[num].posCurrent, 39, 60); + ObjectStart(m_moveObject[num].posCurrent, 39, 10); + ObjectStart(m_moveObject[num].posCurrent, 39, -10); + } + if (m_moveObject[num].type == 50 && (m_voyageIcon != 222 || m_voyageChannel != 10) && (m_blupiCle & 2) == 0) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + POINT end3; + end3.x = 530; + end3.y = 418; + //VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), end3, 222, 10); + ObjectStart(m_moveObject[num].posCurrent, 39, -60); + ObjectStart(m_moveObject[num].posCurrent, 39, 60); + ObjectStart(m_moveObject[num].posCurrent, 39, 10); + ObjectStart(m_moveObject[num].posCurrent, 39, -10); + } + if (m_moveObject[num].type == 51 && (m_voyageIcon != 229 || m_voyageChannel != 10) && (m_blupiCle & 4) == 0) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + POINT end4; + end4.x = 540; + end4.y = 418; + //VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), end4, 229, 10); + ObjectStart(m_moveObject[num].posCurrent, 39, -60); + ObjectStart(m_moveObject[num].posCurrent, 39, 60); + ObjectStart(m_moveObject[num].posCurrent, 39, 10); + ObjectStart(m_moveObject[num].posCurrent, 39, -10); + } + if (m_moveObject[num].type == 6 && m_nbVies < 10 && m_blupiFocus) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + //VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), VoyageGetPosVie(m_nbVies + 1), 21, 10); + } + if (m_moveObject[num].type == 25 && !m_blupiShield && !m_blupiHide && !m_blupiPower && m_blupiFocus) + { + PlaySound(42, m_moveObject[num].posCurrent); + m_blupiShield = true; + m_blupiPower = false; + m_blupiCloud = false; + m_blupiHide = false; + m_blupiTimeShield = 100; + m_blupiPosMagic = m_blupiPos; + m_jauges[1].SetHide(false); + } + if ( m_moveObject[num].type == 26 && !m_blupiShield && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) + { + + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + m_blupiAction = 49; + m_blupiPhase = 0; + m_blupiCloud = false; + m_blupiHide = false; + m_blupiFocus = false; + PlaySound(50, tinyPoint3); + } + if (m_moveObject[num].type == 40 && !m_blupiHide && m_blupiFocus) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + m_blupiInvert = true; + m_blupiTimeShield = 100; + m_blupiPosMagic = m_blupiPos; + m_jauges[1].SetHide(false); + PlaySound(66, tinyPoint3); + ObjectStart(m_blupiPos, 41, -60); + ObjectStart(m_blupiPos, 41, 60); + ObjectStart(m_blupiPos, 41, 10); + ObjectStart(m_blupiPos, 41, -10); + } + if ( m_moveObject[num].type == 30 && !m_blupiShield && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) + { + + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + m_blupiAction = 55; + m_blupiPhase = 0; + m_blupiShield = false; + m_blupiPower = false; + m_blupiJumpAie = false; + m_blupiFocus = false; + PlaySound(57, tinyPoint3); + } + if (m_moveObject[num].type == 31 && !m_blupiShield && !m_blupiHide && !m_blupiPower && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) + { + m_blupiAction = 56; + m_blupiPhase = 0; + m_blupiShield = false; + m_blupiPower = false; + m_blupiJumpAie = false; + m_blupiFocus = false; + m_blupiCloud = true; + m_blupiTimeShield = 100; + PlaySound(58, tinyPoint3); + if (m_blupiHide) + { + m_blupiHide = false; + m_jauges[1].SetHide(true); + } + } + if (m_moveObject[num].type >= 200 && m_moveObject[num].type <= 203 && m_blupiFocus) + { + if (m_moveObject[num].type == 200) + { + if (m_blupiPerso < 5 ) + { + + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + tinyPoint5.x = 0; + tinyPoint5.y = 438; + ////VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), tinyPoint5, 108, 4); + } + } + else if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + { + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + BlupiDead(11, 75); + tinyPoint = m_moveObject[num].posCurrent; + tinyPoint.x -= 34; + tinyPoint.y -= 34; + ObjectStart(tinyPoint, 10, 0); + PlaySound(10, m_moveObject[num].posCurrent); + m_decorAction = 1; + m_decorPhase = 0; + } + } + if (m_moveObject[num].type == 55 && m_blupiFocus && m_blupiDynamite == 0 && (m_voyageIcon != 252 || m_voyageChannel != 10) ) + { + + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + tinyPoint5.x = 505; + tinyPoint5.y = 414; + ////VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), tinyPoint5, 252, 10); + m_blupiAction = 86; + m_blupiPhase = 0; + m_blupiFocus = false; + } + if (m_moveObject[num].type == 12 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus && m_blupiAction == 2) + { + tinyPoint3 = m_moveObject[num].posCurrent; + if (m_blupiDir == 1 && m_blupiPos.x > tinyPoint3.x) + { + tinyPoint3.x = m_blupiPos.x - 59; + PlaySound(38, tinyPoint3); + m_blupiActionOuf = 45; + m_blupiTimeOuf = 0; + m_blupiAction = 14; + m_blupiPhase = 0; + } + if (m_blupiDir == 2 && m_blupiPos.x < tinyPoint3.x) + { + tinyPoint3.x = m_blupiPos.x + 55; + PlaySound(38, tinyPoint3); + m_blupiActionOuf = 45; + m_blupiTimeOuf = 0; + m_blupiAction = 14; + m_blupiPhase = 0; + } + if (!TestPushCaisse(num, tinyPoint3, false)) + { + m_blupiPos.x = blupiPos.x; + } + } + if ((m_moveObject[num].type == 7 || m_moveObject[num].type == 21) && m_blupiFocus) + { + if (m_goalPhase == 0) + { + if (m_nbTresor >= m_totalTresor) + { + if (m_moveObject[num].type == 21) + { + m_bFoundCle = true; + } + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(14, m_moveObject[num].posCurrent); + m_blupiAction = 13; + m_blupiPhase = 0; + m_blupiFocus = false; + m_blupiFront = true; + m_blupiPos.y = m_moveObject[num].posCurrent.y; + } + else + { + PlaySound(13, m_moveObject[num].posCurrent); + } + m_goalPhase = 50; + } + else + { + m_goalPhase--; + } + } + else + { + m_goalPhase = 0; + } + } + else + { + m_goalPhase = 0; + } + if (m_blupiAction == 14 && m_blupiFocus) + { + num = CaisseInFront(); + if (num != -1) + { + tinyPoint3 = m_moveObject[num].posCurrent; + if (m_blupiDir == 1) + { + tinyPoint3.x = m_blupiPos.x - 59; + } + else + { + tinyPoint3.x = m_blupiPos.x + 55; + } + if (!TestPushCaisse(num, tinyPoint3, false)) + { + m_blupiPos.x = blupiPos.x; + } + } + else + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + } + if (m_blupiAction == 29 && m_blupiFocus) + { + num = CaisseInFront(); + if (num != -1) + { + tinyPoint3 = m_moveObject[num].posCurrent; + if (m_blupiDir == 1) + { + tinyPoint3.x = m_blupiPos.x - 59; + } + else + { + tinyPoint3.x = m_blupiPos.x + 55; + } + if (!TestPushCaisse(num, tinyPoint3, true)) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + } + else + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + } + if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) + { + if (m_blupiActionOuf == 44 && m_blupiAction == 1) + { + if (m_blupiTimeOuf > 50) + { + m_blupiAction = m_blupiActionOuf; + m_blupiPhase = 0; + PlaySound(46, m_blupiPos); + } + m_blupiActionOuf = 0; + } + if (m_blupiActionOuf == 45 && m_blupiAction == 1) + { + if (m_blupiTimeOuf > 50) + { + m_blupiAction = m_blupiActionOuf; + m_blupiPhase = 0; + } + m_blupiActionOuf = 0; + } + if (m_blupiAction == 45 && m_blupiPhase == 4) + { + PlaySound(46, m_blupiPos); + } + if (m_blupiActionOuf == 65 && m_blupiAction == 1) + { + if (m_blupiTimeOuf > 10 && m_blupiTimeOuf < 50) + { + m_blupiAction = m_blupiActionOuf; + m_blupiPhase = 0; + } + m_blupiActionOuf = 0; + } + if (m_blupiActionOuf == 47 && m_blupiAction == 1) + { + if (m_blupiTimeOuf > 60) + { + m_blupiAction = m_blupiActionOuf; + m_blupiPhase = 0; + PlaySound(48, m_blupiPos); + } + m_blupiActionOuf = 0; + } + if (m_blupiActionOuf == 48 && m_blupiAction == 1) + { + if (m_blupiTimeOuf < 10) + { + m_blupiAction = m_blupiActionOuf; + m_blupiPhase = 0; + PlaySound(49, m_blupiPos); + } + m_blupiActionOuf = 0; + } + if ((m_blupiActionOuf == 63 || m_blupiActionOuf == 64 || m_blupiActionOuf == 83) && m_blupiAction == 1) + { + if (m_blupiTimeOuf < 20) + { + m_blupiAction = m_blupiActionOuf; + m_blupiPhase = 0; + } + m_blupiActionOuf = 0; + } + } + if (m_blupiAction == 2 && m_blupiActionOuf != 63 && m_blupiActionOuf != 64 && m_blupiActionOuf != 83 && !m_blupiSurf && !m_blupiNage) + { + m_blupiActionOuf = 0; + } + if (m_blupiActionOuf != 0) + { + m_blupiTimeOuf++; + } + if (m_blupiTimeMockery > 0) + { + m_blupiTimeMockery--; + } + if (m_blupiAction == 86 && m_blupiPhase == 18) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + if (m_blupiAction == 87 && m_blupiPhase == 26) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + if (m_blupiPos.x - 30 > m_blupiPosHelico.x || m_blupiPos.x + 30 < m_blupiPosHelico.x || m_blupiPos.y - 30 > m_blupiPosHelico.y || m_blupiPos.y + 30 < m_blupiPosHelico.y) + { + m_blupiPosHelico.x = -1; + } + if (m_blupiTimeFire > 0) + { + m_blupiTimeFire--; + } + if (m_blupiAction == 74 && m_blupiPhase == 128) + { + POINT blupiPos2 { 0,0 }; + if (SearchTeleporte(m_blupiPos, blupiPos2)) + { + m_blupiPos = blupiPos2; + ObjectStart(m_blupiPos, 27, 20); + ObjectStart(m_blupiPos, 27, -20); + } + m_blupiFocus = true; + m_blupiPosHelico = m_blupiPos; + } + if (m_blupiAction == 82 && m_blupiPhase == 10) + { + m_blupiAction = 1; + m_blupiPhase = 0; + m_blupiFocus = true; + } + if ( m_blupiAction == 1) + { + m_blupiAction = 84; + m_blupiPhase = 0; + PlaySound(27, m_blupiPos); + } + if ((m_blupiAction == 11 && m_blupiPhase == 70) || (m_blupiAction == 75 && m_blupiPhase == 100) || (m_blupiAction == 76 && m_blupiPhase == 70) || (m_blupiAction == 77 && m_blupiPhase == 110) || (m_blupiAction == 78 && m_blupiPhase == 90) || (m_blupiAction == 79 && m_blupiPhase == 90) || (m_blupiAction == 80 && m_blupiPhase == 90) || (m_blupiAction == 81 && m_blupiPhase == 90) || (m_blupiAction == 24 && m_blupiPhase == 90) || (m_blupiAction == 54 && m_blupiPhase == 100) || (m_blupiAction == 57 && m_blupiPhase == 90)) + { + if (m_nbVies > 0) + { + m_blupiAction = 35; + m_blupiIcon = -1; + m_blupiPhase = 0; + if (m_blupiRestart) + { + m_blupiPos = m_blupiValidPos; + } + POINT posDecor = GetPosDecor(m_blupiPos); + tinyPoint.x = m_blupiPos.x - posDecor.x - 30; + tinyPoint.y = m_blupiPos.y - posDecor.y; + ////VoyageInit(VoyageGetPosVie(m_nbVies), m_pPixmap->HotSpotToHud(tinyPoint), 48, 2); + } + else + { + m_nbVies = -1; + m_term = -1; + DoorsLost(); + } + m_blupiFront = false; + } + if (m_dimDecor.y == 0) + { + num3 = 480; + } + else + { + num3 = 6400; + } + if (m_blupiPos.y >= num3 + 1 && m_blupiPos.y <= num3 + 40) + { + PlaySound(8, m_blupiPos); + } + if (m_blupiPos.y > num3 + 1000) + { + m_term = -1; + DoorsLost(); + } + if (m_blupiAction == 13 && m_blupiPhase == 40) + { + if (m_bPrivate) + { + m_term = 1; + } + else if (m_mission == 1) + { + m_term = 199; + } + else if (m_mission == 199) + { + m_term = -2; + } + else if (m_bFoundCle) + { + OpenGoldsWin(); + m_term = 1; + } + else + { + OpenDoorsWin(); + m_term = m_mission / 10 * 10; + } + } + if (m_blupiAction == 30 && m_blupiPhase == 30) + { + num = IsWorld(m_blupiPos); + if (num != -1) + { + if (m_mission == 1) + { + m_term = num * 10; + } + else if (num == 199) + { + m_term = 1; + } + else + { + m_term = m_mission / 10 * 10 + num; + } + } + } + if (blupiAction == 63 && m_blupiAction != 63) + { + StopSound(65); + } + if (blupiAction == 64 && m_blupiAction != 64) + { + StopSound(65); + } + if (blupiAction == 83 && m_blupiAction != 83) + { + StopSound(47); + } + if (m_blupiFocus && !m_blupiAir && (!m_blupiHelico || BlupiIsGround()) && (!m_blupiOver || BlupiIsGround()) && !m_blupiBalloon && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !flag2 && !flag3 && m_blupiTransport == -1 && !IsLave(m_blupiPos) && !IsPiege(m_blupiPos) && !IsGoutte(m_blupiPos, true) && !IsScie(m_blupiPos) && !IsBridge(m_blupiPos, tinyPoint) && IsTeleporte(m_blupiPos) == -1 && !IsBlitz(m_blupiPos, true) && !IsTemp(m_blupiPos) && !IsBalleTraj(m_blupiPos) && !IsMoveTraj(m_blupiPos)) + { + if (m_blupiFifoNb > 0) + { + m_blupiValidPos = m_blupiFifoPos[0]; + } + BlupiAddFifo(m_blupiPos); + } + tinyPoint3.x = m_blupiPos.x + 30 + m_scrollAdd.x; + tinyPoint3.y = m_blupiPos.y + 30 + m_scrollAdd.y; + int num28 = abs(m_scrollPoint.x - tinyPoint3.x); + int num29 = abs(m_scrollPoint.y - tinyPoint3.y); + num4 = SCROLL_SPEED; + if (num28 > SCROLL_MARGX * 2) + { + num4 += (num28 - SCROLL_MARGX * 2) / 4; + } + if (num29 > SCROLL_MARGY * 2) + { + num4 += (num29 - SCROLL_MARGY * 2) / 4; + } + if (m_scrollPoint.x < tinyPoint3.x) + { + m_scrollPoint.x = m_scrollPoint.x + num4; + if (m_scrollPoint.x >= tinyPoint3.x) + { + m_scrollPoint.x = tinyPoint3.x; + } + } + if (m_scrollPoint.x > tinyPoint3.x) + { + m_scrollPoint.x = m_scrollPoint.x - num4; + if (m_scrollPoint.x <= tinyPoint3.x) + { + m_scrollPoint.x = tinyPoint3.x; + } + } + if (m_scrollPoint.y < tinyPoint3.y) + { + m_scrollPoint.y = m_scrollPoint.y + num4; + if (m_scrollPoint.y >= tinyPoint3.y) + { + m_scrollPoint.y = tinyPoint3.y; + } + } + if (m_scrollPoint.y > tinyPoint3.y) + { + m_scrollPoint.y = m_scrollPoint.y - num4; + if (m_scrollPoint.y <= tinyPoint3.y) + { + m_scrollPoint.y = tinyPoint3.y; + } + } + if (m_blupiAction != 75 && m_blupiAction != 76) + { + m_posDecor = GetPosDecor(m_scrollPoint); + } + if (m_time % 4 == 0) + { + //PosSound(m_blupiPos); + } + VoyageStep(); + + m_lastKeyPress = m_keyPress; +} + +void CDecor::BlupiDead(int action1, int action2) +{ + if (action2 == -1) + { + m_blupiAction = action1; + } + else + { + m_blupiAction = ((rand() % 2 == 0) ? action1 : action2); + } + m_blupiPhase = 0; + m_blupiFocus = FALSE; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiVent = FALSE; + m_blupiSuspend = FALSE; + m_blupiJumpAie = FALSE; + m_blupiShield = FALSE; + m_blupiPower = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + m_blupiInvert = FALSE; + m_blupiBalloon = FALSE; + m_blupiEcrase = FALSE; + m_blupiRestart = FALSE; + m_blupiActionOuf = 0; + m_jauges[0].SetHide(TRUE); + m_jauges[1].SetHide(TRUE); + StopSound(SOUND_HELICOHIGH); + StopSound(SOUND_HELICOLOW); + StopSound(SOUND_JEEPHIGH); + StopSound(SOUND_JEEPLOW); + + POINT pos; + POINT pos2; + if (m_blupiAction == ACTION_CLEAR2) + { + pos.x = m_blupiPos.x - m_posDecor.x; + pos.y = m_blupiPos.y - m_posDecor.y; + pos2.x = m_blupiPos.x - m_posDecor.x; + pos2.y = m_blupiPos.y - m_posDecor.y - 300; + ////VoyageInit(m_pPixmap->HotSpotToHud(pos), m_pPixmap->HotSpotToHud(pos2), 230, 10); + PlaySound(SOUND_ANGEL, m_blupiPos); + } + if (m_blupiAction == ACTION_CLEAR3) + { + pos.x = m_blupiPos.x - m_posDecor.x; + pos.y = m_blupiPos.y - m_posDecor.y; + pos2.x = m_blupiPos.x - m_posDecor.x; + pos2.y = m_blupiPos.y - m_posDecor.y - 2000; + ////VoyageInit(m_pPixmap->HotSpotToHud(pos), m_pPixmap->HotSpotToHud(pos2), 40, 10); + PlaySound(SOUND_ANGEL, m_blupiPos); + } + if (m_blupiAction == ACTION_CLEAR4) + { + ObjectStart(m_blupiPos, TYPE_INVERTSTART, -70); + ObjectStart(m_blupiPos, TYPE_INVERTSTART, 20); + ObjectStart(m_blupiPos, TYPE_INVERTSTART, -20); + PlaySound(SOUND_SCIE, m_blupiPos); + } +} + +POINT CDecor::GetPosDecor(POINT pos) +{ + POINT result; + if (m_dimDecor.x == 0) + { + result.x = 0; + } + else + { + result.x = pos.x - LXIMAGE / 2; + result.x = (result.x < 0); + result.x = (result.x > 5760) - LXIMAGE; + } + if (m_dimDecor.y == 0) + { + result.y = 0; + } + else + { + result.y = pos.y - LYIMAGE / 2; + result.y = (result.y < 0); + result.y = (result.y > 5920) - LYIMAGE / 2; + } + return result; +} + +void CDecor::BlupiAddFifo(POINT pos) +{ + if (m_blupiFifoNb < 10) + { + if (m_blupiFifoNb > 0 && pos.x == m_blupiFifoPos[m_blupiFifoNb - 1].x && pos.y == m_blupiFifoPos[m_blupiFifoNb - 1].y) + { + return; + } + m_blupiFifoPos[m_blupiFifoNb] = pos; + m_blupiFifoNb++; + return; + } + else + { + if (pos.x == m_blupiFifoPos[9].x && pos.y == m_blupiFifoPos[9].y) + { + return; + } + for (int i = 0; i < 9; i++) + { + m_blupiFifoPos[i] = m_blupiFifoPos[i + 1]; + } + m_blupiFifoPos[9] = pos; + return; + } +} + +BOOL CDecor::DecorDetect(RECT rect, BOOL bCaisse) +{ + m_detectIcon = -1; + if (rect.left < 0 || rect.top < 0) + { + return TRUE; + } + int num; + if (m_dimDecor.x == 0) + { + num = 640; + } + else + { + num = 6400; + } + if (rect.right > num) + { + return TRUE; + } + if (m_blupiHelico || + m_blupiOver || + m_blupiBalloon || + m_blupiEcrase || + m_blupiNage || + m_blupiSurf) + { + if (m_dimDecor.y == 0) + { + num = 480; + } + else + { + num = 6400; + } + if (rect.bottom > num) + { + return TRUE; + } + } + int num2 = rect.left / 16; + int num3 = (rect.right + 16 - 1) / 16; + int num4 = rect.top / 16; + int num5 = (rect.bottom + 16 - 1) / 16; + RECT src; + for (int i = num4; i <= num5; i++) + { + for (int j = num2; j <= num3; j++) + { + int num6 = j / 4; + int num7 = i / 4; + if (num6 >= 0 && num6 < 100 && num7 >= 0 && num7 < 100) + { + int icon = m_decor[num6][num7].icon; + if (icon >= 0 && icon < MAXQUART && (!m_blupiHelico || icon != 214) && (m_blupiOver || icon != 214) && (icon != 324 || m_time / 4 % 20 < 18)) + { + num6 = j % 4; + num7 = i % 4; + if (table_decor_quart[icon * 16 + num7 * 4 + num6] != 0) + { + src.left = j * 16; + src.right = src.left + 16; + src.top = i * 16; + src.bottom = src.top + 16; + RECT tinyRect; + if (IntersectRect(tinyRect, src, rect)) + { + m_detectIcon = icon; + return TRUE; + } + } + + } + } + } + } + if (!bCaisse) + { + return FALSE; + } + for (int k = 0; k < m_nbRankCaisse; k++) + { + int num8 = m_rankCaisse[k]; + src.left = m_moveObject[num8].posCurrent.x; + src.right = m_moveObject[num8].posCurrent.x + 64; + src.top = m_moveObject[num8].posCurrent.y; + src.bottom = m_moveObject[num8].posCurrent.y + 64; + RECT tinyRect; + if (IntersectRect(tinyRect, src, rect)) + { + m_detectIcon = m_moveObject[num8].icon; + return TRUE; + } + } + return FALSE; +} + +BOOL CDecor::DecorDetect(RECT rect) +{ + return DecorDetect(rect, TRUE); +} + +BOOL CDecor::TestPath(RECT rect, POINT start, POINT end) +{ + int num = abs(end.x - start.x); + int num2 = abs(end.y - start.y); + + POINT tinyPoint = start; + if (num > num2) + { + RECT rect2; + if (end.x > start.x) + { + for (int i = 0; i <= num; i++) + { + int j = i * (end.y - start.y) / num; + rect2.left = rect.left + i; + rect2.right = rect.right + i; + rect2.top = rect.top + j; + rect2.bottom = rect.bottom + j; + if (DecorDetect(rect2)) + { + end = tinyPoint; + return FALSE; + } + tinyPoint.x = start.x + i; + tinyPoint.y = start.y + j; + } + } + if (end.x < start.x) + { + for (int i = 0; i >= -num; i--) + { + int j = i * (start.y - end.y) / num; + rect2.left = rect.left + i; + rect2.right = rect.right + i; + rect2.top = rect.top + j; + rect2.bottom = rect.bottom + j; + if (DecorDetect(rect2)) + { + end = tinyPoint; + return FALSE; + } + tinyPoint.x = start.x + i; + tinyPoint.y = start.y + j; + } + } + } + else + { + RECT rect2; + if (end.y > start.y) + { + for (int j = 0; j <= num2; j++) + { + int i = j * (end.x - start.x) / num2; + rect2.left = rect.left + i; + rect2.right = rect.right + i; + rect2.top = rect.top + j; + rect2.bottom = rect.bottom + j; + if (DecorDetect(rect2)) + { + end = tinyPoint; + return FALSE; + } + tinyPoint.x = start.x + i; + tinyPoint.y = start.y + j; + } + } + if (end.y < start.y) + { + for (int j = 0; j >= -num2; j--) + { + int i = j * (start.x - end.x) / num2; + rect2.left = rect.left + i; + rect2.right = rect.right + i; + rect2.top = rect.top + j; + rect2.bottom = rect.bottom + j; + if (DecorDetect(rect2)) + { + end = tinyPoint; + return FALSE; + } + tinyPoint.x = start.x + i; + tinyPoint.y = start.y + j; + } + } + } + return TRUE; +} \ No newline at end of file diff --git a/src/decdesign.cpp b/src/decdesign.cpp new file mode 100644 index 0000000..1a9f441 --- /dev/null +++ b/src/decdesign.cpp @@ -0,0 +1,655 @@ +// DecDesign.cpp +// + +#include "def.h" +#include "decor.h" +#include "misc.h" +#include "dectables.h" + +POINT CDecor::ScreenPosToCelPos(POINT pos) +{ + if (pos.x >= 0 && pos.x < LXIMAGE && pos.y >= 0 && pos.y < LYIMAGE) { + return { + (m_posDecor.x + m_dimCelHili.x * -32 + 32 + pos.x) / 64, + (m_posDecor.y + m_dimCelHili.y * -32 + 32 + pos.y) / 64 + }; + } + else return { -1, -1 }; +} + +void CDecor::SetCelPosFromScreenPos(POINT pos) +{ + m_posCelHili = ScreenPosToCelPos(pos); +} + +void CDecor::SetFieldCC38AndStuff(int _foo, int _bar) +{ + m_dimCelHili = { 1, 1 }; + if (_foo == 2 && _bar != 3 && _bar != 9 && _bar != 10) m_dimCelHili = { 2, 2 }; + if (_foo == 3) m_iconLift = _bar; + if (_foo == 4) m_iconLift = _bar + 20; + if (_foo == 5) m_iconLift = _bar + 40; + m_2ndPositionCalculationSlot = -1; +} + +void CDecor::DeleteCel(POINT cel) +{ + m_2ndPositionCalculationSlot = -1; + + if (!IsValidCel(cel)) return; + + m_decor[cel.x][cel.y].icon = -1; + AdaptBorder(cel); + m_bigDecor[cel.x][cel.y].icon = -1; + MoveObjectDelete(cel); +} + +void CDecor::PlaceMenuItem(short *pCel, int *pTable, int lastIndex, BYTE flags, int currentIcon, BOOL bRand) +{ + if (bRand) { + *pCel = pTable[rand() % (pTable[0] + 1)]; + } + else if (!(flags & 8)) { + if (flags & 1) { + lastIndex++; + if (*pCel == pTable[lastIndex] && currentIcon != 0 && pTable[0] <= lastIndex) { + lastIndex = 0; + } + *pCel = pTable[lastIndex + 1]; + } + } + else { + *pCel = pTable[lastIndex + 1]; + } +} + +void CDecor::PlaceItemFromMenu1(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + short *pIconBig = &m_bigDecor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Tree + PlaceMenuItem(pIconBig, table_366b0, m_lastDecorIndexes[0], flags, *pIconBig, TRUE); + break; + case 1: // Palmtree + PlaceMenuItem(pIconBig, table_366c0, m_lastDecorIndexes[1], flags, *pIconBig, TRUE); + break; + case 2: // Decorative plant + PlaceMenuItem(pIconBig, table_366d8, m_lastDecorIndexes[2], flags, *pIconBig, TRUE); + break; + case 3: // Marine plant + *pIcon = Object::Marine_1; + break; + case 4: // House + PlaceMenuItem(pIconBig, table_366e8, m_lastDecorIndexes[3], flags, *pIconBig, TRUE); + break; + case 5: // Mechanical background + PlaceMenuItem(pIconBig, table_366f8, m_lastDecorIndexes[4], flags, *pIconBig, TRUE); + break; + case 6: // Kid's stuff background + PlaceMenuItem(pIconBig, table_36710, m_lastDecorIndexes[5], flags, *pIconBig, TRUE); + break; + case 7: // Green slime 2 + PlaceMenuItem(pIconBig, table_36748, m_lastDecorIndexes[6], flags, *pIconBig, TRUE); + break; + case 8: // Element for Palace + PlaceMenuItem(pIconBig, table_36520, m_lastDecorIndexes[7], flags, *pIconBig, TRUE); + break; + case 9: // Support + PlaceMenuItem(pIcon, table_36670, m_lastDecorIndexes[8], flags, *pIcon, TRUE); + break; + case 10: // Spider's web + PlaceMenuItem(pIcon, table_366a0, m_lastDecorIndexes[9], flags, *pIcon, TRUE); + break; + } +} + +void CDecor::PlaceItemFromMenu2(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + m_iconLift = index; + + switch (index) { + case 0: // Square tech-blocks + PlaceMenuItem(pIcon, table_36418, m_lastDecorIndexes[10], flags, *pIcon, TRUE); + break; + case 1: // Special tech-blocks + PlaceMenuItem(pIcon, table_36458, m_lastDecorIndexes[11], flags, *pIcon, TRUE); + break; + case 2: // Triangular tech-blocks + PlaceMenuItem(pIcon, table_36488, m_lastDecorIndexes[12], flags, *pIcon, FALSE); + break; + case 3: // Secret tech-block + PlaceMenuItem(pIcon, table_364a0, m_lastDecorIndexes[13], flags, *pIcon, FALSE); + break; + case 4: // Mechanical square + PlaceMenuItem(pIcon, table_364b0, m_lastDecorIndexes[14], flags, *pIcon, TRUE); + break; + case 5: // Special mechanical + PlaceMenuItem(pIcon, table_364d0, m_lastDecorIndexes[15], flags, *pIcon, FALSE); + break; + case 6: // Secret mechanical + PlaceMenuItem(pIcon, table_364e8, m_lastDecorIndexes[16], flags, *pIcon, FALSE); + break; + case 7: // Pipes + *pIcon = Object::Pipes_1; + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu3(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + m_iconLift = index + 20; + + switch (index) { + case 0: // Square rock + PlaceMenuItem(pIcon, table_36530, m_lastDecorIndexes[20], flags, *pIcon, FALSE); + break; + case 1: // Triangular rock + PlaceMenuItem(pIcon, table_36538, m_lastDecorIndexes[21], flags, *pIcon, FALSE); + break; + case 2: // Secret rock + PlaceMenuItem(pIcon, table_36548, m_lastDecorIndexes[22], flags, *pIcon, FALSE); + break; + case 3: // Cave + // todo + break; + case 4: // Secret cave + *pIcon = Object::CaveSecret; + break; + case 5: // Cheese + *pIcon = Random(Object::CheeseSquare_1, Object::CheeseSquare_4); + break; + case 6: // Secret cheese + *pIcon = Object::CheeseSecret; + break; + case 7: // Green slime 2 + *pIcon = Object::Slime_1; + break; + case 8: // Grass + PlaceMenuItem(pIcon, table_365d0, m_lastDecorIndexes[23], flags, *pIcon, FALSE); + break; + case 9: // Water + PlaceMenuItem(pIcon, table_36630, m_lastDecorIndexes[24], flags, *pIcon, FALSE); + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu4(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + m_iconLift = index + 40; + + switch (index) { + case 0: // Palace + break; + case 1: // Element for Palace + break; + case 2: // Building facade + break; + case 3: // Roof + break; + case 4: // Bricks + break; + case 5: // Furniture + break; + case 6: // Wooden wall + break; + case 7: // Kid's stuff square + break; + case 8: // Special Kid's stuff + break; + case 9: // Invisible block + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + int mobId; + MoveObject* pMob; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Bomb + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_BOMBEDOWN; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x0c; + break; + case 1: // Hanging bomb + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_BOMBEUP; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x30; + break; + case 2: // Homing bomb + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_BOMBEFOLLOW1; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX, cel.y * DIMOBJY }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x100; + break; + case 3: // Lava + PlaceMenuItem(pIcon, table_decor_lave, m_lastDecorIndexes[40], flags, *pIcon, FALSE); + break; + case 4: // Fan + PlaceMenuItem(pIcon, table_decor_ventillog, m_lastDecorIndexes[41], flags, *pIcon, FALSE); + break; + case 5: // Wind + PlaceMenuItem(pIcon, table_decor_ventg, m_lastDecorIndexes[42], flags, *pIcon, FALSE); + break; + case 6: // Slime trap (floor) + *pIcon = Object::SlimeTrapFloor_1; + break; + case 7: // Slime trap (ceiling) + *pIcon = Object::SlimeTrapCeiling_1; + break; + case 8: // Circular saw + PlaceMenuItem(pIcon, table_decor_scie, m_lastDecorIndexes[43], flags, *pIcon, FALSE); + break; + case 9: // Inverter + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_INVERT; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xBB; + break; + case 10: // Lightning + *pIcon = Object::LightningMachine; + break; + case 11: // Crusher + *pIcon = Object::Crusher_1; + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu6(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel) || currentIcon == 0) return; + + switch (m_iconLift) { + + } + + switch (index) { + case 0: // Slow lift + case 1: // Normal lift + case 2: // Fast lift + case 3: // Fast/Slow lift + case 4: // Lift with conveyor belt + case 5: // Bulldozer + case 6: // Fish + case 7: // Bird + case 8: // Wasp + case 9: // Slime creature + case 10: // Moving bomb + case 11: // Heliported ennemy + case 12: // Motorized ennemy + } +} + +void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + MoveObject* pMob; + int mobId; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Chest + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_TRESOR; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x00; + break; + case 1: // Egg + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_EGG; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x15; + break; + case 2: // Lollipop + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_POWER; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x88; + break; + case 3: // Shield + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_SHIELD; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x90; + break; + case 4: // Invisibility potion + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_DRINK; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xB2; + break; + case 5: // Glue supply + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_BULLET; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xB1; + break; + case 6: // Recharging device + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_CHARGE; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xEE; + break; + case 7: // Personal bomb + int type; + mobId = MoveObjectSearch(cel, -1); + if (mobId != -1 && currentIcon != 0) { + if (mobId >= TYPE_BOMBEPERSO4) { + m_lastDecorIndexes[60] = 0; + } + else { + m_lastDecorIndexes[60] = m_moveObject[mobId].type - TYPE_BOMBEPERSO1; + } + } + type = m_lastDecorIndexes[60] + TYPE_BOMBEPERSO1; + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = type; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + switch (type) { + default: + case TYPE_BOMBEPERSO1: + pMob->channel = CHBLUPI; + break; + case TYPE_BOMBEPERSO2: + pMob->channel = CHBLUPI1; + break; + case TYPE_BOMBEPERSO3: + pMob->channel = CHBLUPI2; + break; + case TYPE_BOMBEPERSO4: + pMob->channel = CHBLUPI3; + break; + } + pMob->icon = 0x101; + break; + case 8: // Dynamite + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_DYNAMITE; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xFC; + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu8(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Key + case 1: // Door + case 2: // Closed while not all chests have been found + case 3: // Teleporter + case 4: // Bar to hang from + case 5: // Spring + case 6: // Vanishing bloc + case 7: // Fragile bridge + case 8: // Wooden case + case 9: // Secret wooden case + } +} + +void CDecor::PlaceItemFromMenu9(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Hovercraft + case 1: // Helicopter + case 2: // Skateboard + case 3: // Jeep + case 4: // Glue tank + } +} + +void CDecor::PlaceItemFromMenu10(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Goal + case 1: // Yellow Blupi + case 2: // Orange Blupi + case 3: // Blue Blupi + case 4: // Green Blupi + case 5: // Door + case 6: // Level start + case 7: // Key + } +} + +char* CDecor::GetMissionTitle() +{ + return m_missionTitle; +} + +void CDecor::SetMissionTitle(char *str) +{ + strcpy(m_missionTitle, str); +} diff --git a/src/decio.cpp b/src/decio.cpp new file mode 100644 index 0000000..2989164 --- /dev/null +++ b/src/decio.cpp @@ -0,0 +1,49 @@ +// DecIO.cpp +// + +#include "def.h" +#include "decor.h" +#include "misc.h" + +void CDecor::GetMissionPath(char* str, int user, int mission, BOOL bUser) +{ + if (bUser != 0) + { + sprintf(str, "data\%.3d-%.3d.blp", user, mission); + AddUserPath(str); + return; + } + sprintf(str, "data\world%.3d.blp", mission); + AddUserPath(str); + return; +} + +BOOL CDecor::CurrentWrite(int gamer, int mission, BOOL bUser) +{ + return FALSE; //TODO +} + +BOOL CDecor::CurrentRead(int gamer, int mission, BOOL bUser) +{ + return FALSE; //TODO +} + +BOOL CDecor::SomethingMissionPath(int gamer, int mission, BOOL bUser) +{ + return FALSE; //TODO +} + +BOOL CDecor::MissionStart(int gamer, int mission, BOOL bUser) +{ + return FALSE; //TODO +} + +BOOL CDecor::Read(int gamer, int mission, BOOL *pbMission, BOOL *pbPrivate) +{ + return FALSE; //TODO +} + +BOOL CDecor::Write(int gamer, int mission, char* param3) +{ + return FALSE; //TODO +} diff --git a/src/decmove.cpp b/src/decmove.cpp new file mode 100644 index 0000000..26707a0 --- /dev/null +++ b/src/decmove.cpp @@ -0,0 +1,2213 @@ +// DecMove.cpp +// + +#include "def.h" +#include "decor.h" +#include "misc.h" +#include "dectables.h" + + +BOOL CDecor::TestPath(RECT rect, POINT start, POINT end) +{ + int num = abs(end.x - start.x); + int num2 = abs(end.y - start.y); + + POINT tinyPoint = start; + if (num > num2) + { + RECT rect2; + if (end.x > start.x) + { + for (int i = 0; i <= num; i++) + { + int j = i * (end.y - start.y) / num; + rect2.left = rect.left + i; + rect2.right = rect.right + i; + rect2.top = rect.top + j; + rect2.bottom = rect.bottom + j; + if (DecorDetect(rect2)) + { + end = tinyPoint; + return FALSE; + } + tinyPoint.x = start.x + i; + tinyPoint.y = start.y + j; + } + } + if (end.x < start.x) + { + for (int i = 0; i >= -num; i--) + { + int j = i * (start.y - end.y) / num; + rect2.left = rect.left + i; + rect2.right = rect.right + i; + rect2.top = rect.top + j; + rect2.bottom = rect.bottom + j; + if (DecorDetect(rect2)) + { + end = tinyPoint; + return FALSE; + } + tinyPoint.x = start.x + i; + tinyPoint.y = start.y + j; + } + } + } + else + { + RECT rect2; + if (end.y > start.y) + { + for (int j = 0; j <= num2; j++) + { + int i = j * (end.x - start.x) / num2; + rect2.left = rect.left + i; + rect2.right = rect.right + i; + rect2.top = rect.top + j; + rect2.bottom = rect.bottom + j; + if (DecorDetect(rect2)) + { + end = tinyPoint; + return FALSE; + } + tinyPoint.x = start.x + i; + tinyPoint.y = start.y + j; + } + } + if (end.y < start.y) + { + for (int j = 0; j >= -num2; j--) + { + int i = j * (start.x - end.x) / num2; + rect2.left = rect.left + i; + rect2.right = rect.right + i; + rect2.top = rect.top + j; + rect2.bottom = rect.bottom + j; + if (DecorDetect(rect2)) + { + end = tinyPoint; + return FALSE; + } + tinyPoint.x = start.x + i; + tinyPoint.y = start.y + j; + } + } + } + return TRUE; +} + + +void CDecor::MoveObjectPollution() +{ +} + +void CDecor::MoveObjectPlouf(POINT pos) +{ + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 14) + { + return; + } + } + pos.y -= 45; + PlaySound(23, pos); + ObjectStart(pos, 14, 0); +} + +void CDecor::MoveObjectTiplouf(POINT pos) +{ + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 35) + { + return; + } + } + if (m_blupiDir == 2) + { + pos.x += 5; + } + else + { + pos.x -= 5; + } + pos.y -= 45; + PlaySound(64, pos); + ObjectStart(pos, 35, 0); +} + +void CDecor::MoveObjectBlup(POINT pos) +{ + PlaySound(24, pos); + pos.y -= 20; + int num = 0; + POINT tinyPoint = pos; + while (tinyPoint.y > 0) + { + int icon = m_decor[(tinyPoint.x + 16) / 64, tinyPoint.y / 64].icon; + if (icon != 91 && icon != 92) + { + break; + } + num++; + tinyPoint.y -= 64; + } + num--; + if (num <= 0) + { + return; + } + int num2 = MoveObjectFree(); + if (num2 == -1) + { + return; + } + m_moveObject[num2].type = 15; + m_moveObject[num2].phase = 0; + m_moveObject[num2].posCurrent.x = pos.x; + m_moveObject[num2].posCurrent.y = pos.y; + m_moveObject[num2].posStart = m_moveObject[num2].posCurrent; + m_moveObject[num2].posEnd.x = pos.x; + m_moveObject[num2].posEnd.y = pos.y - num * 64; + m_moveObject[num2].timeStopStart = 0; + m_moveObject[num2].stepAdvance = num * 10; + m_moveObject[num2].step = 2; + m_moveObject[num2].time = 0; + MoveObjectStepIcon(num2); +} + + +void CDecor::FlushBalleTraj() +{ + for (int i = 0; i < 1300; i++) + { + m_balleTraj[i] = 0; + } +} + +void CDecor::SetBalleTraj(POINT pos) +{ + if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) + { + return; + } + int num = pos.y * 13; + num += pos.x / 8; + int num2 = pos.x & 7; + m_balleTraj[num] |= 1 << num2; +} + +BOOL CDecor::IsBalleTraj(POINT pos) +{ + pos.x = (pos.x + 32) / 64; + pos.y = (pos.y + 32) / 64; + if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) + { + return FALSE; + } + int num = pos.y * 13; + num += pos.x / 8; + int num2 = pos.x & 7; + return (m_balleTraj[num] & 1 << num2) != 0; +} + +void CDecor::FlushMoveTraj() +{ + for (int i = 0; i < 1300; i++) + { + m_moveTraj[i] = 0; + } +} + +void CDecor::SetMoveTraj(POINT pos) +{ + + if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) + { + return; + } + int num = pos.y * 13; + num += pos.x / 8; + int num2 = pos.x & 7; + m_moveTraj[num] |= 1 << num2; +} + +BOOL CDecor::IsMoveTraj(POINT pos) +{ + pos.x = (pos.x + 32) / 64; + pos.y = (pos.y + 32) / 64; + if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) + { + return FALSE; + } + int num = pos.y * 13; + num += pos.x / 8; + int num2 = pos.x & 7; + return (m_moveTraj[num] & 1 << num2) != 0; +} + +int CDecor::SearchDistRight(POINT pos, POINT dir, int type) +{ + int num = 0; + if (type == 36 || type == 39 || type == 41 || type == 42 || type == 93) + { + return 500; + } + pos.x = (pos.x + 32) / 64; + pos.y = (pos.y + 32) / 64; + while (pos.x >= 0 && pos.x < 100 && pos.y >= 0 && pos.y < 100 && !IsBlocIcon(m_decor[pos.x][pos.y].icon)) + { + if (type == 23) + { + SetBalleTraj(pos); + } + num += 64; + pos.x += dir.x; + pos.y += dir.y; + } + if ((type == 34 || type == 38) && num >= 64) + { + num -= 64; + } + if (type == 23 && num >= 10) + { + num -= 10; + } + return num; +} + + +void CDecor::StartSploutchGlu(POINT pos) +{ + POINT pos2; + pos2.x = pos.x; + pos2.y = pos.y; + ObjectStart(pos2, 98, 0); + pos2.x = pos.x + 15; + pos2.y = pos.y + 20; + ObjectStart(pos2, 99, 0); + pos2.x = pos.x - 20; + pos2.y = pos.y + 18; + ObjectStart(pos2, 99, 0); + pos2.x = pos.x + 23; + pos2.y = pos.y - 18; + ObjectStart(pos2, 99, 0); + pos2.x = pos.x - 15; + pos2.y = pos.y - 18; + ObjectStart(pos2, 99, 0); + pos2.x = pos.x + 32; + pos2.y = pos.y + 10; + ObjectStart(pos2, 100, 0); + pos2.x = pos.x - 28; + pos2.y = pos.y + 15; + ObjectStart(pos2, 100, 0); + StopSound(16); + StopSound(18); + StopSound(29); + StopSound(31); + PlaySound(51, pos); +} + +int CDecor::ObjectStart(POINT pos, int type, int speed) +{ + int num = MoveObjectFree(); + if (num == -1) + { + return -1; + } + m_moveObject[num].type = type; + m_moveObject[num].phase = 0; + m_moveObject[num].posCurrent = pos; + m_moveObject[num].posStart = pos; + m_moveObject[num].posEnd = pos; + MoveObjectStopIcon(num); + if (speed != 0) + { + POINT tinyPoint = pos; + int num2 = speed; + int num3 = 0; + if (num2 > 50) + { + num2 -= 50; + POINT dir; + dir.x = 0; + dir.y = 1; + num3 = SearchDistRight(tinyPoint, dir, type); + tinyPoint.y += num3; + } + else if (num < -50) + { + num2 += 50; + POINT dir; + dir.x = 0; + dir.y = -1; + num3 = SearchDistRight(tinyPoint, dir, type); + tinyPoint.y -= num3; + } + else if (num2 > 0) + { + POINT dir; + dir.x = 1; + dir.y = 0; + num3 = SearchDistRight(tinyPoint, dir, type); + tinyPoint.x += num3; + } + else if (num2 < 0) + { + POINT dir; + dir.x = -1; + dir.y = 0; + num3 = SearchDistRight(tinyPoint, dir, type); + tinyPoint.x -= num3; + } + if (num3 == 0) + { + if (type == 23) + { + m_moveObject[num].type = 0; + return num; + } + } + else + { + m_moveObject[num].posEnd = tinyPoint; + m_moveObject[num].timeStopStart = 0; + m_moveObject[num].stepAdvance = abs(num2 * num3 / 64); + m_moveObject[num].step = 2; + m_moveObject[num].time = 0; + } + } + MoveObjectPriority(num); + return num; +} + +BOOL CDecor::ObjectDelete(POINT pos, int type) +{ + int num = MoveObjectSearch(pos, type); + if (num == -1) + { + return FALSE; + } + if (m_moveObject[num].type == 4 || + m_moveObject[num].type == 12 || + m_moveObject[num].type == 16 || + m_moveObject[num].type == 17 || + m_moveObject[num].type == 20 || + m_moveObject[num].type == 40 || + m_moveObject[num].type == 96 || + m_moveObject[num].type == 97) + { + int num2 = 17; + double animationSpeed = 1.0; + if (m_moveObject[num].type == 4) + { + num2 = 7; + } + if (m_moveObject[num].type == 17 || m_moveObject[num].type == 20) + { + num2 = 33; + } + if (m_moveObject[num].type == 40) + { + animationSpeed = 0.5; + } + + } + m_moveObject[num].type = 0; + return TRUE; +} + +void CDecor::MoveObjectStep() +{ + m_blupiVector.x = 0; + m_blupiVector.y = 0; + m_blupiTransport = -1; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type != 0) + { + MoveObjectStepLine(i); + MoveObjectStepIcon(i); + if (m_moveObject[i].type == 4 || + m_moveObject[i].type == 33 || + m_moveObject[i].type == 32) + int num = MovePersoDetect(m_moveObject[i].posCurrent); + if (num != -1) + { + POINT posCurrent = m_moveObject[i].posCurrent; + posCurrent.x -= 34; + posCurrent.y -= 34; + ObjectStart(posCurrent, 8, 0); + PlaySound(10, m_moveObject[i].posCurrent); + m_decorAction = 1; + m_decorPhase = 0; + posCurrent = m_moveObject[i].posCurrent; + posCurrent.x += 2; + posCurrent.y += BLUPIOFFY; + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); + ObjectStart(posCurrent, 37, 0); + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); + } + if (BlupiElectro(m_moveObject[i].posCurrent)) + { + POINT posCurrent = m_moveObject[i].posCurrent; + posCurrent.x += 2; + posCurrent.y += BLUPIOFFY; + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); + ObjectStart(posCurrent, 38, 55); + PlaySound(59, posCurrent); + } + } + } +} + +void CDecor::MoveObjectStepLine(int i) +{ + MoveObject moveObject; + POINT tinyPoint; + BOOL flag = FALSE; + RECT tinyRect; + if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48 && !m_blupiSuspend) + { + RECT src; + src.left = m_blupiPos.x + 20; + src.right = m_blupiPos.x + 60 - 20; + src.top = m_blupiPos.y + 60 - 2; + src.bottom = m_blupiPos.y + 60 - 1; + tinyRect.left = m_moveObject[i].posCurrent.x; + tinyRect.right = m_moveObject[i].posCurrent.x + 64; + tinyRect.top = m_moveObject[i].posCurrent.y; + tinyRect.bottom = m_moveObject[i].posCurrent.y + 16; + RECT tinyRect2; + flag = IntersectRect(tinyRect2, tinyRect, src); + tinyPoint = m_moveObject[i].posCurrent; + } + POINT posCurrent; + if (m_blupiFocus && !m_blupiHide && m_moveObject[i].type == 97) + { + posCurrent = m_moveObject[i].posCurrent; + if (posCurrent.x < m_blupiPos.x) + { + posCurrent.x++; + } + if (posCurrent.x > m_blupiPos.x) + { + posCurrent.x--; + } + if (posCurrent.y < m_blupiPos.y) + { + posCurrent.y++; + } + if (posCurrent.y > m_blupiPos.y) + { + posCurrent.y--; + } + tinyRect.left = posCurrent.x + 10; + tinyRect.right = posCurrent.x + 60 - 10; + tinyRect.top = posCurrent.y + 10; + tinyRect.bottom = posCurrent.y + 60 - 10; + if (TestPath(tinyRect, m_moveObject[i].posCurrent, posCurrent)) + { + m_moveObject[i].posCurrent = posCurrent; + m_moveObject[i].posStart = posCurrent; + m_moveObject[i].posEnd = posCurrent; + } + else + { + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); + posCurrent.x -= 34; + posCurrent.y -= 34; + ObjectStart(posCurrent, 9, 0); + PlaySound(10, posCurrent); + m_decorAction = 1; + m_decorPhase = 0; + } + } + if (m_moveObject[i].posStart.x != m_moveObject[i].posEnd.x || m_moveObject[i].posStart.y != m_moveObject[i].posEnd.y) + { + if (m_moveObject[i].step == 1) + { + if (m_moveObject[i].time < m_moveObject[i].timeStopStart) + { + m_moveObject[i].time = m_moveObject[i].time + 1; + } + else + { + m_moveObject[i].step = 2; + m_moveObject[i].time = 0; + } + } + else if (m_moveObject[i].step == 2) + { + if (m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.x || m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.y) + { + m_moveObject[i].time = moveOm_moveObjectbject2[i].time + 1; + if (m_moveObject[i].stepAdvance != 0) + { + m_moveObject[i].posCurrent.x = (m_moveObject[i].posEnd.x - m_moveObject[i].posStart.x) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart.x; + m_moveObject[i].posCurrent.y = (m_moveObject[i].posEnd.y - m_moveObject[i].posStart.y) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart.y; + } + + } + else if (m_moveObject[i].type == 15 || m_moveObject[i].type == 23) + { + m_moveObject[i].type = 0; + } + else if (m_moveObject[i].type == 34) + { + m_moveObject[i].posStart = m_moveObject[i].posCurrent; + m_moveObject[i].posEnd = m_moveObject[i].posCurrent; + m_moveObject[i].step = 3; + m_moveObject[i].time = 0; + } + else + { + m_moveObject[i].step = 3; + m_moveObject[i].time = 0; + } + } + else if (m_moveObject[i].step == 3) + { + if (m_moveObject[i].time < m_moveObject[i].timeStopEnd) + { + m_moveObject[i].time = moveObject3[i].time + 1; + } + else + { + m_moveObject[i].step = 4; + m_moveObject[i].time = 0; + } + } + else if (m_moveObject[i].step == 4) + { + if (m_moveObject[i].posCurrent.x != m_moveObject[i].posStart.x || m_moveObject[i].posCurrent.y != m_moveObject[i].posStart.y) + { + m_moveObject[i].time = moveObject4[i].time + 1; + if (m_moveObject[i].stepRecede != 0) + { + m_moveObject[i].posCurrent.x = (m_moveObject[i].posStart.x - m_moveObject[i].posEnd.x) * + m_moveObject[i].time / m_moveObject[i].stepRecede + m_moveObject[i].posEnd.x; + m_moveObject[i].posCurrent.y = (m_moveObject[i].posStart.y - m_moveObject[i].posEnd.y) * + m_moveObject[i].time / m_moveObject[i].stepRecede + m_moveObject[i].posEnd.y; + } + } + else + { + m_moveObject[i].step = 1; + m_moveObject[i].time = 0; + } + } + } + if (m_moveObject[i].type == 22 && m_moveObject[i].step == 3) + { + m_moveObject[i].type = 0; + } + posCurrent = m_moveObject[i].posCurrent; + if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48) + { + posCurrent.y -= 64; + } + posCurrent.x = (posCurrent.x + 32) / 64; + posCurrent.y = (posCurrent.y + 32) / 64; + SetMoveTraj(posCurrent); + if (flag) + { + m_blupiVector.x = m_moveObject[i].posCurrent.x - tinyPoint.x; + m_blupiVector.y = m_moveObject[i].posCurrent.y - (m_blupiPos.y + 60 - BLUPIFLOOR); + if (m_moveObject[i].type == 47) + { + m_blupiVector.x = m_blupiVector.x + 2; + } + if (m_moveObject[i].type == 48) + { + m_blupiVector.x = m_blupiVector.x - 2; + } + if (m_blupiTimeNoAsc == 0) + { + m_blupiTransport = i; + } + } +} + +void CDecor::MoveObjectStepIcon(int i) +{ + POINT pos; + if (m_moveObject[i].type == 47) + { + m_moveObject[i].icon = table_chenille[m_moveObject[i].phase / 1 % 6]; + } + if (m_moveObject[i].type == 48) + { + m_moveObject[i].icon = table_chenillei[m_moveObject[i].phase / 1 % 6]; + } + if (m_moveObject[i].type == 2) + { + m_moveObject[i].icon = 12 + m_moveObject[i].phase / 2 % 9; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 3) + { + m_moveObject[i].icon = 48 + m_moveObject[i].phase / 2 % 9; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 16) + { + m_moveObject[i].icon = 69 + m_moveObject[i].phase / 1 % 9; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 96) + { + m_moveObject[i].icon = table_follow1[m_moveObject[i].phase / 1 % 26]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 97) + { + m_moveObject[i].icon = table_follow2[m_moveObject[i].phase / 1 % 5]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 200) + { + m_moveObject[i].icon = 257 + m_moveObject[i].phase / 1 % 6; + m_moveObject[i].channel = 2; + } + if (m_moveObject[i].type == 201) + { + m_moveObject[i].icon = 257 + m_moveObject[i].phase / 1 % 6; + m_moveObject[i].channel = 11; + } + if (m_moveObject[i].type == 202) + { + m_moveObject[i].icon = 257 + m_moveObject[i].phase / 1 % 6; + m_moveObject[i].channel = 12; + } + if (m_moveObject[i].type == 203) + { + m_moveObject[i].icon = 257 + m_moveObject[i].phase / 1 % 6; + m_moveObject[i].channel = 13; + } + if (m_moveObject[i].type == 55) + { + m_moveObject[i].icon = 252; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 56) + { + m_moveObject[i].icon = table_dynamitef[m_moveObject[i].phase / 1 % 100]; + m_moveObject[i].channel = 10; + if (m_moveObject[i].phase == 50) + { + DynamiteStart(i, 0, 0); + } + if (m_moveObject[i].phase == 53) + { + DynamiteStart(i, -100, 8); + } + if (m_moveObject[i].phase == 55) + { + DynamiteStart(i, 80, 10); + } + if (m_moveObject[i].phase == 56) + { + DynamiteStart(i, -15, -100); + } + if (m_moveObject[i].phase == 59) + { + DynamiteStart(i, 20, 70); + } + if (m_moveObject[i].phase == 62) + { + DynamiteStart(i, 30, -50); + } + if (m_moveObject[i].phase == 64) + { + DynamiteStart(i, -40, 30); + } + if (m_moveObject[i].phase == 67) + { + DynamiteStart(i, -180, 10); + } + if (m_moveObject[i].phase == 69) + { + DynamiteStart(i, 200, -10); + } + if (m_moveObject[i].phase >= 70) + { + m_moveObject[i].type = 0; + } + } + if (m_moveObject[i].type == 5) + { + if (m_moveObject[i].phase / 3 % 22 < 11) + { + m_moveObject[i].icon = m_moveObject[i].phase / 3 % 11; + } + else + { + m_moveObject[i].icon = 11 - m_moveObject[i].phase / 3 % 11; + } + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 6) + { + m_moveObject[i].icon = 21 + m_moveObject[i].phase / 4 % 8; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 7) + { + m_moveObject[i].icon = 29 + m_moveObject[i].phase / 3 % 8; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 21) + { + m_moveObject[i].icon = table_cle[m_moveObject[i].phase / 3 % 12]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 49) + { + m_moveObject[i].icon = table_cle1[m_moveObject[i].phase / 3 % 12]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 50) + { + m_moveObject[i].icon = table_cle2[m_moveObject[i].phase / 3 % 12]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 51) + { + m_moveObject[i].icon = table_cle3[m_moveObject[i].phase / 3 % 12]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 24) + { + m_moveObject[i].icon = table_skate[m_moveObject[i].phase / 1 % 34]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 25) + { + m_moveObject[i].icon = table_shield[m_moveObject[i].phase / 2 % 16]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 26) + { + m_moveObject[i].icon = table_power[m_moveObject[i].phase / 2 % 8]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 40) + { + m_moveObject[i].icon = table_invert[m_moveObject[i].phase / 2 % 20]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 31) + { + m_moveObject[i].icon = table_charge[m_moveObject[i].phase / 2 % 6]; + m_moveObject[i].channel = 1; + } + if (m_moveObject[i].type == 27) + { + m_moveObject[i].icon = table_magictrack[m_moveObject[i].phase / 1 % 24]; + m_moveObject[i].channel = 10; + if (m_moveObject[i].phase >= 24) + { + m_moveObject[i].type = 0; + } + } + if (m_moveObject[i].type == 57) + { + m_moveObject[i].icon = table_shieldtrack[m_moveObject[i].phase / 1 % 20]; + m_moveObject[i].channel = 10; + if (m_moveObject[i].phase >= 20) + { + m_moveObject[i].type = 0; + } + } + if (m_moveObject[i].type == 39) + { + m_moveObject[i].icon = table_tresortrack[m_moveObject[i].phase / 1 % 11]; + m_moveObject[i].channel = 10; + if (m_moveObject[i].phase >= 11) + { + m_moveObject[i].type = 0; + } + } + if (m_moveObject[i].type == 58 && m_moveObject[i].phase >= 20) + { + m_moveObject[i].type = 0; + } + if (m_moveObject[i].type == 8) + { + if (m_moveObject[i].phase >= table_explo1->length) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_explo1[m_moveObject[i].phase]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 9) + { + if (m_moveObject[i].phase >= 20) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_explo2[m_moveObject[i].phase % 20]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 10) + { + if (m_moveObject[i].phase >= 20) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_explo3[m_moveObject[i].phase / 1 % 20]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 11) + { + if (m_moveObject[i].phase >= 9) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_explo4[m_moveObject[i].phase / 1 % 9]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 90) + { + if (m_moveObject[i].phase >= 12) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_explo5[m_moveObject[i].phase / 1 % 12]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 91) + { + if (m_moveObject[i].phase >= 6) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_explo6[m_moveObject[i].phase / 1 % 6]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 92) + { + if (m_moveObject[i].phase >= 128) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_explo7[m_moveObject[i].phase / 1 % 128]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 93) + { + if (m_moveObject[i].phase >= 5) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_explo8[m_moveObject[i].phase / 1 % 5]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 98) + { + if (m_moveObject[i].phase >= 10) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_sploutch1[m_moveObject[i].phase / 1 % 10]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 99) + { + if (m_moveObject[i].phase >= 13) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_sploutch2[m_moveObject[i].phase / 1 % 13]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 100) + { + if (m_moveObject[i].phase >= 18) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_sploutch3[m_moveObject[i].phase / 1 % 18]; + m_moveObject[i].channel = 9; + } + } + if (m_moveObject[i].type == 53) + { + if (m_moveObject[i].phase >= 90) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_tentacule[m_moveObject[i].phase / 2 % 45]; + m_moveObject[i].channel = 9; + } + } + TinyPoint pos; + if (m_moveObject[i].type == 52) + { + if (m_moveObject[i].phase == 0) + { + PlaySound(72, m_moveObject[i].posStart); + } + if (m_moveObject[i].phase == 137) + { + PlaySound(73, m_moveObject[i].posStart); + } + if (m_moveObject[i].phase >= 157) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_bridge[m_moveObject[i].phase / 1 % 157]; + m_moveObject[i].channel = 1; + pos.x = m_moveObject[i].posStart.x / 64; + pos.y = m_moveObject[i].posStart.y / 64; + m_decor[pos.x][pos.y].icon = m_moveObject[i].icon; + } + } + if (m_moveObject[i].type == 36) + { + if (m_moveObject[i].phase >= 16) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_pollution[m_moveObject[i].phase / 2 % 8]; + m_moveObject[i].channel = 10; + } + } + if (m_moveObject[i].type == 41) + { + if (m_moveObject[i].phase >= 16) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_invertstart[m_moveObject[i].phase / 2 % 8]; + m_moveObject[i].channel = 10; + } + } + if (m_moveObject[i].type == 42) + { + if (m_moveObject[i].phase >= 16) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_invertstop[m_moveObject[i].phase / 2 % 8]; + m_moveObject[i].channel = 10; + } + } + if (m_moveObject[i].type == 14) + { + if (m_moveObject[i].phase >= 14) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_plouf[m_moveObject[i].phase / 2 % 7]; + m_moveObject[i].channel = 1; + } + } + if (m_moveObject[i].type == 35) + { + if (m_moveObject[i].phase >= 6) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_tiplouf[m_moveObject[i].phase / 2 % 7]; + m_moveObject[i].channel = 1; + } + } + if (m_moveObject[i].type == 15) + { + m_moveObject[i].icon = table_blup[m_moveObject[i].phase / 2 % 20]; + m_moveObject[i].channel = 1; + } + if (m_moveObject[i].type == 4) + { + if (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x) + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_bulldozer_turn2l[m_moveObject[i].time % 22]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_bulldozer_turn2r[m_moveObject[i].time % 22]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_bulldozer_left[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_bulldozer_right[m_moveObject[i].time % 8]; + } + } + else + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_bulldozer_turn2r[m_moveObject[i].time % 22]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_bulldozer_turn2l[m_moveObject[i].time % 22]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_bulldozer_right[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_bulldozer_left[m_moveObject[i].time % 8]; + } + } + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 17) + { + if (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x) + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_poisson_turn2l[m_moveObject[i].time % 48]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_poisson_turn2r[m_moveObject[i].time % 48]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_poisson_left[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_poisson_right[m_moveObject[i].time % 8]; + } + } + else + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_poisson_turn2r[m_moveObject[i].time % 48]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_poisson_turn2l[m_moveObject[i].time % 48]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_poisson_right[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_poisson_left[m_moveObject[i].time % 8]; + } + } + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 20) + { + if (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x) + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_oiseau_turn2l[m_moveObject[i].time % 10]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_oiseau_turn2r[m_moveObject[i].time % 10]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_oiseau_left[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_oiseau_right[m_moveObject[i].time % 8]; + } + } + else + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_oiseau_turn2r[m_moveObject[i].time % 10]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_oiseau_turn2l[m_moveObject[i].time % 10]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_oiseau_right[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_oiseau_left[m_moveObject[i].time % 8]; + } + } + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 44) + { + if (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x) + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_guepe_turn2l[m_moveObject[i].time % 5]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_guepe_turn2r[m_moveObject[i].time % 5]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_guepe_left[m_moveObject[i].time % 6]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_guepe_right[m_moveObject[i].time % 6]; + } + } + else + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_guepe_turn2r[m_moveObject[i].time % 5]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_guepe_turn2l[m_moveObject[i].time % 5]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_guepe_right[m_moveObject[i].time % 6]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_guepe_left[m_moveObject[i].time % 6]; + } + } + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 54) + { + if (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x) + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 152]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 152]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_creature_left[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_creature_right[m_moveObject[i].time % 8]; + } + } + else + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 152]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 152]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_creature_right[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_creature_left[m_moveObject[i].time % 8]; + } + } + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 32) + { + if (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x) + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_blupih_turn2l[m_moveObject[i].time % 26]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_blupih_turn2r[m_moveObject[i].time % 26]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_blupih_left[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_blupih_right[m_moveObject[i].time % 8]; + } + } + else + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_blupih_turn2r[m_moveObject[i].time % 26]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_blupih_turn2l[m_moveObject[i].time % 26]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_blupih_right[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_blupih_left[m_moveObject[i].time % 8]; + } + } + if ((m_moveObject[i].step == 1 || m_moveObject[i].step == 3) && m_moveObject[i].time == 21) + { + pos.x = m_moveObject[i].posCurrent.x; + pos.y = m_moveObject[i].posCurrent.y + 40; + if (ObjectStart(pos, 23, 55) != -1) + { + PlaySound(52, pos); + } + } + } + if (m_moveObject[i].type == 33) + { + if (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x) + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_blupit_turn2l[m_moveObject[i].time % 24]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_blupit_turn2r[m_moveObject[i].time % 24]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_blupit_left[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_blupit_right[m_moveObject[i].time % 8]; + } + } + else + { + if (m_moveObject[i].step == 1) + { + m_moveObject[i].icon = table_blupit_turn2r[m_moveObject[i].time % 24]; + } + if (m_moveObject[i].step == 3) + { + m_moveObject[i].icon = table_blupit_turn2l[m_moveObject[i].time % 24]; + } + if (m_moveObject[i].step == 2) + { + m_moveObject[i].icon = table_blupit_right[m_moveObject[i].time % 8]; + } + if (m_moveObject[i].step == 4) + { + m_moveObject[i].icon = table_blupit_left[m_moveObject[i].time % 8]; + } + } + if ((m_moveObject[i].step == 1 || m_moveObject[i].step == 3) && m_moveObject[i].time == 3) + { + int speed; + if ((m_moveObject[i].posStart.x < m_moveObject[i].posEnd.x && m_moveObject[i].step == 1) || (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x && m_moveObject[i].step == 3)) + { + pos.x = m_moveObject[i].posCurrent.x - 30; + pos.y = m_moveObject[i].posCurrent.x + BLUPIOFFY; + speed = -5; + } + else + { + pos.x = m_moveObject[i].posCurrent.x + 30; + pos.y = m_moveObject[i].posCurrent.y + BLUPIOFFY; + speed = 5; + } + if (ObjectStart(pos, 23, speed) != -1) + { + PlaySound(52, pos); + } + } + if ((m_moveObject[i].step == 1 || m_moveObject[i].step == 3) && m_moveObject[i].time == 21) + { + int speed; + if ((m_moveObject[i].posStart.x < m_moveObject[i].posEnd.x && m_moveObject[i].step == 1) || (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x && m_moveObject[i].step == 3)) + { + pos.x = m_moveObject[i].posCurrent.x + 30; + pos.y = m_moveObject[i].posCurrent.y + BLUPIOFFY; + speed = 5; + } + else + { + pos.x = m_moveObject[i].posCurrent.x - 30; + pos.y = m_moveObject[i].posCurrent.y + BLUPIOFFY; + speed = -5; + } + if (ObjectStart(pos, 23, speed) != -1) + { + PlaySound(52, pos); + } + } + } + if (m_moveObject[i].type == 34) + { + m_moveObject[i].icon = table_glu[m_moveObject[i].phase / 1 % 25]; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 37) + { + if (m_moveObject[i].phase >= 70) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_clear[m_moveObject[i].phase / 1 % 70]; + m_moveObject[i].channel = 10; + } + } + if (m_moveObject[i].type == 38) + { + if (m_moveObject[i].phase >= 90) + { + m_moveObject[i].type = 0; + } + else + { + m_moveObject[i].icon = table_electro[m_moveObject[i].phase / 1 % 90]; + if (m_moveObject[i].phase < 30) + { + m_moveObject[i].channel = 12; + } + else + { + m_moveObject[i].channel = 10; + } + } + } + if (m_moveObject[i].type == 13) + { + m_moveObject[i].icon = 68; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 46) + { + m_moveObject[i].icon = 208; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 19) + { + m_moveObject[i].icon = 89; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 28) + { + m_moveObject[i].icon = 167; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 23) + { + m_moveObject[i].icon = 176; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 29) + { + m_moveObject[i].icon = 177; + m_moveObject[i].channel = 10; + } + if (m_moveObject[i].type == 30) + { + m_moveObject[i].icon = 178; + m_moveObject[i].channel = 10; + } + MoveObject[] moveObject = m_moveObject; + moveObject[i].phase = moveObject[i].phase + 1; + if (m_moveObject[i].phase > 32700) + { + m_moveObject[i].phase = 0; + } +} + +void CDecor::DynamiteStart(int i, int dx, int dy) +{ + POINT posStart = m_moveObject[i].posStart; + posStart.x -= 34; + posStart.y -= 34; + posStart.x += dx; + posStart.y -= dy; + ObjectStart(posStart, 8, 0); + if (dx == 0 && dy == 0) + { + PlaySound(10, posStart); + m_decorAction = 1; + m_decorPhase = 0; + } + RECT src; + src.left = posStart.x; + src.right = posStart.x + 128; + src.top = posStart.y; + src.bottom = posStart.y + 128; + POINT tinyPoint; + for (int j = 0; j < 2; j++) + { + tinyPoint.x = posStart.x / 64; + for (int k = 0; k < 2; j++) + { + if (tinyPoint.x >= 0 && tinyPoint.x < 100 && tinyPoint.y >= 0 && tinyPoint.y < 100) + { + int icon = m_decor[tinyPoint.x, tinyPoint.y].icon; + if (icon == 378 || icon == 379 || icon == 404 || icon == 410) + { + POINT pos; + pos.x = tinyPoint.x * 64; + pos.y = tinyPoint.y * 64; + ModifDecor(pos, -1); + } + } + tinyPoint.x++; + } + tinyPoint.y++; + } + for (i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 2 || m_moveObject[i].type == 3 || m_moveObject[i].type == 96 || m_moveObject[i].type == 97 || m_moveObject[i].type == 4 || + m_moveObject[i].type == 6 || m_moveObject[i].type == 12 || m_moveObject[i].type == 13 || m_moveObject[i].type == 16 || m_moveObject[i].type == 17 || + m_moveObject[i].type == 19 || m_moveObject[i].type == 20 || m_moveObject[i].type == 24 || m_moveObject[i].type == 25 || m_moveObject[i].type == 26 || m_moveObject[i].type == 28 || + m_moveObject[i].type == 30 || m_moveObject[i].type == 32 || m_moveObject[i].type == 33 || m_moveObject[i].type == 34 || m_moveObject[i].type == 40 || m_moveObject[i].type == 44 || + m_moveObject[i].type == 46 || m_moveObject[i].type == 52 || m_moveObject[i].type == 54 || m_moveObject[i].type == 200 || m_moveObject[i].type == 201 || m_moveObject[i].type == 202 || + m_moveObject[i].type == 203) + { + RECT src2; + src2.left = m_moveObject[i].posCurrent.x; + src2.right = m_moveObject[i].posCurrent.x + 60; + src2.top = m_moveObject[i].posCurrent.y; + src2.bottom = m_moveObject[i].posCurrent.y + 20; + RECT tinyRect; + if (IntersectRect(tinyRect, src2, src)) + { + if (m_moveObject[i].type == 12) + { + SearchLinkCaisse(i, TRUE); + for (int l = 0; l < m_nbLinkCaisse; l++) + { + int channel = m_moveObject[m_linkCaisse[l]].channel; + int icon2 = m_moveObject[m_linkCaisse[l]].icon; + POINT posCurrent = m_moveObject[m_linkCaisse[l]].posCurrent; + double num = (double)Random(7, 23); + if (m_random->next(0, 100) % 2 == 0) + { + num = -num; + } + ByeByeAdd(channel, icon2, posCurrent, num, 1.0); + m_moveObject[m_linkCaisse[l]].type = 0; + } + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); + UpdateCaisse(); + } + else + { + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); + } + } + } + } + if (m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPos.x > posStart.x - 30 && m_blupiPos.x < posStart.x + 30 + 64 && m_blupiPos.y > posStart.y - 30 && m_blupiPos.y < posStart.y + 30 + 64) + { + BlupiDead(11, -1); + m_blupiAir = TRUE; + } + +} + +int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos) +{ + if (m_blupiTimeNoAsc != 0) + { + return -1; + } + int num = newpos.y - oldpos.y; + int num2; + if (num < 0) + { + num2 = -30; + } + else + { + num2 = 30; + } + num = abs(num); + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48) + { + RECT src; + src.left = m_moveObject[i].posCurrent.x; + src.right = m_moveObject[i].posCurrent.x + 64; + src.top = m_moveObject[i].posCurrent.y; + src.bottom = m_moveObject[i].posCurrent.y + 16; + if (num < 30) + { + RECT tinyRect; + if (IntersectRect(tinyRect, src, rect)) + { + return i; + } + } + else + { + RECT src2 = rect; + src2.top -= num / 30 * num2; + src2.bottom -= num / 30 * num2; + for (int j = 0; j <= num / 30; j++) + { + RECT tinyRect; + if (IntersectRect(tinyRect, src, src2)) + { + return i; + } + src2.top += num2; + src2.bottom += num; + } + } + + } + } + return -1; +} + +void CDecor::AscenseurVertigo(int i, BOOL* pbVertigoLeft, BOOL* pbVertigoRight) +{ + pbVertigoLeft = FALSE; + pbVertigoRight = FALSE; + if (m_blupiPos.x + 20 + 4 < m_moveObject[i].posCurrent.x) + { + pbVertigoLeft = TRUE; + } + if (m_blupiPos.x + 60 - 20 - 4 > m_moveObject[i].posCurrent.x + 64) + { + pbVertigoRight = TRUE; + } + if (AscenseurShift(i)) + { + if (pbVertigoLeft) + { + pbVertigoLeft = FALSE; + pbVertigoRight = TRUE; + m_blupiTimeNoAsc = 10; + return; + } + if (pbVertigoRight) + { + pbVertigoRight = FALSE; + pbVertigoLeft = TRUE; + m_blupiTimeNoAsc = 10; + } + } +} + +BOOL CDecor::AscenseurShift(int i) +{ + return i != -1 && m_moveObject[i].icon >= 311 && m_moveObject[i].icon <= 316; +} + +void CDecor::AscenseurSynchro(int i) +{ + for (i = 0; i < MAXMOVEOBJECT; i++) + { + m_moveObject[i].posCurrent = m_moveObject[i].posStart; + m_moveObject[i].step = 1; + m_moveObject[i].time = 0; + m_moveObject[i].phase = 0; + } +} + +void CDecor::UpdateCaisse() +{ + m_nbRankCaisse = 0; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == TYPE_CAISSE) + { + m_rankCaisse[m_nbRankCaisse++] = i; + } + } +} + +BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop) +{ + POINT move; + + move.x = pos.x - m_moveObject[i].posCurrent.x; + move.y = 0; + SearchLinkCaisse(i, bPop); + int y = m_moveObject[i].posCurrent.y; + for (int j = 0; j < m_nbLinkCaisse; j++) + { + i = m_linkCaisse[j]; + if (!TestPushOneCaisse(i, move, y)) + { + return FALSE; + } + } + for (int j = 0; j < m_nbLinkCaisse; j++) + { + i = m_linkCaisse[j]; + int num = i; + m_moveObject[num].posCurrent.x = m_moveObject[num].posCurrent.x + move.x; + m_moveObject[num].posStart.x = m_moveObject[num].posStart.x + move.x; + int num2 = i; + m_moveObject[num].posEnd.x = m_moveObject[num].posEnd.x + move.x; + } + return TRUE; +} + +BOOL CDecor::TestPushOneCaisse(int i, POINT move, int b) +{ + +} + +void CDecor::SearchLinkCaisse(int rank, BOOL bPop) +{ + m_nbLinkCaisse = 0; + AddLinkCaisse(rank); + POINT posCurrent = m_moveObject; + + BOOL flag; + do + { + flag = FALSE; + for (int i = 0; i < m_nbLinkCaisse; i++) + { + int num = m_linkCaisse[i]; + if (m_moveObject[num].posCurrent.y <= + posCurrent.y && (!bPop || (m_moveObject + [num].posCurrent.x >= posCurrent.x - 32 && + m_moveObject[num].posCurrent.x <= + posCurrent.x + 32))) + { + RECT src; + src.left = m_moveObject[num].posCurrent.x - 1; + src.top = m_moveObject[num].posCurrent.y - 1; + src.right = src.left + 64 + 1; + src.bottom = src.top + 64 + 1; + for (int j = 0; j < m_nbRankCaisse; j++) + { + int num2 = m_rankCaisse[j]; + if (num2 != num && m_moveObject[num2].posCurrent.y <= posCurrent.y && (!bPop || (m_moveObject[num2].posCurrent.x >= posCurrent.x - 32 && m_moveObject[num2].posCurrent.x <= posCurrent.x + 32))) + { + RECT src2; + src2.left = m_moveObject[num2].posCurrent.x - 1; + src2.top = m_moveObject[num2].posCurrent.y - 1; + src2.right = src2.left + 64 + 1; + src2.bottom = src2.top + 64 + 1; + RECT tinyRect; + if (IntersectRect(tinyRect, src2, src) && AddLinkCaisse(num2)) + { + flag = TRUE; + } + } + } + } + } + } while (flag); +} + +BOOL CDecor::AddLinkCaisse(int rank) +{ + for (int i = 0; i < m_nbLinkCaisse; i++) + { + if (m_linkCaisse[i] == rank) + { + return FALSE; + } + } + m_linkCaisse[m_nbLinkCaisse] = rank; + m_nbLinkCaisse++; + return TRUE; +} + +int CDecor::CaisseInFront() +{ + POINT tinyPoint; + if (m_blupiDir == 1) + { + tinyPoint.x = m_blupiPos.x + 16 - 32; + tinyPoint.y = m_blupiPos.y; + } + else + { + tinyPoint.x = m_blupiPos.x + 60 - 16 + 32; + tinyPoint.y = m_blupiPos.y; + } + for (int i = 0; i < m_nbRankCaisse; i++) + { + int num = m_rankCaisse[i]; + if (tinyPoint.x > m_moveObject[num].posCurrent.x && + tinyPoint.x < m_moveObject[num].posCurrent.x + 64 && + tinyPoint.y > m_moveObject[num].posCurrent.y && + tinyPoint.y < m_moveObject[num].posCurrent.y + 64) + { + return num; + } + } + return -1; +} + +int CDecor::CaisseGetMove(int max) +{ + max -= (m_nbLinkCaisse - 1) / 2; + if (max < 1) + { + max = 1; + } + if (m_blupiPower) + { + max *= 2; + } + if (m_blupiPhase < 20) + { + max = max * m_blupiPhase / 20; + if (max == 0) + { + max++; + } + } + return max; +} + +int CDecor::MockeryDetect(POINT pos) +{ + if (m_blupiTimeMockery > 0) + { + return 0; + } + if (m_blupiAir) + { + POINT tinyPoint; + tinyPoint.x = pos.x + 30; + tinyPoint.y = pos.y + 30 + 64; + if (tinyPoint.x >= 0 && tinyPoint.x < 6400 && tinyPoint.y >= 0 && tinyPoint.y < 6400) + { + int icon = m_decor[tinyPoint.x / 64, tinyPoint.y / 64].icon; + if (icon == 68 || icon == 317) + { + return 64; + } + } + } + RECT src; + src.left = pos.x; + src.right = pos.x + 60; + src.top = pos.y + 11; + src.bottom = pos.y + 60; + if (m_blupiAir) + { + src.bottom += 90; + } + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 2 || + m_moveObject[i].type == 16 || + m_moveObject[i].type == 96 || + m_moveObject[i].type == 97 || + m_moveObject[i].type == 4 || + m_moveObject[i].type == 20 || + m_moveObject[i].type == 44 || + m_moveObject[i].type == 54 || + m_moveObject[i].type == 23 || + m_moveObject[i].type == 32 || + m_moveObject[i].type == 33) + { + RECT src2; + src2.left = m_moveObject[i].posCurrent.x; + src2.right = m_moveObject[i].posCurrent.x + 60; + src2.top = m_moveObject[i].posCurrent.y + 36; + src2.bottom = m_moveObject[i].posCurrent.y + 60; + RECT tinyRect; + if (IntersectRect(tinyRect, src2, src)) + { + if (m_moveObject[i].type == 54) + { + return 83; + } + if (m_blupiDir == 2) + { + if (pos.x >= src2.left) + { + return 64; + } + if (m_moveObject[i].type == 2) + { + return 0; + } + return 63; + } + else + { + if (pos.x < src2.left) + { + return 64; + } + if (m_moveObject[i].type == 2) + { + return 0; + } + return 63; + } + } + } + } + return 0; +} + +BOOL CDecor::BlupiElectro(POINT pos) +{ + if (m_blupiCloud) + { + return FALSE; + } + RECT src; + src.left = pos.x + 16; + src.right = pos.x + 60 - 16; + src.top = pos.y + 11; + src.bottom = pos.y + 60 - 2; + RECT src2; + src2.left = m_blupiPos.x - 16 - 40; + src2.right = m_blupiPos.x + 60 + 16 + 40; + src2.top = m_blupiPos.y + 11 - 40; + src2.bottom = m_blupiPos.y + 60 - 2 + 40; + RECT tinyRect; + return IntersectRect(tinyRect, src, src2); +} + +void CDecor::MoveObjectFollow(POINT pos) +{ + if (m_blupiHide) + { + return; + } + RECT src = BlupiRect(pos); + src.left = pos.x + 16; + src.right = pos.x + 60 - 16; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 96) + { + RECT src2; + src2.left = m_moveObject[i].posCurrent.x - 100; + src2.right = m_moveObject[i].posCurrent.x + 60 + 100; + src2.top = m_moveObject[i].posCurrent.y - 100; + src2.bottom = m_moveObject[i].posCurrent.y + 60 + 100; + RECT tinyRect; + if (IntersectRect(tinyRect, src2, src)) + { + m_moveObject[i].type = 97; + PlaySound(92, m_moveObject[i].posCurrent); + } + } + } +} + +int CDecor::MoveObjectDetect(POINT pos, BOOL* pbNear) +{ + RECT src = BlupiRect(pos); + src.left = pos.x + 16; + src.right = pos.x + 60 - 16; + RECT src2; + src2.left = src.left - 20; + src2.right = src.right + 20; + src2.top = src.top - 40; + src2.bottom = src.bottom + 30; + + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type != 0 && + m_moveObject[i].type != 27 && + m_moveObject[i].type != 57 && + m_moveObject[i].type != 39 && + m_moveObject[i].type != 58 && + m_moveObject[i].type != 34 && + m_moveObject[i].type != 37 && + m_moveObject[i].type != 38 && + (m_blupiAction != 14 && m_blupiAction != 29) || + m_moveObject[i].type != 12) + { + RECT src3; + + } + } +} + +int CDecor::MoveAscenseurDetect(POINT pos, int height) +{ + if (m_blupiTimeNoAsc != 0) + { + return -1; + } + RECT src; + src.left = pos.x + 12; + src.right = pos.x + 60 - 12; + src.top = pos.y + 60 - 2; + src.bottom = pos.y + 60 + height - 1; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48) + { + RECT src2; + src2.left = m_moveObject[i].posCurrent.x; + src2.right = m_moveObject[i].posCurrent.x + 64; + src2.top = m_moveObject[i].posCurrent.y; + src2.bottom = m_moveObject[i].posCurrent.y + 16; + RECT tinyRect; + if (IntersectRect(tinyRect, src2, src)) + { + return i; + } + } + } + return -1; +} + +int CDecor::MoveChargeDetect(POINT pos) +{ + RECT src; + src.left = pos.x + 16; + src.right = pos.x + 60 - 16; + src.top = pos.y + 11; + src.bottom = pos.y + 60 - 2; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 31) + { + RECT src2; + src2.left = m_moveObject[i].posCurrent.x - 10; + src2.right = m_moveObject[i].posCurrent.x + 60 + 10; + src2.top = m_moveObject[i].posCurrent.y + 36; + src2.bottom = m_moveObject[i].posCurrent.y + 60; + RECT tinyRect; + if (IntersectRect(tinyRect, src2, src)) + { + return i; + } + } + } + return -1; +} + +int CDecor::MovePersoDetect(POINT pos) +{ + RECT src; + src.left = pos.x + 16; + src.right = pos.x + 60 - 16; + src.top = pos.y + 11; + src.bottom = pos.y + 60 - 2; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type >= 200 && m_moveObject[i].type <= 203) + { + RECT src2; + src2.left = m_moveObject[i].posCurrent.x - 16; + src2.right = m_moveObject[i].posCurrent.x + 60 + 16; + src2.top = m_moveObject[i].posCurrent.y + 36; + src2.bottom = m_moveObject[i].posCurrent.y + 60; + RECT tinyRect; + if (IntersectRect(tinyRect, src2, src)) + { + return i; + } + } + } + return -1; +} + +int CDecor::MoveBalleDetect(POINT pos) +{ + +} + +int CDecor::MoveObjectDelete(POINT cel) +{ + int result = -1; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type != 0) + { + if (cel.x == m_moveObject[i].posStart.x / 64 && cel.y == m_moveObject[i].posStart.y / 64) + { + result = m_moveObject[i].type; + m_moveObject[i].type = 0; + } + else if (cel.x == m_moveObject[i].posEnd.x / 64 && cel.y == m_moveObject[i].posEnd.y / 64) + { + result = m_moveObject[i].type; + m_moveObject[i].type = 0; + } + } + } + return result; +} + +int CDecor::MoveObjectFree() +{ + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 0) + { + m_moveObject[i].type = 0; + return i; + } + } + return -1; +} + +int CDecor::SortGetType(int type) +{ + if (type == 2 || type == 3 || type == 96 || type == 97) + { + return 1; + } + if (type == 12) + { + return 2; + } + return 3; +} + +void CDecor::MoveObjectSort() +{ + MoveObject src = default(MoveObject); + int num = 0; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type != 0) + { + MoveObjectCopy(m_moveObject[num++], m_moveObject[i]); + } + } + for (int i = num; i < MAXMOVEOBJECT; i++) + { + m_moveObject[i].type = 0; + } + if (num <= 1) + { + return; + } + BOOL flag; + do + { + flag = FALSE; + for (int i = 0; i < num - 1; i++) + { + if (SortGetType(m_moveObject[i].type) > SortGetType(m_moveObject[i + 1].type)) + { + MoveObjectCopy(src, m_moveObject[i]); + MoveObjectCopy(m_moveObject[i], m_moveObject[i + 1]); + MoveObjectCopy(m_moveObject[i + 1], src); + flag = TRUE; + } + } + } while (flag); + UpdateCaisse(); + m_nbLinkCaisse = 0; +} + +void CDecor::MoveObjectPriority(int i) +{ + +} + +int CDecor::MoveObjectSearch(POINT pos, int type) +{ + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type != 0 && (type == -1 || + m_moveObject[i].type == type)) + { + if (m_moveObject[i].type == 23 && + m_moveObject[i].posStart.x != m_moveObject[i].posEnd.x) + { + if (m_moveObject[i].posCurrent.x >= pos.x - 100 && + m_moveObject[i].posCurrent.x <= pos.x + 100 && + m_moveObject[i].posCurrent.y == pos.y) + { + return i; + } + } + else if (m_moveObject[i].type == 23 && + m_moveObject[i].posStart.y != m_moveObject[i].posEnd.y) + { + if (m_moveObject[i].posCurrent.y >= pos.y - 100 && + m_moveObject[i].posCurrent.y <= pos.y + 100 && + m_moveObject[i].posCurrent.x == pos.x) + { + return i; + } + } + else if (m_moveObject[i].posCurrent.x == pos.x && + m_moveObject[i].posCurrent.y == pos.y) + { + return i; + } + } + } + return -1; +} diff --git a/src/decmove.h b/src/decmove.h deleted file mode 100644 index 8c022e7..0000000 --- a/src/decmove.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -short* GetListMoves(int rank); -short* GetListIcons(int rank); \ No newline at end of file diff --git a/src/decnet.cpp b/src/decnet.cpp new file mode 100644 index 0000000..4767c76 --- /dev/null +++ b/src/decnet.cpp @@ -0,0 +1,197 @@ +// DecNet.cpp +// + +#include "def.h" +#include "decor.h" +#include "misc.h" +#include "network.h" + +void CDecor::NetStopCloud(int rank) +{ + NetMessage msg; + + msg.data1 = 0; + msg.x = 0; + msg.y = 0; + msg.type = MESS_STOPCLOUD; + msg.channel = rank; + NetMessagePush(&msg); + return; +} + +void CDecor::NetPlaySound(short channel, POINT pos) +{ + NetMessage msg; + + msg.y = pos.y; + msg.x = pos.x; + msg.type = MESS_PLAYSOUND; + msg.data1 = 0; + msg.channel = channel; + NetMessagePush(&msg); + return; +} + +void CDecor::NetStopSound(short channel) +{ + NetMessage msg; + + msg.data1 = 0; + msg.x = 0; + msg.y = 0; + msg.type = MESS_STOPSOUND; + msg.channel = channel; + NetMessagePush(&msg); +} + +void CDecor::NetDataFlush() +{ + for (int i = 0; i < MAXNETPLAYER; i++) + { + m_netPos[i].x = 0; + m_netPos[i].y = 0; + m_netIcons[i] = -1; + m_netUnk1[i] = 0; + m_netUnk2[i] = 0; + m_netUnk3[i] = 0; + m_netPlayerPacketsReceived[i] = 0; + m_netPlayerPacketsReceived2[i] = 0; + m_netTimeSincePacket[i] = 0; + m_netVitesses[i].x = 0; + m_netVitesses[i].y = 0; + m_netUnk4[i].x = 0; + m_netUnk4[i].y = 0; + } + m_netPacketsSent = 0; + m_netPacketsSent2 = 0; + m_netPacketsReceived = 0; + m_netPacketsReceived2 = 0; + m_netPacketIcon = -1; + NetMessageIndexFlush(); +} + +void CDecor::NetFUN_155e0(BYTE _foo, short _bar) +{ + char data[4]{ 4, _foo, _bar & 0xff, _bar >> 8 }; + m_pNetwork->Send(&data, 4, DPSEND_GUARANTEED); + return; +} + +void CDecor::TreatNetData() +{ + +} + +void CDecor::DoNetSmooth(int player) +{ + +} + +void CDecor::NetFUN_15d50() +{ + +} + +void CDecor::FUN_15da0(int index, short step) +{ + +} + + +void CDecor::NetPlayerCollide(POINT pos, int* out) +{ + tagRECT rect1; + RECT rect2; + RECT rect3; + //TODO + +} + +void CDecor::NetMessageIndexFlush() +{ + m_netMessageIndex1 = 0; + m_netMessageIndex2 = 0; + m_netMessageIndex3 = 0; + return; +} + +BOOL CDecor::NetMessagePush(NetMessage* message) +{ + NetMessage* messages; + BYTE data; + short pos; + int i; + + if (m_netMessageIndex1 == MAXNETMESSAGE) return FALSE; + + CopyMemory(&m_netMessages[m_netMessageIndex2], message, sizeof(NetMessage)); + m_netMessageIndex1++; + m_netMessageIndex2++; + if (m_netMessageIndex2 == MAXNETMESSAGE) + { + m_netMessageIndex2 = 0; + } + return TRUE; +} + +BOOL CDecor::NetMessagePop(NetMessage* message) +{ + if (m_netMessageIndex1 == 0) return FALSE; + + CopyMemory(message, &m_netMessages[m_netMessageIndex3], sizeof(NetMessage)); + m_netMessageIndex1--; + m_netMessageIndex3++; + if (m_netMessageIndex3 == MAXNETMESSAGE) + { + m_netMessageIndex3 = 0; + } + return TRUE; +} + +void CDecor::NotifFlush() +{ + for (int i = 0; i < MAXNOTIF; i++) + { + m_notifText[i][0] = '\0'; + } + + m_notifTime = 0; +} + +void CDecor::NotifPop() +{ + for (int i = MAXNOTIF; i > 0; --i) + { + //strcpy() + m_notifText[MAXNOTIF - 1][0] = '\0'; + m_notifTime = NOTIFDELAY; // idk + } +} + +void CDecor::NotifPush(char *str) +{ + int i; + for (i = 0; i < MAXNOTIF; i++) + { + if (m_notifText[i][0] != '\0') break; + } + if (i >= MAXNOTIF) + { + NotifPop(); + i = MAXNOTIF - 1; + } + strcpy(m_notifText[i], str); + m_notifTime = NOTIFDELAY; + m_pSound->PlayImage(SOUND_TRESOR, { LXIMAGE / 2, LYIMAGE / 2 }, -1); +} + +void CDecor::NotifStep() +{ + if (m_notifTime == 0) + { + NotifPop(); + } + else { + m_notifTime--; + } +} \ No newline at end of file diff --git a/src/decor.cpp b/src/decor.cpp index c8e6724..3ae879e 100644 --- a/src/decor.cpp +++ b/src/decor.cpp @@ -1,4 +1,4 @@ -// CDecor.cpp +// Decor.cpp // #include @@ -11,399 +11,363 @@ #include "pixmap.h" #include "sound.h" #include "decor.h" -#include "action.h" #include "text.h" #include "misc.h" -#include "fifo.h" -#include "DECMOVE.h" #include "event.h" #include "dectables.h" #include "jauge.h" #include "network.h" -#pragma warning (disable: 4996) -#define DIRECTDRAW_VERSION 0x0300 -//////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +inline BOOL IsValidCel(POINT cel) +{ + return cel.x >= 0 && cel.x < MAXCELX && cel.y >= 0 && cel.y < MAXCELY; +} - -#define TEXTDELAY 10 +inline void CDecor::StopVehicleSound() +{ + StopSound(SOUND_HELICOHIGH); + StopSound(SOUND_HELICOLOW); + StopSound(SOUND_JEEPHIGH); + StopSound(SOUND_JEEPLOW); +} // Constructor -// Possibly incomplete CDecor::CDecor() { + int i; - - m_hWnd = NULL; - m_pSound = NULL; - m_pPixmap = NULL; - memset(m_lastDecorIcon, 0, 800); - m_lastRegion = 0; - m_menuType = 0; - m_time = 0; - m_bAllMissions = FALSE; // m_bCheatDoors - m_bInvincible = FALSE; // m_bSuperBlupi - m_bShowSecret = FALSE; // m_bDrawSecret - m_bAccessBuild = FALSE; // m_buildOfficialMissions - m_bNetPacked = FALSE; - m_bNetMovePredict = TRUE; - m_bNetDebug = FALSE; - m_bMulti = FALSE; - m_team = 0; - m_netPacketsSent = 0; - m_netPacketsSent2 = 0; - m_netPacketsRecieved = 0; - m_netPacketsRecieved2 = 0; - //BlupiFlush(); - //MoveFlush(); - //InitDrapeau(); + // FUN_2bd90(m_jauges, sizeof(CJauge), 2, CJauge::CJauge); + m_hWnd = NULL; + m_pSound = NULL; + m_pPixmap = NULL; + + for (i = 0; i < 200; i++) + { + m_lastDecorIndexes[i] = 0; + } + m_lastRegion = -1; + m_iconLift = 0; + m_time = 0; + m_bCheatDoors = FALSE; + m_bSuperBlupi = FALSE; + m_bDrawSecret = FALSE; + m_bBuildOfficialMissions = FALSE; + m_bNetPacked = FALSE; + m_bNetMovePredict = TRUE; + m_bNetDebug = FALSE; + m_bMulti = FALSE; + m_team = 0; + m_netPacketsSent = 0; + m_netPacketsSent2 = 0; + m_netPacketsReceived = 0; + m_netPacketsReceived2 = 0; } CDecor::~CDecor() { - + // FUN_2be30(m_jauges, sizeof(CJauge), 2, OutputDebug); } void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetwork) { POINT pos; - pos.x = 169; - pos.y = 450; - POINT pos2; - pos2.x = 295; - pos2.y = 450; - m_hWnd = hWnd; - m_pSound = pSound; - m_pPixmap = pPixmap; - m_pNetwork = pNetwork; - m_input = 0; - m_previousInput = 0; - m_bHelicopterFlying = FALSE; - m_bHelicopterStationary = FALSE; - m_bCarMoving = FALSE; - m_bCarStationary = FALSE; - InitDecor(); - m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, pos, 1, FALSE); - m_jauges[0].SetHide(TRUE); - m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, pos2, 3, FALSE); - m_jauges[1].SetHide(TRUE); + m_hWnd = hWnd; + m_pSound = pSound; + m_pPixmap = pPixmap; + m_pNetwork = pNetwork; + m_keyPress = 0; + m_lastKeyPress = 0; + m_bJoystick = FALSE; + m_bHelicoMarch = FALSE; + m_bHelicoStop = FALSE; + m_bJeepMarch = FALSE; + m_bJeepStop = FALSE; + InitDecor(); + + m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, { 169, 450 }, 1, FALSE); + m_jauges[0].SetHide(TRUE); + m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, { 171, 450 }, 3, FALSE); + m_jauges[1].SetHide(TRUE); NetMessageIndexFlush(); NotifFlush(); } BOOL CDecor::LoadImages() { - POINT totalDim, iconDim; - char filename[52]; + POINT totalDim, iconDim; + char filename[52]; - if (m_lastRegion == m_region) return TRUE; - m_lastRegion = m_region; + if (m_lastRegion == m_region) return TRUE; + m_lastRegion = m_region; - totalDim.x = DIMCELX * 2 * 16; - totalDim.y = DIMCELY * 2 * 6; - iconDim.x = DIMCELX * 2; - iconDim.y = DIMCELY * 2; - sprintf(filename, "decor%.3d.blp", m_region); - if (!m_pPixmap->BackgroundCache(CHBACK, filename, totalDim, iconDim, FALSE)) return FALSE; - return TRUE; + totalDim = { LXIMAGE, LYIMAGE }; + iconDim = { 0, 0 }; + sprintf(filename, "decor%.3d.blp", m_region); + + return m_pPixmap->BackgroundCache(CHDECOR, filename, totalDim, iconDim, FALSE); } void CDecor::InitGamer() { - int i; - BYTE* door; - m_nbVies = 3; - memset(m_doors, 1, 200); - return; + FillMemory(m_doors, sizeof(m_doors), 1); } - void CDecor::InitDecor() { - int i; - LONG pos, pos2; + m_posDecor = { 0, 0 }; + m_dimDecor = { 100, 100 }; + m_music = 1; + m_region = 2; + m_missionTitle[0] = '\0'; + m_decorAction = 0; + for (int x = 0; x < MAXCELX; x++) + { + for (int y = 0; y < MAXCELY; y++) + { + m_decor[x][y].icon = -1; + m_bigDecor[x][y].icon = -1; + } + } + m_decor[3][4].icon = 40; + m_decor[4][4].icon = 38; + m_decor[5][4].icon = 39; + for (int k = MAXMOVEOBJECT; k != 0; k--) + { + m_moveObject[k].type = 0; + } + FlushBalleTraj(); + FlushMoveTraj(); + m_moveObject[0].type = TYPE_TRESOR; + m_moveObject[0].stepAdvance = 1; + m_moveObject[0].stepRecede = 1; + m_moveObject[0].timeStopStart = 0; + m_moveObject[0].timeStopEnd = 0; + m_moveObject[0].posStart = { 258, 196 }; + m_moveObject[0].posEnd = m_moveObject[0].posStart; + m_moveObject[0].posCurrent = m_moveObject[0].posStart; + m_moveObject[0].phase = 0; + m_moveObject[0].step = STEP_STOPSTART; + m_moveObject[0].time = 0; + m_moveObject[0].channel = CHELEMENT; + m_moveObject[0].icon = 0; - m_cameraPos.x = 0; - m_cameraPos.y = 0; - m_worldDims.x = 100; - m_worldDims.y = 100; - m_music = 1; - m_region = 2; - m_missionTitle[0] = '\0'; - m_decorAction = 0; - for (int i = 0; i < 100; i++) - { - for (int j = 0; j < 100; j++) - { - m_decor[i, j]->icon = -1; - m_bigDecor[i, j]->icon = 1; - } - } - m_decor[3, 4]->icon = 40; - m_decor[4, 4]->icon = 38; - m_decor[5, 4]->icon = 39; - for (int k = 0; k < MAXMOVEOBJECT; k++) - { - m_moveObject[k]->type = 0; - } - FlushBalleTraj(); - FlushMoveTraj(); - m_moveObject[0]->type = 5; - m_moveObject[0]->stepAdvance = 1; - m_moveObject[0]->stepRecede = 1; - m_moveObject[0]->timeStopStart = 0; - m_moveObject[0]->timeStopEnd = 0; - m_moveObject[0]->posStart.x = 258; - m_moveObject[0]->posStart.y = 196; - m_moveObject[0]->posEnd = m_moveObject[0]->posStart; - m_moveObject[0]->posCurrent = m_moveObject[0]->posStart; - m_moveObject[0]->phase = 0; - m_moveObject[0]->step = 1; - m_moveObject[0]->time = 0; - m_moveObject[0]->channel = 10; - m_moveObject[0]->icon = 0; - m_moveObject[1]->type = 7; - m_moveObject[1]->stepAdvance = 1; - m_moveObject[1]->timeStopStart = 0; - m_moveObject[1]->timeStopEnd = 0; - m_moveObject[1]->posStart.x = 450; - m_moveObject[1]->posStart.y = 196; - m_moveObject[1]->posEnd = m_moveObject[1]->posStart; - m_moveObject[1]->posCurrent = m_moveObject[1]->posStart; - m_moveObject[1]->phase = 0; - m_moveObject[1]->step = 1; - m_moveObject[1]->time = 0; - m_moveObject[1]->channel = 10; - m_moveObject[1]->icon = 29; - pos = m_blupiStartPos[0].x = 66; - pos2 = m_blupiStartPos[0].y = 192 + BLUPIOFFY; - m_blupiStartDir[4] = 2; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiIcon.icon = 0; - m_blupiIcon.type = 0; - m_blupiChannel.channel = CHBLUPI; - m_blupiChannel.blupiChannel = 0; - m_blupiFocus = TRUE; - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiSuspend = FALSE; - m_blupiJumpAie = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiInvert = FALSE; - m_blupiBalloon = FALSE; - m_blupiEcrase = FALSE; - m_blupiMotorHigh = FALSE; - m_blupiPosHelico.x = -1; - m_blupiActionOuf = 0; - m_blupiTimeNoAsc = 0; - m_blupiTimeMockery = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - m_blupiValidPos.x = pos; - m_blupiValidPos.y = pos2; - m_blupiFront = FALSE; - m_blupiBullet = 0; - m_blupiCle = 0; - m_blupiPerso = 0; - m_blupiDynamite = 0; - m_nbTresor = 0; - m_totalTresor = 1; - m_goalPhase = 0; - m_scrollPoint.x = pos; - m_scrollPoint.y = pos2; - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_term = 0; + m_moveObject[1].type = TYPE_GOAL; + m_moveObject[1].stepAdvance = 1; + m_moveObject[1].timeStopStart = 0; + m_moveObject[1].timeStopEnd = 0; + m_moveObject[1].posStart = { 450, 196 }; + m_moveObject[1].posEnd = m_moveObject[1].posStart; + m_moveObject[1].posCurrent = m_moveObject[1].posStart; + m_moveObject[1].phase = 0; + m_moveObject[1].step = STEP_STOPSTART; + m_moveObject[1].time = 0; + m_moveObject[1].channel = CHELEMENT; + m_moveObject[1].icon = 29; + //TODO: iterate setting blupi fifo positions + m_blupiStartPos[0] = { 66, 192 + BLUPIOFFY }; + m_blupiStartDir[0] = DIR_RIGHT; + m_blupiAction = ACTION_STOP; + m_blupiPhase = 0; + m_blupiIcon = 0; + m_blupiChannel = CHBLUPI; + m_blupiFocus = TRUE; + m_blupiAir = FALSE; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiSuspend = FALSE; + m_blupiJumpAie = FALSE; + m_blupiShield = FALSE; + m_blupiPower = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + m_blupiInvert = FALSE; + m_blupiBalloon = FALSE; + m_blupiEcrase = FALSE; + m_blupiPosHelico.x = -1; + m_blupiActionOuf = 0; + m_blupiTimeNoAsc = 0; + m_blupiTimeMockery = 0; + m_blupiVitesse = { 0, 0 }; + m_blupiValidPos = m_blupiStartPos[0]; + m_blupiEnergyUnused = 100; + m_blupiFront = FALSE; + m_blupiBullet = 0; + m_blupiCle = 0; + m_blupiPerso = 0; + m_blupiDynamite = 0; + m_nbTresor = 0; + m_totalTresor = 1; + m_goalPhase = 0; + m_scrollPoint = m_blupiStartPos[0]; + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; + m_term = 0; m_2ndPositionCalculationSlot = -1; } void CDecor::SetTime(int time) { - m_time = time; + m_time = time; } int CDecor::GetTime() { - return m_time; + return m_time; } -// Basically the same as the other fucking function - void CDecor::PlayPrepare(BOOL bTest) { - /* - int rand; + if (bTest) m_nbVies = 3; - rand = Random(0, 23); - */ - - int blupiStart; - MoveObjectType moveType; - - if (bTest != FALSE) + if (m_bMulti) { - m_nbVies = 3; - } - - if (*(int*)((int)m_blupiStartDir + 14) == FALSE) - { - m_blupiPos.x = *(LONG*)((int)&m_blupiFifoPos[9].y + 2); - m_blupiPos.y = *(LONG*)((int)&m_blupiStartPos[0].x + 2); - blupiStart = *(int*)((int)&m_blupiStartPos[3].y + 2); + m_nbVies = 10; + m_blupiPos = m_blupiStartPos[m_team]; + m_blupiDir = m_blupiStartDir[m_team]; } else { - *(BYTE*)(m_doors + 198) = 10; - blupiStart = *(int*)((int)&m_bMulti + 2); - m_blupiPos.x = *(LONG*)((int)&m_blupiFifoPos[blupiStart + 9].y + 2); - m_blupiPos.y = *(LONG*)((int)&m_blupiStartPos[blupiStart].x + 2); - blupiStart = *(int*)((int)m_blupiStartDir + *(int*)((int)&m_bMulti + 2) * 4 + -2); + m_blupiPos = m_blupiStartPos[0]; + m_blupiDir = m_blupiStartDir[0]; } - m_blupiDir = blupiStart; - if (blupiStart == DIR_LEFT) + + if (m_blupiDir == DIR_LEFT) { - m_blupiIcon.icon = 4; - m_blupiIcon.type = 0; + m_blupiIcon = 4; } else { - m_blupiIcon.icon = 4; - m_blupiIcon.type = 0; + m_blupiIcon = 0; } - m_blupiAction = ACTION_STOP; - m_blupiPhase = 0; - m_blupiTransport = DIR_LEFT; - m_blupiFocus = TRUE; - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiSuspend = FALSE; - m_blupiJumpAie = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiInvert = FALSE; - m_blupiBalloon = FALSE; - m_blupiEcrase = FALSE; - m_blupiMotorHigh = FALSE; - m_blupiActionOuf = 0; - m_blupiTimeNoAsc = 0; - m_blupiTimeMockery = 0; - m_blupiValidPos = m_blupiPos; - m_blupiBullet = 0; - m_blupiCle = 0; - m_blupiPerso = 0; - m_blupiDynamite = 0; - m_nbTresor = 0; - m_totalTresor = 0; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 5) - { - m_totalTresor++; - } - m_moveObject[i]->posCurrent = m_moveObject[i]->posStart; - m_moveObject[i]->step = 1; - m_moveObject[i]->phase = 0; - m_moveObject[i]->time = 0; - if (m_moveObject[i]->type == 5 || - m_moveObject[i]->type == 6 || - m_moveObject[i]->type == 25 || - m_moveObject[i]->type == 26 || - m_moveObject[i]->type == 40 || - m_moveObject[i]->type == 2 || - m_moveObject[i]->type == 3 || - m_moveObject[i]->type == 96 || - m_moveObject[i]->type == 97) - { - m_moveObject[i]->phase = Random(0, 23); - } - if (m_moveObject[i]->type == 23) - { - m_moveObject[i]->type = 0; - } - if (m_moveObject[i]->type == TYPE_BALLE) - { - m_moveObject[i]->type = TYPE_EMPTY; - } - moveType = (MoveObjectType)m_moveObject[i]->type; - if ((m_bMulti != FALSE) && (moveType == TYPE_CAISSE) || (moveType == TYPE_GOAL) || (moveType == TYPE_CLE) || (moveType == TYPE_BLUPIHELICO) || (moveType == TYPE_BLUPITANK)) - { - m_moveObject[i]->type = TYPE_EMPTY; - } - } - m_goalPhase = 0; - MoveObjectSort(); + m_blupiAction = ACTION_STOP; + m_blupiPhase = 0; + m_blupiFocus = TRUE; + m_blupiAir = FALSE; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiSuspend = FALSE; + m_blupiJumpAie = FALSE; + m_blupiShield = FALSE; + m_blupiPower = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + m_blupiInvert = FALSE; + m_blupiBalloon = FALSE; + m_blupiEcrase = FALSE; + m_blupiActionOuf = 0; + m_blupiTimeNoAsc = 0; + m_blupiTimeMockery = 0; + m_blupiValidPos = m_blupiPos; + m_blupiEnergyUnused = 100; + m_blupiBullet = 0; + m_blupiCle = 0; + m_blupiPerso = 0; + m_blupiDynamite = 0; + m_nbTresor = 0; + m_totalTresor = 0; + for (int i = MAXMOVEOBJECT; i != 0; i--) + { + if (m_moveObject[i].type == TYPE_TRESOR) + { + m_totalTresor++; + } + m_moveObject[i].posCurrent = m_moveObject[i].posStart; + m_moveObject[i].step = STEP_STOPSTART; + m_moveObject[i].phase = 0; + m_moveObject[i].time = 0; + + if (m_moveObject[i].type == TYPE_TRESOR || + m_moveObject[i].type == TYPE_EGG || + m_moveObject[i].type == TYPE_SHIELD || + m_moveObject[i].type == TYPE_POWER || + m_moveObject[i].type == TYPE_INVERT || + m_moveObject[i].type == TYPE_BOMBEDOWN || + m_moveObject[i].type == TYPE_BOMBEUP || + m_moveObject[i].type == TYPE_BOMBEFOLLOW1 || + m_moveObject[i].type == TYPE_BOMBEFOLLOW2) + { + m_moveObject[i].phase = rand() % 23; + } + + if (m_moveObject[i].type == TYPE_BALLE) + { + m_moveObject[i].type = 0; + } + + if ((m_bMulti) && + (m_moveObject[i].type == TYPE_CAISSE) || + (m_moveObject[i].type == TYPE_GOAL) || + (m_moveObject[i].type == TYPE_CLE) || + (m_moveObject[i].type == TYPE_BLUPIHELICO) || + (m_moveObject[i].type == TYPE_BLUPITANK)) + { + m_moveObject[i].type = 0; + } + } + m_goalPhase = 0; + MoveObjectSort(); UpdateCaisse(); - m_scrollPoint = m_blupiPos; - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiPosHelico.x = -1; - m_blupiMotorSound = 0; - m_blupiFront = FALSE; - m_blupiNoBarre = 0; - m_blupiValidPos = m_blupiPos; - m_blupiFifoNb = 0; - m_blupiTimeFire = 0; - NotifFlush(); + m_scrollPoint = m_blupiPos; + m_scrollAdd = { 0, 0 }; + m_blupiPosHelico.x = -1; + m_nbLinkCaisse = 0; + m_bHelicoMarch = FALSE; + m_bHelicoStop = FALSE; + m_bJeepMarch = FALSE; + m_bJeepStop = FALSE; + m_blupiFront = FALSE; + m_blupiNoBarre = 0; + m_blupiValidPos = m_blupiPos; + m_blupiFifoNb = 0; + m_blupiTimeFire = 0; NetDataFlush(); - m_voyageIcon = -1; - m_jauges[0].SetHide(TRUE); - m_jauges[1].SetHide(TRUE); - m_bFoundCle = FALSE; - m_term = 0; - m_time = 0; - m_bPause = FALSE; - MoveStep(); - m_scrollPoint.x = m_blupiPos.x + 30 + m_scrollAdd.x; - m_scrollPoint.y = m_blupiPos.y + 30 + m_scrollAdd.y; + NotifFlush(); + m_voyageIcon = -1; + m_jauges[0].SetHide(TRUE); + m_jauges[1].SetHide(TRUE); + m_bFoundCle = FALSE; + m_term = 0; + m_time = 0; + m_bPause = FALSE; } -// Sort of makes sense. - void CDecor::BuildPrepare() { - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - m_moveObject[i]->posCurrent = m_moveObject[i]->posStart; - m_moveObject[i]->step = 1; - m_moveObject[i]->time = 0; - m_moveObject[i]->phase = 0; - if (m_moveObject[i]->type == 23) - { - m_moveObject[i]->type = 0; - } - } - m_time = 0; - m_voyageIcon = -1; + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + m_moveObject[i].posCurrent = m_moveObject[i].posStart; + m_moveObject[i].step = STEP_STOPSTART; + m_moveObject[i].time = 0; + m_moveObject[i].phase = 0; + if (m_moveObject[i].type == TYPE_BALLE) + { + m_moveObject[i].type = 0; + } + } + m_voyageIcon = -1; m_posCelHili.x = -1; m_2ndPositionCalculationSlot = -1; - m_bPause = FALSE; + m_time = 0; + m_bPause = FALSE; NetDataFlush(); - return; } int CDecor::IsTerminated() @@ -413,202 +377,551 @@ int CDecor::IsTerminated() void CDecor::MoveStep() { - LONG* longDecor; - UINT posDecor; - int dimDecor; - MoveObjectStep(); - if ((m_phase == WM_PHASE_PLAY) || (m_phase == WM_PHASE_PLAYTEST)) - { - // BlupiStep(); - + if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) { + BlupiStep(); + NetFUN_15d50(); NotifStep(); } - if (m_phase == WM_PHASE_BUILD) - { - if ((m_keyPress & 2) != 0) - { - posDecor = m_posDecor.x + 50; - dimDecor = (UINT)((m_dimDecor).x != 0) & 5760; - m_posDecor.x = dimDecor; - if ((int)posDecor < dimDecor) - { - m_posDecor.x = posDecor; + if (m_phase == WM_PHASE_BUILD) { + if (m_keyPress & KEY_RIGHT) { + m_posDecor.x += 50; + int max = (m_dimDecor.x != 0) ? (MAXCELX * DIMOBJX - LXIMAGE) : 0; + if (m_posDecor.x > max) { + m_posDecor.x = max; } m_posCelHili.x = -1; } - if ((m_keyPress & 1) != 0) - { - longDecor = &m_posDecor.y; - *longDecor = *longDecor + 50; - dimDecor = (UINT)(m_dimDecor.y != 0) & 5920; - if ((int)dimDecor < m_posDecor.y) - { - m_posDecor.y = dimDecor; + if (m_keyPress & KEY_LEFT) { + m_posDecor.x -= 50; + if (m_posDecor.x < 0) { + m_posDecor.x = 0; } - m_posCelHili.y = dimDecor; + m_posCelHili.x = -1; } - m_posCelHili.x = -1; - } - if ((m_keyPress & 4) != 0) - { - posDecor = m_posDecor.y + -50; - m_posDecor.y = posDecor; - if (posDecor < 0) - { - m_posDecor.y = 0; + if (m_keyPress & KEY_DOWN) { + m_posDecor.y += 50; + int max = (m_dimDecor.y > 0) ? (m_dimDecor.y - LYIMAGE) : 0; + if (m_posDecor.y > max) { + m_posDecor.y = max; + } + m_posCelHili.x = -1; + } + if (m_keyPress & KEY_UP) { + m_posDecor.x -= 50; + if (m_posDecor.x < 0) { + m_posDecor.x = 0; + } + m_posCelHili.x = -1; } - m_posCelHili.x = -1; } - return; } -void CDecor::NotifStep() +int CDecor::GetIconPerso() { - int i; - - i = *(int*)(m_notifText[3] + 98); - - if (i == 0) - { - NotifPop(); - return; + if (m_bMulti) { + return m_team + 108; } - *(int*)(m_notifText[3] + 98) = i + -1; - return; -} - -int CDecor::GetBlupiChannelStandard() -{ - if (((m_bMulti != FALSE) && (m_blupiChannel.channel == CHBLUPI)) && (0 < m_team)) - { - return m_team + 10; + else { + return 108; } - return (int)m_blupiChannel.channel; } -int CDecor::GetBlupiChannelActual() -{ - if ((m_bMulti != 0) && (0 < m_team)) - { - return m_team + CHELEMENT; - } - return CHBLUPI; -} - - - -// Fuck this function. That's all I can say. - void CDecor::Build(RECT rect) { - RECT rect1; - RECT clip; - POINT posDecor, posDecorNext; - RECT rectDir; + int num = 1; + POINT tinyPoint; + tinyPoint.x = 0; + RECT lastClip; - rect1 = m_pPixmap->GetClipping((RECT*)&posDecor); - clip = rect1; + lastClip = m_pPixmap->GetClipping(); m_pPixmap->SetClipping(rect); - posDecorNext = DecorNextAction(); - rectDir.right = 0; - rectDir.left = 2; - posDecor.x = posDecorNext.x; - posDecor.y = ((int*)posDecorNext.x)[1]; -} + POINT posDecor = DecorNextAction(); + POINT pos = { posDecor.x * 2 / 3 % LXIMAGE, posDecor.y * 2 }; + //TODO: more^ + for (int i = 0; i < 3; i++) + { + tinyPoint.y = 0; + for (int j = 0; j < 2; j++) + { + rect.top = pos.y / 3 % LYIMAGE; + rect.left = pos.x; + rect.right = LXIMAGE; + rect.bottom = LYIMAGE; + m_pPixmap->DrawPart(-1, 3, tinyPoint, rect, 1, 0); + tinyPoint.y += LYIMAGE - rect.top; + } + tinyPoint.x += LXIMAGE - pos.x; + pos.x = 0; + } + tinyPoint.x = -posDecor.x % 64 - 64; + for (int i = posDecor.x / 64 - 1; i < posDecor.x / 64 + LXIMAGE / 64 + 3; i++) { + tinyPoint.y = -posDecor.y % 64 + 2 - 64; + for (int j = posDecor.y / 64 - 1; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) + { + if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY) + { + int num2 = m_bigDecor[i][j].icon; + int channel = 9; + if (num2 != -1) + { + pos = tinyPoint; + if (num2 == 203) + { + num2 = table_marine[m_time / 3 % 11]; + channel = 1; + } + if (num2 >= 66 && num2 <= 68) + { + pos.y -= 13; + } + if (num2 >= 87 && num2 <= 89) + { + pos.y -= 2; + } + m_pPixmap->QuickIcon(channel, num2, pos); + } + } + tinyPoint.y += 64; + } + tinyPoint.x += 64; + } -BOOL CDecor::BlitzActif(int celx, int cely) -{ - POINT pos; - pos.x = celx * 64; - pos.y = cely * 64; - int time; + tinyPoint.x = -posDecor.x % 64; + for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) + { + tinyPoint.y = -posDecor.y % 64; + for (int j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) + { + if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY && m_decor[i][j].icon != -1) + { + int num2 = m_decor[i][j].icon; + if (num2 == 384 || num2 == 385) + { + m_pPixmap->QuickIcon(CHOBJECT, num2, tinyPoint); + } + } + tinyPoint.y += 64; + } + tinyPoint.x += 64; + } if (m_phase == WM_PHASE_BUILD) { - time = m_time >> 31; - return (((m_time ^ time) - time & 1 ^ time) == time); + // ... } - if ((((pos.x - 80 <= m_blupiPos.x) && (m_blupiPos.x <= pos.x + 80)) && - (m_blupiPos.x = (m_blupiPos.y, pos.y + -500 <= m_blupiPos.x)) && (m_blupiPos.x <= pos.y + 500))) + + if (m_bMulti && m_phase != WM_PHASE_BUILD) { - if (((m_time & 100 < 70) && (0 < pos.y)) && (m_decor[pos.x + -1][pos.y + 99].icon == 304)) + // ... + } + + m_blupiSec = 0; + if (!m_blupiFront && m_phase != WM_PHASE_BUILD) + { + tinyPoint.x = m_blupiPos.x - posDecor.x; + tinyPoint.y = m_blupiPos.y - posDecor.y; + if (m_blupiJeep) { - PlaySoundB(SOUND_69_BLITZ, pos, 0); + tinyPoint.y += BLUPIOFFY; } - if (table_blitz[0] != -1) + if (m_blupiShield) { - int* blitz = table_blitz; - while (1) + m_blupiSec = SEC_SHIELD; + if (m_blupiTimeShield > 25 || m_time % 4 < 2) { - if (m_time % 100 == (int)blitz++) + int num2 = table_shield_blupi[m_time / 2 % 16]; + tinyPoint.y -= 2; + m_pPixmap->QuickIcon(CHELEMENT, num2, tinyPoint); + tinyPoint.y += 2; + num2 = table_shieldloop[m_time / 2 % 5]; + m_pPixmap->QuickIcon(CHELEMENT, num2, tinyPoint); + } + } + else if (m_blupiPower) + { + m_blupiSec = SEC_POWER; + if (m_blupiTimeShield > 25 || m_time % 4 < 2) + { + int num2 = table_magicloop[m_time / 2 % 5]; + m_pPixmap->QuickIcon(CHELEMENT, num2, tinyPoint); + } + } + else if (m_blupiCloud) + { + m_blupiSec = SEC_CLOUD; + if (m_blupiTimeShield > 25 || m_time % 4 < 2) + { + for (int k = 0; k < 3; k++) { - break; + int num2 = 48 + (m_time + k) % 6; + pos.x = tinyPoint.x - 34; + pos.y = tinyPoint.y - 34; + m_pPixmap->QuickIcon(CHEXPLO, num2, pos); } - return 0; + } + } + else if (m_blupiHide) + { + m_blupiSec = SEC_HIDE; + if (m_blupiTimeShield > 25 || m_time % 4 < 2) + { + m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xF5, { 0, 0 }, 0, TRUE); + } + else + { + m_pPixmap->DrawIcon(CHTEMP, GetBlupiChannelStandard(), m_blupiIcon, pos, 1, FALSE); + m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xED, { 0, 0 }, 0, TRUE); + } + } + m_pPixmap->QuickIcon(GetBlupiChannelStandard(), m_blupiIcon, tinyPoint); + } + + for (int num3 = MAXMOVEOBJECT - 1; num3 >= 0; num3--) + { + if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE && (m_moveObject[num3].type < 8 || m_moveObject[num3].type > 11) && (m_moveObject[num3].type < 90 || m_moveObject[num3].type > 95) && (m_moveObject[num3].type < 98 || m_moveObject[num3].type > 100) && m_moveObject[num3].type != 53 && m_moveObject[num3].type != 1 && m_moveObject[num3].type != 47 && m_moveObject[num3].type != 48) + { + tinyPoint.x = m_moveObject[num3].posCurrent.x - posDecor.x; + tinyPoint.y = m_moveObject[num3].posCurrent.y - posDecor.y; + if (m_moveObject[num3].type == TYPE_BULLDOZER || m_moveObject[num3].type == TYPE_BLUPIHELICO || m_moveObject[num3].type == TYPE_BLUPITANK) + { + tinyPoint.x += 2; + tinyPoint.y += BLUPIOFFY; + } + if (m_moveObject[num3].type == 54) + { + tinyPoint.y += BLUPIOFFY; + } + // get the winphone opacity stuff out of here + m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); + if (m_moveObject[num3].type == 30) + { + for (int l = 0; l < sizeof(table_drinkoffset) / sizeof(int); l++) + { + int num4 = (m_time + table_drinkoffset[l]) % 50; + int rank = table_drinkeffect[num4 % 5]; + POINT tinyPoint2 = { tinyPoint.x + 2, tinyPoint.y - num4 * 3 }; + POINT pos2 = tinyPoint2; + m_pPixmap->QuickIcon(10, rank, pos2); + } + } + if (m_bDrawSecret && m_moveObject[num3].type == 12 && m_moveObject[num3].icon != 32 && m_moveObject[num3].icon != 33 && m_moveObject[num3].icon != 34) + { + m_pPixmap->QuickIcon(1, 214, tinyPoint); } } } - return FALSE; + tinyPoint.x = -posDecor.x % 64; + for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) + { + tinyPoint.y = 0 - posDecor.y % 64; + for (int j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) + { + if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1) + { + int num2 = m_decor[i][j].icon; + pos.x = tinyPoint.x; + pos.y = tinyPoint.y; + if ((num2 >= 107 && num2 <= 109) || num2 == 157) + { + pos.y -= 7; + } + if (num2 == 211) + { + num2 = table_ressort[(m_time / 2 + i * 7) % 8]; + } + if (num2 == 214 && !m_bDrawSecret) + { + num2 = -1; + } + if (num2 == 364) + { + pos.y -= 2; + } + switch (num2) + { + default: + m_pPixmap->QuickIcon(1, num2, pos); + break; + case 68: + case 91: + case 92: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 124: + case 125: + case 126: + case 127: + case 128: + case 129: + case 130: + case 131: + case 132: + case 133: + case 134: + case 135: + case 136: + case 137: + case 305: + case 317: + case 324: + case 373: + case 378: + case 384: + case 385: + case 404: + case 410: + break; + } + } + tinyPoint.y += DIMOBJY; + } + tinyPoint.x += DIMOBJX; + } + for (int num3 = 0; num3 < MAXMOVEOBJECT; num3++) + { + if ((m_moveObject[num3].type == 1 || m_moveObject[num3].type == 47 || m_moveObject[num3].type == 48) && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE) + { + tinyPoint.x = 0 + m_moveObject[num3].posCurrent.x - posDecor.x; + tinyPoint.y = 0 + m_moveObject[num3].posCurrent.y - posDecor.y; + m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); + } + } + tinyPoint.x = 0 - posDecor.x % 64; + for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) + { + tinyPoint.y = 0 - posDecor.y % 64; + for (int j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) + { + if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1) + { + int num2 = m_decor[i][j].icon; + pos = tinyPoint; + if (num2 == 68) + { + num2 = table_decor_lave[(i * 13 + j * 7 + m_time / 2) % 8]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 373) + { + num2 = ((!m_blupiFocus) ? table_decor_piege2[(i * 13 + j * 7 + m_time / 2) % 4] : table_decor_piege1[(i * 13 + j * 7 + m_time / 4) % 16]); + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 404 || num2 == 410) + { + num2 = table_decor_goutte[(i * 13 + j * 7 + m_time / 2) % 48]; + pos.y -= 9; + m_pPixmap->QuickIcon(1, num2, pos); + if (num2 >= 404 && num2 <= 407) + { + m_decor[i][j].icon = 404; + } + else + { + m_decor[i][j].icon = 410; + } + } + if (num2 == 317) + { + num2 = table_decor_ecraseur[m_time / 3 % 10]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 378) + { + num2 = table_decor_scie[(i * 13 + j * 7 + m_time / 1) % 6]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 324) + { + num2 = table_decor_temp[m_time / 4 % 20]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 92) + { + num2 = table_decor_eau1[(i * 13 + j * 7 + m_time / 3) % 6]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 91) + { + int num5 = 3 + (i * 17 + j * 13) % 3; + num2 = table_decor_eau2[(i * 11 + j * 7 + m_time / num5) % 6]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 305 && BlitzActif({ i, j })) + { + num2 = rand() % 4 + 305; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 110) + { + num2 = table_decor_ventg[m_time / 1 % 4]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 114) + { + num2 = table_decor_ventd[m_time / 1 % 4]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 118) + { + num2 = table_decor_venth[m_time / 1 % 4]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 122) + { + num2 = table_decor_ventb[m_time / 1 % 4]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 126) + { + num2 = table_decor_ventillog[m_time / 2 % 3]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 129) + { + num2 = table_decor_ventillod[m_time / 2 % 3]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 132) + { + num2 = table_decor_ventilloh[m_time / 2 % 3]; + m_pPixmap->QuickIcon(1, num2, pos); + } + if (num2 == 135) + { + num2 = table_decor_ventillob[m_time / 2 % 3]; + m_pPixmap->QuickIcon(1, num2, pos); + } + } + tinyPoint.y += 64; + } + tinyPoint.x += 64; + } + for (int num3 = 0; num3 < MAXMOVEOBJECT; num3++) + { + if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE && ((m_moveObject[num3].type >= 8 && m_moveObject[num3].type <= 11) || (m_moveObject[num3].type >= 90 && m_moveObject[num3].type <= 95) || (m_moveObject[num3].type >= 98 && m_moveObject[num3].type <= 100) || m_moveObject[num3].type == 53)) + { + tinyPoint.x = 0 + m_moveObject[num3].posCurrent.x - posDecor.x; + tinyPoint.y = 0 + m_moveObject[num3].posCurrent.y - posDecor.y; + m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); + } + } + if (m_blupiFront) + { + tinyPoint.x = 0 + m_blupiPos.x - posDecor.x; + tinyPoint.y = 0 + m_blupiPos.y - posDecor.y; + m_pPixmap->QuickIcon(m_blupiChannel, m_blupiIcon, tinyPoint); + } + DrawInfo(); + VoyageDraw(); + m_time++; } - void CDecor::DrawInfo() { - POINT pos; - char(*pText)[100]; - char text[100]; + POINT pos; + char text[100]; - if (m_phase == WM_PHASE_PLAY || WM_PHASE_PLAYTEST) - { - pText = m_notifText; - for (int i = 4; i != 0; i--) - { - if ((*pText)[0] != '\0') - { - pos.x = 10; - pos.y = 10; - DrawTextB(m_pPixmap, pos, m_messages[i], 0); + if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) + { + for (int i = 4; i != 0; i--) { + if (m_notifText[i] != '\0') { + DrawText(m_pPixmap, { 10, 10 }, m_notifText[i], 0); } } - if (m_nbVies > 0) - { - pos.x = -15; - for (int i = 0; i < m_nbVies; i++) - { - pos.y = 417; - m_pPixmap->QuickIcon(GetBlupiChannelStandard(), 48, pos); + + if (m_nbVies > 0) { + pos = { -15, 417 }; + for (int i = 0; i < m_nbVies; i++) { + m_pPixmap->QuickIcon(GetBlupiChannelActual(), 48, pos); pos.x += 16; } } - if (m_blupiBullet > 0) - { - pos.x = -15; - pos.y = 398; - for (int i = 0; i < m_blupiBullet; i++) - { + + if (m_blupiBullet > 0) { + pos = { 398, 442 }; + for (int i = 0; i < m_blupiBullet; i++) { m_pPixmap->QuickIcon(CHELEMENT, 176, pos); pos.x += 4; } } - } + + if (m_blupiPerso > 0) { + m_pPixmap->QuickIcon(CHBUTTON, GetIconPerso(), { 465, 438 }); + sprintf(text, "=_%d", m_blupiPerso); + DrawText(m_pPixmap, { 497, 452 }, text, FONTWHITE); + } + + if (m_blupiDynamite > 0) { + m_pPixmap->QuickIcon(CHELEMENT, 252, { 505, 414 }); + } + + if (m_blupiCle | CLE_RED) { + m_pPixmap->QuickIcon(CHELEMENT, 215, { 520, 418 }); + } + + if (m_blupiCle | CLE_GREEN) { + m_pPixmap->QuickIcon(CHELEMENT, 222, { 530, 418 }); + } + + if (m_blupiCle | CLE_BLUE) { + m_pPixmap->QuickIcon(CHELEMENT, 229, { 540, 418 }); + } + + if ((m_mission != 1 && m_mission % 10 != 0) || m_bPrivate) + { + sprintf(text, "%d/%d", m_nbTresor, m_totalTresor); + DrawText(m_pPixmap, { 590, 452 }, text, FONTWHITE); + } + + for (int i = 0; i < 2; i++) + { + if (!(m_jauges[i].GetHide())) m_jauges[i].Draw(); + } + + if (m_mission == 10 && m_phase == WM_PHASE_PLAY && !m_bPrivate) + { + switch (m_nbTresor) + { + case 0: + if (m_blupiPos.x > 212) m_blupiPos.x = 212; + break; + case 1: + if (m_blupiPos.x > 788) m_blupiPos.x = 788; + break; + } + // more... + } + } } POINT CDecor::DecorNextAction() { - int num = 0; - if (m_decorAction == 0 || m_bPause) - { - m_posDecor; - } - POINT posDecor = m_posDecor; - while (table_decor_action[num] != 0) - { + int num = 0; + if (m_decorAction == 0 || m_bPause) + { + return m_posDecor; + } + POINT posDecor = m_posDecor; + while (table_decor_action[num] != 0) + { if (m_decorAction == table_decor_action[num]) { if (m_decorPhase < table_decor_action[num + 1]) @@ -622,7 +935,7 @@ POINT CDecor::DecorNextAction() } else { - num2 = 6400 - (m_drawBounds.right - m_drawBounds.left); + num2 = DIMOBJX * MAXCELX - LXIMAGE; } if (posDecor.x < 0) { @@ -638,7 +951,7 @@ POINT CDecor::DecorNextAction() } else { - num2 = 6400 - (m_drawBounds.bottom - m_drawBounds.top); + num2 = DIMOBJY * MAXCELY - LYIMAGE; } if (posDecor.y < 0) { @@ -658,7843 +971,518 @@ POINT CDecor::DecorNextAction() { num += 2 + table_decor_action[num + 1] * 2; } - } + } return posDecor; } - -void CDecor::SetInput(UINT input) +void CDecor::SetInput(int keys) { - m_keyPress = input; - if (m_blupiInvert != 0) - { - if ((input & INPUT_LEFT) != 0) - { - m_keyPress = input & ~INPUT_LEFT | INPUT_RIGHT; - } - if ((input & INPUT_RIGHT) != 0) - { - m_keyPress = m_keyPress & ~INPUT_RIGHT | INPUT_LEFT; - } - } + m_keyPress = keys; + if (m_blupiInvert) + { + if (keys & KEY_LEFT) + { + m_keyPress = keys & ~KEY_LEFT | KEY_RIGHT; + } + if (keys & KEY_RIGHT) + { + m_keyPress = m_keyPress & ~KEY_RIGHT | KEY_LEFT; + } + } } void CDecor::SetJoystickEnable(BOOL bJoystick) { m_bJoystick = bJoystick; - return; } -void CDecor::SetSpeedX(double speed) +void CDecor::SetFieldD814(BOOL param) { - if (m_blupiInvert) - { - speed = -speed; - } - m_blupiSpeedX = speed; + m_bD814 = param; } -void CDecor::SetSpeedY(double speed) +void CDecor::PlaySound(int sound, POINT pos, BOOL bLocal) { - m_blupiSpeedY = speed; + if (!bLocal) NetPlaySound(sound, pos); + + m_pSound->PlayImage(sound, pos - m_posDecor, -1); + + switch (sound) { + case SOUND_HELICOHIGH: + m_bHelicoMarch = TRUE; + break; + case SOUND_HELICOLOW: + m_bHelicoStop = TRUE; + break; + case SOUND_JEEPHIGH: + m_bJeepMarch = TRUE; + break; + case SOUND_JEEPLOW: + m_bJeepStop = TRUE; + break; + } } -int CDecor::SoundEnviron(int sound, int obstacle) +void CDecor::PlaySound(int sound, POINT pos) { - if ((obstacle >= 32 && obstacle <= 34) || (obstacle >= 41 && obstacle <= 47) || (obstacle >= 139 && obstacle <= 143)) - { - if (sound == 4) - { - return 79; - } - if (sound == 3) - { - return 78; - } - } - if ((obstacle >= 1 && obstacle <= 28) || (obstacle >= 78 && obstacle <= 90) || (obstacle >= 250 && obstacle <= 260) || (obstacle >= 311 && obstacle <= 316) || (obstacle >= 324 && obstacle <= 329)) - { - if (sound == 4) - { - return 81; - } - if (sound == 3) - { - return 80; - } - } - if ((obstacle >= 284 && obstacle <= 303) || obstacle == 338) - { - if (sound == 4) - { - return 83; - } - if (sound == 3) - { - return 82; - } - } - if (obstacle >= 341 && obstacle <= 363) - { - if (sound == 4) - { - return 85; - } - if (sound == 3) - { - return 84; - } - } - if (obstacle >= 215 && obstacle <= 234) - { - if (sound == 4) - { - return 87; - } - if (sound == 3) - { - return 86; - } - } - if (obstacle >= 246 && obstacle <= 249) - { - if (sound == 4) - { - return 89; - } - if (sound == 3) - { - return 88; - } - } - if (obstacle >= 107 && obstacle <= 109) - { - if (sound == 4) - { - return 91; - } - if (sound == 3) - { - return 90; - } - } - return sound; + PlaySound(sound, pos, FALSE); } -void CDecor::PlaySoundB(int sound, POINT pos, int net) -{ - { - if (m_blupiHide && (sound == 1 || sound == 2 || sound == 3 || sound == 4 || sound == 5 || sound == 6 || sound == 7 || sound == 20 || sound == 21 || sound == 22 || sound == 23 || sound == 24 || sound == 25 || sound == 27 || sound == 32 || sound == 34 || sound == 35 || sound == 36 || sound == 37 || sound == 38 || sound == 39 || sound == 40 || sound == 46 || sound == 47 || sound == 48 || sound == 49 || sound == 64 || sound == 65 || sound == 78 || sound == 79 || sound == 80 || sound == 81 || sound == 82 || sound == 83 || sound == 84 || sound == 85 || sound == 86 || sound == 87 || sound == 88 || sound == 89 || sound == 90 || sound == 91)) - { - return; - } - pos.x -= m_posDecor.y; - pos.y -= m_posDecor.y; - m_pSound->PlayImage(sound, pos); - } -} - -void CDecor::StopSound(Sound sound) +void CDecor::StopSound(int sound) { m_pSound->StopSound(sound); - if (sound == SOUND_16_HELICOHIGH) - { - m_bHelicopterFlying = FALSE; + + switch (sound) { + case SOUND_HELICOHIGH: + m_bHelicoMarch = FALSE; + break; + case SOUND_HELICOLOW: + m_bHelicoStop = FALSE; + break; + case SOUND_JEEPHIGH: + m_bJeepMarch = FALSE; + break; + case SOUND_JEEPLOW: + m_bJeepStop = FALSE; + break; } - if (sound == SOUND_18_HELICOLOW) - { - m_bHelicopterStationary = FALSE; +} + +void CDecor::AdaptMotorVehicleSound(POINT pos) +{ + POINT blupiPos = pos - m_posDecor; + + if (m_bHelicoMarch) m_pSound->PlayImage(SOUND_HELICOHIGH, blupiPos); + if (m_bHelicoStop) m_pSound->PlayImage(SOUND_HELICOLOW, blupiPos); + if (m_bJeepMarch) m_pSound->PlayImage(SOUND_JEEPHIGH, blupiPos); + if (m_bJeepStop) m_pSound->PlayImage(SOUND_JEEPLOW, blupiPos); +} + +void CDecor::VehicleSoundsPhase(int phase) +{ + m_phase = phase; + + if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST) { + int channel = -1; + if (m_bHelicoMarch) channel = SOUND_HELICOHIGH; + if (m_bHelicoStop) channel = SOUND_HELICOLOW; + if (m_bJeepMarch) channel = SOUND_JEEPHIGH; + if (m_bJeepStop) channel = SOUND_JEEPLOW; + if (channel != -1) m_pSound->PlayImage(channel, { LXIMAGE / 2, LYIMAGE / 2 }, -1); } - if (sound == SOUND_29_JEEPHIGH) - { - m_bCarMoving = FALSE; + else { + if (m_bHelicoMarch) m_pSound->StopSound(SOUND_HELICOHIGH); + if (m_bHelicoStop) m_pSound->StopSound(SOUND_HELICOLOW); + if (m_bJeepMarch) m_pSound->StopSound(SOUND_JEEPHIGH); + if (m_bJeepStop) m_pSound->StopSound(SOUND_JEEPLOW); } - if (sound == SOUND_31_JEEPLOW) - { - m_bCarStationary = FALSE; - } - return; - -} - -void CDecor::AdaptMotorVehicleSound() -{ - POINT blupiPos = m_blupiPos; - blupiPos.x -= m_posDecor.x; - blupiPos.y -= m_posDecor.y; - - if (m_bHelicopterFlying != FALSE) - { - m_pSound->PlayImage(16, blupiPos); - } - if (m_bHelicopterStationary != FALSE) - { - m_pSound->PlayImage(18, blupiPos); - } - if (m_bCarMoving != FALSE) - { - m_pSound->PlayImage(29, blupiPos); - } - if (m_bCarStationary != FALSE) - { - m_pSound->PlayImage(31, blupiPos); - } - return; -} - - -POINT CDecor::ScreenPosToCelPos(POINT* pos, POINT cel) -{ - POINT res; - UINT num; - LONG thing; - POINT pos2; - - if (cel.x < 0 || cel.x >= LXIMAGE || cel.y < 0 || cel.y >= LYIMAGE) - { - res.x = m_posDecor.x + m_dimCelHili.x * -32 + 32 + cel.x; - res.y = m_posDecor.y + m_dimCelHili.y * -32 + 32 + cel.y; - num = res.y >> 31; - pos->x = (res.x + (res.x >> 31 & 63)) >> 6; - pos->y = (res.y + (num & 63)) >> 6; - return *(POINT*)(num, pos); - } - pos->x = -1; - pos->y = -1; - pos2.x = pos->x; - pos2.y = thing; - return pos2; -} - - -void CDecor::DeleteCel(int celX, int celY) -{ - POINT cel; - POINT pos; - - m_2ndPositionCalculationSlot = -1; - - if ((((-1 < celX) && (celX < MAXCELX)) && (-1 < celY)) && (celY < MAXCELY)) - { - m_decor[celX][celY].icon = -1; - cel.y = celY; - cel.x = celX; - AdaptBorder(cel); - m_bigDecor[celX][celY].icon = -1; - pos.y = celY; - pos.x = celX; - MoveObjectDelete(pos); - } - return; -} - -void CDecor::SetGamerName(const char* playerName) -{ - char* name; - int result; - - name = m_missionTitle; - - result = strlen(playerName) + 1; - - strncpy(name, playerName, result); - - return; -} - -// TODO: Add VehicleSoundsPhase - -void CDecor::UpdateCaisse() -{ - m_nbRankCaisse = 0; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 12) - { - m_rankCaisse[m_nbRankCaisse++] = i; - } - } -} - -BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop) -{ - POINT move; - - move.x = pos.x - m_moveObject[i]->posCurrent.x; - move.y = 0; - SearchLinkCaisse(i, bPop); - int y = m_moveObject[i]->posCurrent.y; - for (int j = 0; j < m_nbLinkCaisse; j++) - { - i = m_linkCaisse[j]; - if (!TestPushOneCaisse(i, move, y)) - { - return FALSE; - } - } - for (int j = 0; j < m_nbLinkCaisse; j++) - { - i = m_linkCaisse[j]; - int num = i; - m_moveObject[num]->posCurrent.x = m_moveObject[num]->posCurrent.x + move.x; - m_moveObject[num]->posStart.x = m_moveObject[num]->posStart.x + move.x; - int num2 = i; - m_moveObject[num]->posEnd.x = m_moveObject[num]->posEnd.x + move.x; - } - return TRUE; -} - -BOOL CDecor::TestPushOneCaisse(int i, POINT move, int b) -{ - RECT rect; - - rect.top = m_moveObject[i]->posCurrent.y; - rect.left = m_moveObject[i]->posCurrent.x + move.x; - rect.right = m_moveObject[i]->posCurrent.x + move.x + 64; - rect.bottom = m_moveObject[i]->posCurrent.y + 64; - - if (DecorDetect(rect, FALSE) != FALSE) - { - return FALSE; - } - - if (m_moveObject[i]->posCurrent.y != b) - { - return TRUE; - } - rect.top = m_moveObject[i]->posCurrent.y; - rect.left = m_moveObject[i]->posCurrent.x + move.x; - rect.right = m_moveObject[i]->posCurrent.x + move.x + 20; - rect.bottom = m_moveObject[i]->posCurrent.y + 66; - - if (DecorDetect(rect, TRUE) == FALSE) - { - return FALSE; - } - rect.top = m_moveObject[i]->posCurrent.y + 64; - rect.left = m_moveObject[i]->posCurrent.x + move.x + 44; - rect.right = m_moveObject[i]->posCurrent.x + move.x + 64; - rect.bottom = m_moveObject[i]->posCurrent.y + 66; - - return (DecorDetect(rect, TRUE)); -} - - -void CDecor::SearchLinkCaisse(int rank, BOOL bPop) -{ - m_nbLinkCaisse = 0; - AddLinkCaisse(rank); - POINT posCurrent = m_moveObject[rank]->posCurrent; - - BOOL flag; - do - { - flag = FALSE; - for (int i = 0; i < m_nbLinkCaisse; i++) - { - int num = m_linkCaisse[i]; - if (m_moveObject[num]->posCurrent.y <= - posCurrent.y && (!bPop || (m_moveObject - [num]->posCurrent.x >= posCurrent.x - 32 && - m_moveObject[num]->posCurrent.x <= - posCurrent.x + 32))) - { - RECT src; - src.left = m_moveObject[num]->posCurrent.x - 1; - src.top = m_moveObject[num]->posCurrent.y - 1; - src.right = src.left + 64 + 1; - src.bottom = src.top + 64 + 1; - for (int j = 0; j < m_nbRankCaisse; j++) - { - int num2 = m_rankCaisse[j]; - if (num2 != num && m_moveObject[num2]->posCurrent.y <= posCurrent.y && (!bPop || (m_moveObject[num2]->posCurrent.x >= posCurrent.x - 32 && m_moveObject[num2]->posCurrent.x <= posCurrent.x + 32))) - { - RECT src2; - src2.left = m_moveObject[num2]->posCurrent.x - 1; - src2.top = m_moveObject[num2]->posCurrent.y - 1; - src2.right = src2.left + 64 + 1; - src2.bottom = src2.top + 64 + 1; - tagRECT tinyRect; - if (IntersectRect(&tinyRect, &src2, &src) && AddLinkCaisse(num2)) - { - flag = TRUE; - } - } - } - } - } - } while (flag); -} - - -BOOL CDecor::AddLinkCaisse(int rank) -{ - for (int i = 0; i < m_nbLinkCaisse; i++) - { - if (m_linkCaisse[i] == rank) - { - return FALSE; - } - } - m_linkCaisse[m_nbLinkCaisse] = rank; - m_nbLinkCaisse++; - return TRUE; -} - - -BOOL CDecor::LoadBackgroundImages() -{ - char filename[52]; - POINT totalDim, iconDim; - - if (m_region == m_lastRegion) return TRUE; - m_lastRegion == m_region; - - totalDim.x = DIMCELX * 2 * 16; - totalDim.y = DIMCELY * 2 * 6; - iconDim.x = DIMCELX * 2; - iconDim.y = DIMCELY * 2; - sprintf(filename, "image\\decor%.3d.blp", m_region); - if (!m_pPixmap->BackgroundCache(CHFLOOR, filename, totalDim, iconDim, FALSE)) - return FALSE; - - return TRUE; -} - - - -/* -int CDecor::SetBlupiChannel() -{ - if ( m_bMulti = 0 || - m_blupiChannel == CHBLUPI || - m_team > 0);{ - return m_team + 10; - } - return m_blupiChannel; -} -*/ - -int CDecor::GetBlupiChannel() -{ - int channel; - - if ((*(int*)((int)m_blupiStartDir + 14) != 0) && - (channel = *(int*)((int)&m_bMulti + 2), 0 < channel)) - { - return channel + CHELEMENT; - } - return CHBLUPI; -} - - - -int CDecor::GetIconPerso() -{ - if ( m_bMulti != 0){ - return m_team + ICON_BUTTON_PERSONALBOMBICON; - } - return ICON_BUTTON_PERSONALBOMBICON; } int CDecor::GetRegion() { - return m_region; + return m_region; } void CDecor::SetRegion(int region) { - m_region = region; + m_region = region; } int CDecor::GetMusic() { - return m_music; + return m_music; } void CDecor::SetMusic(int music) { - m_music = music; + m_music = music; } -void CDecor::GetDims(POINT* ptr) +POINT CDecor::GetDim() { - ptr->x = m_worldDims.x; - ptr->y = m_worldDims.y; - return; + return m_dimDecor; } -void CDecor::SetDims(POINT dims) +void CDecor::SetDim(POINT dim) { - m_worldDims.x = dims.x; - m_worldDims.y = dims.y; + m_dimDecor = dim; } int CDecor::GetNbVies() { - return m_nbVies; + return m_nbVies; } -void CDecor::SetNbVies(int lives) +void CDecor::SetNbVies(int nbVies) { - m_nbVies = lives; + m_nbVies = nbVies; } BOOL CDecor::GetPause() { - return m_bPause; + return m_bPause; } void CDecor::SetPause(BOOL bPause) { - m_bPause = bPause; + m_bPause = bPause; } -void CDecor::SetAllMissions(BOOL CheatDoors) +void CDecor::InitializeDoors(BYTE* doors) { - m_bCheatDoors = CheatDoors; + for (int i = 0; i < 200; i++) + { + doors[i] = m_doors[i]; + } +} + +void CDecor::MemorizeDoors(BYTE* doors) +{ + for (int i = 0; i < 200; i++) + { + m_doors[i] = doors[i]; + } +} + +void CDecor::SetAllMissions(BOOL bAllMissions) +{ + m_bCheatDoors = bAllMissions; AdaptDoors(m_bPrivate, m_mission); - return; + return; } -void CDecor::AdaptDoors(BOOL bPrivate, int mission) +void CDecor::CheatAction(int cheat) { - POINT pos; - POINT pos2; - int i; + MoveObject* mob; - m_bPrivate = bPrivate; - m_mission = mission; - - pos.x = 0; - pos.y = 0; - pos2.x = 0; - pos2.y = 0; - - if (bPrivate == FALSE) - { - if (mission == 1) - { - do - { - if ((SearchDoor(bPrivate, pos2, pos) != FALSE) && ((*(char*)((int)m_lastDecorIcon + bPrivate + 0xFFFFFF) == '\0' || - (m_bCheatDoors != FALSE)))) - { - m_decor[pos2.x][pos2.y].icon = -1; - i = MoveObjectFree(); - m_moveObject[i]->type = TYPE_DOOR; - m_moveObject[i]->stepAdvance = 50; - m_moveObject[i]->stepRecede = 1; - m_moveObject[i]->timeStopStart = 0; - m_moveObject[i]->timeStopEnd = 0; - m_moveObject[i]->posStart.x = pos2.x << 6; - m_moveObject[i]->posStart.y = pos2.y << 6; - m_moveObject[i]->posCurrent.x = m_moveObject[i]->posStart.x; - m_moveObject[i]->posCurrent.y = m_moveObject[i]->posStart.y; - m_moveObject[i]->step = STEP_STOPSTART; - m_moveObject[i]->time = 0; - m_moveObject[i]->phase = 0; - m_moveObject[i]->channel = CHOBJECT; - m_moveObject[i]->icon = 183; - PlaySoundB(SOUND_33_DOOR, m_moveObject[i]->posStart, 0); - } - bPrivate = bPrivate + TRUE; - } while ((int)bPrivate < 20); - } - } -} - -void CDecor::CheatAction(int cheat, MoveObject moveObject) -{ - if (cheat == cheat_cleanall) - { - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 2 || m_moveObject[i]->type == 3 || m_moveObject[i]->type == 96 || - m_moveObject[i]->type == 97 || m_moveObject[i]->type == 4 || m_moveObject[i]->type == 16 || - m_moveObject[i]->type == 17 || m_moveObject[i]->type == 20 || m_moveObject[i]->type == 44 || - m_moveObject[i]->type == 54 || m_moveObject[i]->type == 32 || m_moveObject[i]->type == 33) - { - m_decorAction = 1; - m_decorPhase = 0; - m_moveObject[i]->type = 8; - m_moveObject[i]->phase = 0; - - m_moveObject[i]->posCurrent.x = m_moveObject[i]->posCurrent.x + -34; - m_moveObject[i]->posCurrent.y = m_moveObject[i]->posCurrent.y + -34; - m_moveObject[i]->posStart.x = m_moveObject[i]->posCurrent.x; - m_moveObject[i]->posStart.y = m_moveObject[i]->posCurrent.y; - m_moveObject[i]->posEnd.x = m_moveObject[i]->posCurrent.x; - m_moveObject[i]->posEnd.y = m_moveObject[i]->posCurrent.y; - MoveObjectStepIcon(i); - PlaySoundB(10, m_moveObject[i]->posCurrent, 0); - - } - } - } - if (cheat == cheat_funskate) - { - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = TRUE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - m_pSound->StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - } - if (cheat == cheat_givecopter) - { - m_blupiAir = FALSE; - m_blupiHelico = TRUE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - } - if (cheat == cheat_jeepdrive) - { - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = TRUE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - } - if (cheat == cheat_alltreasure) - { - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 5) - { - m_moveObject[i]->type == 0; - m_nbTresor++; - OpenDoorsTresor(); - PlaySoundB(SOUND_11_TRESOR, m_moveObject[i]->posCurrent, 0); - } - } - } - if (cheat == cheat_endgoal) - { - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 7 || m_moveObject[i]->type == 21) - { - m_blupiPos = m_moveObject[i]->posCurrent; - if (m_nbTresor >= m_totalTresor) - { - if (m_moveObject[i]->type == 21) - { - m_bFoundCle = TRUE; - } - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(SOUND_14_ENDOK, m_blupiPos, 0); - m_blupiAction = 13; - m_blupiPhase = 0; - m_blupiFocus = FALSE; - m_blupiFront = TRUE; - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = TRUE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiInvert = FALSE; - m_blupiBalloon = FALSE; - m_blupiEcrase = FALSE; - } - else - { - PlaySoundB(SOUND_13_ENDKO, m_blupiPos, 0); - } - m_goalPhase = 50; - } - } - } - if (cheat == cheat_roundshield) - { - PlaySoundB(SOUND_42_STARTSHIELD, m_blupiPos, 0); - m_blupiShield = TRUE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(FALSE); - } - if (cheat == cheat_quicklollipop) - { - m_blupiAction = 49; - m_blupiPhase = 0; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiFocus = FALSE; - PlaySoundB(SOUND_50_SUCETTE, m_blupiPos, 0); - } - if (cheat == cheat_tenbombs) - { - m_blupiPerso = 10; - PlaySoundB(SOUND_60_PERSOTAKE, m_blupiPos, 0); - } - if (cheat == cheat_birdlime) - { - m_blupiBullet = 10; - } - if (cheat == cheat_drivetank) - { - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = TRUE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - } - if (cheat == cheat_powercharge) - { - m_blupiAction = 56; - m_blupiPhase = 0; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = TRUE; - m_blupiSkate = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiJumpAie = FALSE; - m_blupiFocus = FALSE; - PlaySoundB(SOUND_58_CHARGE, m_blupiPos, 0); - } - if (cheat == cheat_hidedrink) - { - m_blupiAction = 55; - m_blupiPhase = 0; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiJumpAie = FALSE; - m_blupiFocus = FALSE; - PlaySoundB(SOUND_57_DRINK, m_blupiPos, 0); - } - if (cheat == cheat_iovercraft) - { - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = TRUE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - } - if (cheat == cheat_udynamite) - { - m_blupiDynamite = 1; - PlaySoundB(SOUND_60_PERSOTAKE, m_blupiPos, 0); - } - if (cheat == cheat_wellkeys) - { - m_blupiCle |= 7; - } - if (m_blupiShield && m_blupiHide && m_blupiCloud && m_blupiPower) - { - m_jauges[1].SetHide(TRUE); - } - if (m_blupiHelico && m_blupiOver) - { - m_pSound->StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - } - if (m_blupiJeep && m_blupiTank) - { - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - } -} - -void CDecor::BlupiSearchIcon() -{ - int num = 0; - int num2 = 2; - int num3 = m_blupiAction; - if (m_blupiVent && m_blupiHelico && m_blupiOver) - { - if (num3 == 1) - { - num3 = 8; - } - if (num3 == 2) - { - num3 = 14; - } - } - if (m_blupiHelico) - { - if (num3 == 1) - { - num3 = 15; - } - if (num3 == 2) - { - num3 = 16; - } - if (num3 == 3) - { - num3 = 17; - } - if (num3 == 10) - { - num3 = 15; - } - if (num3 == 9) - { - num3 = 15; - } - m_blupiRealRotation = (int)(m_blupiVitesseX * 2.0); - } - if (m_blupiOver) - { - if (num3 == 1) - { - num3 = 67; - } - if (num3 == 2) - { - num3 = 68; - } - if (num3 == 3) - { - num3 = 69; - } - if (num3 == 10) - { - num3 = 67; - } - if (num3 == 9) - { - num3 = 67; - } - } - if (m_blupiJeep) - { - if (num3 == 1) - { - num3 = 25; - } - if (num3 == 2) - { - num3 = 26; - } - if (num3 == 10) - { - num3 == 26; - } - if (num3 == 3) - { - num3 = 27; - } - } - if (m_blupiTank) - { - if (num3 == 1) - { - num3 = 50; - } - if (num3 == 2) - { - num3 = 51; - } - if (num3 == 10) - { - num3 = 51; - } - if (num3 == 3) - { - num3 = 52; - } - } - -} - -/* -void CDecor::BlupiStep() -{ - POINT tinyPoint; - POINT tinyPoint2; - BlupiAdjust(); - m_blupiLastPos = m_blupiPos; - POINT tinyPoint3 = m_blupiPos; - BOOL flag = m_blupiAir; - int blupiAction = m_blupiAction; - BOOL flag2 = FALSE; - BOOL flag3 = FALSE; - tinyPoint3.x += m_blupiVector.x; - tinyPoint3.y += m_blupiVector.y; - if (m_blupiFocus && (tinyPoint3.y + 30) / 64 >= 99) - { - BlupiDead(75, -1); - m_blupiRestart = TRUE; - m_blupiAir = TRUE; - m_blupiPos.y = m_blupiPos.y / 64 * 64 + BLUPIOFFY; - PlaySoundB(8, m_blupiPos, 0); - return; - } - RECT rect; - if (m_blupiVector.x != 0 || m_blupiVector.y != 0) - { - rect = BlupiRect(m_blupiPos); - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - TestPath(rect, m_blupiPos, tinyPoint3); - } - m_blupiVent = FALSE; - int num; - if (m_blupiTransport == -1 && !m_blupiJeep && !m_blupiTank && !m_blupiSkate - && m_blupiFocus) - { - num = m_decor[(tinyPoint3.x + 30) / 64, (tinyPoint3.y + 30) / 64]->icon; - if (num == 110) - { - tinyPoint3.x -= 9; - } - if (num == 114) - { - tinyPoint3.x += 9; - } - if (num == 118) - { - tinyPoint3.y -= 20; - } - if (num == 122) - { - tinyPoint3.y += 20; - } - if (num >= 110 && num <= 125) - { - m_blupiVent = TRUE; - rect.left = m_blupiPos.x + 12; - rect.right = m_blupiPos.x + 60 - 12; - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - TestPath(rect, m_blupiPos, tinyPoint3); - } - } - BOOL flag4; - if (m_blupiTransport == -1) - { - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60 - 1; - flag = !DecorDetect(rect); - } - else - { - flag4 = FALSE; - } - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 10; - rect.bottom = tinyPoint3.y + 20; - BOOL flag5 = DecorDetect(rect); - int detectIcon = m_detectIcon; - if (!m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && flag4 && m_blupiFocus) - { - if (m_blupiFocus) - { - m_blupiAction = 5; - m_blupiPhase = 0; - } - m_blupiVitesseY = 1.0; - m_blupiAir = true; - flag = true; - } - if (!m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiAir && IsRessort(tinyPoint3)) - { - if ((m_blupiHelico || m_blupiOver) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiHelico = false; - m_blupiOver = false; - tinyPoint.x = tinyPoint3.x - 34; - tinyPoint.y = tinyPoint3.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(10, m_blupiPos,0); - } - if (m_blupiJeep && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiJeep = false; - tinyPoint.x = tinyPoint3.x - 34; - tinyPoint.y = tinyPoint3.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(10, m_blupiPos, 0); - } - if (m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiTank = false; - tinyPoint.x = tinyPoint3.x - 34; - tinyPoint.y = tinyPoint3.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(10, m_blupiPos, 0); - } - if (m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiSkate = false; - tinyPoint.x = tinyPoint3.x - 34; - tinyPoint.y = tinyPoint3.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(10, m_blupiPos, 0); - } - if (m_blupiFocus && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81) - { - m_blupiAction = 5; - m_blupiPhase = 0; - } - if ((m_keyPress & 1) != 0 && m_blupiFocus) - { - m_blupiVitesseY = (double)(m_blupiPower ? -25 : -19); - } - else - { - m_blupiVitesseY = (double)(m_blupiPower ? -16 : -10); - } - m_blupiAir = true; - flag = true; - PlaySoundB(41, tinyPoint3, 0); - } - if ((m_keyPress & 1) != 0 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiAction != 4 && m_blupiAction != 3 && !m_blupiAir) - { - m_blupiAction = 4; - m_blupiPhase = 0; - } - if (m_blupiAction == 4 && m_blupiPhase == 3) - { - m_blupiAction = 5; - m_blupiPhase = 0; - if (m_blupiSkate) - { - PlaySoundB(1, tinyPoint3, 0); - m_blupiVitesseY = (double)(m_blupiPower ? -17 : -13); - } - else - { - PlaySoundB(1, tinyPoint3, 0); - if (IsNormalJump(tinyPoint3)) - { - m_blupiVitesseY = (double)(m_blupiPower ? -26 : -16); - } - else - { - m_blupiVitesseY = (double)(m_blupiPower ? -16 : -12); - } - } - m_blupiAir = true; - flag = true; - } - } - if (m_blupiAir) - { - if (flag5 && m_blupiVitesseY < 0.0) - { - if (m_blupiVitesseY < -14.0 && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81 && !m_blupiSkate) - { - m_blupiJumpAie = true; - PlaySoundB(40, tinyPoint3, 0); - } - else - { - PlaySoundB(SoundEnviron(4, detectIcon), tinyPoint3, 0); - } - m_blupiVitesseY = 1.0; - } - tinyPoint3.y += (int)(m_blupiVitesseY * 2.0); - if (m_blupiVitesseY < 20.0) - { - m_blupiVitesseY += 2.0; - } - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 60 - 30; - rect.bottom = tinyPoint3.y + 60 - 1; - if (m_blupiVitesseY >= 0.0 && DecorDetect(rect)) - { - tinyPoint3.y = tinyPoint3.y / 32 * 32 + BLUPIOFFY; - if (!IsRessort(tinyPoint3)) - { - PlaySoundB(SoundEnviron(3, m_detectIcon), tinyPoint3, 0); - } - if (m_blupiFocus) - { - if (m_blupiVitesseY > 20.0) - { - m_blupiAction = 61; - } - else - { - m_blupiAction = 61; - } - m_blupiPhase = 0; - } - m_blupiAir = false; - if (m_blupiJumpAie) - { - m_blupiJumpAie = false; - m_blupiAction = 36; - m_blupiPhase = 0; - } - } - rect.left = tinyPoint3.x + 20; - rect.right = tinyPoint3.x + 60 - 20; - rect.top = tinyPoint3.y + 60 - 33; - rect.bottom = tinyPoint3.y + 60 - 1; - num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) - { - m_blupiTransport = num; - flag4 = false; - PlaySoundB(3, tinyPoint3, 0); - tinyPoint3.y = m_moveObject[num]->posCurrent.y - 64 + BLUPIOFFY; - if (m_blupiFocus) - { - if (m_blupiVitesseY > 20.0) - { - m_blupiAction = 61; - } - else - { - m_blupiAction = 61; - } - m_blupiPhase = 0; - } - m_blupiAir = false; - if (m_blupiJumpAie) - { - m_blupiJumpAie = false; - m_blupiAction = 36; - m_blupiPhase = 0; - } - } - } - if (m_blupiAction == 36 && m_blupiPhase == 30) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 56 && m_blupiPhase == 64) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - m_blupiCloud = true; - m_blupiTimeShield = 100; - m_jauges[1].SetHide(false); - PlaySoundB(55, tinyPoint3, 0); - } - if (m_blupiAction == 58) - { - if (m_blupiPhase == 8) - { - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y + 40; - if (m_blupiVitesseY > 0.0) - { - tinyPoint.y += (int)(m_blupiVitesseY * 4.0); - } - m_blupiVitesseY -= 10.0; - if (ObjectStart(tinyPoint, 23, 55) != -1) - { - PlaySoundB(52, m_blupiPos, 0); - m_blupiTimeFire = 10; - m_blupiBullet--; - } - } - if (m_blupiPhase == 14) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if ((m_blupiAction == 44 || m_blupiAction == 45) && m_blupiPhase == 29) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 46 && m_blupiPhase == 32) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 47 && m_blupiPhase == 34) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - bool flag6; - if (m_blupiAction == 48 && m_blupiPhase == 40) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - num = MoveObjectDetect(tinyPoint3, flag6); - if (num != -1 && !flag6 && tinyPoint3.y - BLUPIFLOOR == m_moveObject[num]->posCurrent.y) - { - if (m_blupiDir == 2 && tinyPoint3.x < m_moveObject[num]->posCurrent.x) - { - tinyPoint.x = tinyPoint3.x - 16; - tinyPoint.y = tinyPoint3.y; - int num2 = MoveObjectDetect(tinyPoint, flag6); - if (num2 == -1) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - } - if (m_blupiDir == 1 && tinyPoint3.x > m_moveObject[num]->posCurrent.x) - { - tinyPoint.x = tinyPoint3.x + 16; - tinyPoint.y = tinyPoint3.y; - int num2 = MoveObjectDetect(tinyPoint, flag6); - if (num2 == -1) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - } - } - } - if (m_blupiAction == 65) - { - if (m_blupiPhase == 4) - { - PlaySoundB(47, m_blupiPos, 0); - } - if (m_blupiPhase == 44) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 63) - { - if (m_blupiPhase == 1) - { - PlaySoundB(65, m_blupiPos, 0); - m_blupiTimeMockery = 300; - } - if (m_blupiPhase == 92) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 64) - { - if (m_blupiPhase == 6) - { - PlaySoundB(65, m_blupiPos, 0); - m_blupiTimeMockery = 300; - } - if (m_blupiPhase == 104) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 83) - { - if (m_blupiPhase == 4) - { - PlaySoundB(47, m_blupiPos, 0); - } - if (m_blupiPhase == 60) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 84 && m_blupiPhase == 18) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 60 && m_blupiPhase == 3) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 61 && m_blupiPhase == 5) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 62 && m_blupiPhase == 2) - { - m_blupiAction = 5; - m_blupiPhase = 0; - m_blupiVitesseY = -12.0; - m_blupiAir = true; - flag = true; - } - if (m_blupiAction == 49 && m_blupiPhase == 32) - { - ObjectStart(m_sucettePos, m_sucetteType, 0); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - m_blupiPower = true; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - PlaySoundB(44, tinyPoint3, 0); - } - if (m_blupiAction == 55 && m_blupiPhase == 36) - { - ObjectStart(m_sucettePos, m_sucetteType, 0); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - m_blupiHide = true; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - PlaySoundB(62, tinyPoint3, 0); - } - if (m_blupiSpeedY < 0.0 && m_blupiLastSpeedY == 0.0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 7; - m_blupiPhase = 0; - } - if (m_blupiSpeedY == 0.0 && m_blupiLastSpeedY < 0.0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedY > 0.0 && m_blupiLastSpeedY == 0.0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 6 && m_blupiAction != 28 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 6; - m_blupiPhase = 0; - } - if (m_blupiSpeedY > 0.0 && m_blupiSpeedX == 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 6 && m_blupiAction != 28 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 6; - m_blupiPhase = 0; - } - if (m_blupiSpeedY == 0.0 && m_blupiLastSpeedY > 0.0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 7 && m_blupiPhase == 4) - { - m_scrollAdd.y = -150; - PlaySoundB(21, tinyPoint3, 0); - } - if (m_blupiAction == 6 && m_blupiPhase == 4) - { - m_scrollAdd.y = 150; - PlaySoundB(7, tinyPoint3, 0); - } - if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiSpeedY > 0.0 && m_blupiSpeedX == 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 28 && m_blupiDir == 1 && (num = CaisseInFront()) != -1) - { - tinyPoint3.x = m_moveObject[num]->posCurrent.x + 64 - 5; - m_blupiAction = 28; - m_blupiPhase = 0; - m_scrollAdd.y = 0; - PlaySoundB(39, tinyPoint3, 0); - } - if (m_blupiSpeedY > 0.0 && m_blupiSpeedX > 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 29 && m_blupiDir == 1 && CaisseInFront() != -1) - { - m_blupiAction = 29; - m_blupiPhase = 0; - m_scrollAdd.y = 0; - PlaySoundB(39, tinyPoint3, 0); - } - if (m_blupiSpeedY > 0.0 && m_blupiSpeedX == 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 28 && m_blupiDir == 2 && (num = CaisseInFront()) != -1) - { - tinyPoint3.x = m_moveObject[num]->posCurrent.x - 60 + 5; - m_blupiAction = 28; - m_blupiPhase = 0; - m_scrollAdd.y = 0; - PlaySoundB(39, tinyPoint3, 0); - } - if (m_blupiSpeedY > 0.0 && m_blupiSpeedX < 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 29 && m_blupiDir == 2 && CaisseInFront() != -1) - { - m_blupiAction = 29; - m_blupiPhase = 0; - m_scrollAdd.y= 0; - PlaySoundB(39, tinyPoint3, 0); - } - if (m_blupiAction == 29 && m_blupiActionOuf != 47) - { - m_blupiActionOuf = 47; - m_blupiTimeOuf = 0; - } - } - if (m_blupiAction != 28 && m_blupiAction != 29 && m_blupiFocus) - { - if (m_blupiSpeedX < 0.0 && m_blupiLastSpeedX == 0.0 && !m_blupiAir && m_blupiSpeedY != 0.0) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX == 0.0 && m_blupiLastSpeedX < 0.0 && m_blupiSpeedY != 0.0) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX > 0.0 && m_blupiLastSpeedX == 0.0 && !m_blupiAir && m_blupiSpeedY != 0.0) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX == 0.0 && m_blupiLastSpeedX > 0.0 && m_blupiSpeedY != 0.0) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - int num3; - int num4; - if (m_blupiSpeedX < 0.0 && m_blupiFocus) - { - if (m_blupiDir == 2 && m_blupiAction != 3 && m_blupiAction != 59 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && ((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || abs(m_blupiVitesseX) <= 8.0)) - { - if (m_blupiAir) - { - PlaySound(5, tinyPoint3); - m_blupiAction = 59; - m_blupiPhase = 0; - m_blupiDir = 1; - } - else - { - PlaySound(5, tinyPoint3); - m_blupiAction = 3; - m_blupiPhase = 0; - } - } - if (m_blupiDir == 1 && m_blupiAction != 2 && m_blupiAction != 14 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiAir) - { - m_blupiAction = 2; - m_blupiPhase = 0; - } - if (m_blupiDir == 1 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend) - { - if (m_blupiAction == 14) - { - tinyPoint3.x -= CaisseGetMove(5); - } - else - { - num3 = m_blupiPhase; - if (num3 > 3 || m_blupiAir) - { - num3 = 3; - } - num4 = table_vitesse_march[num3]; - if (m_blupiPower) - { - num4 *= 3; - num4 /= 2; - } - tinyPoint3.x += Speed(m_blupiSpeedX, num4); - } - } - if (m_blupiDir == 2 && m_blupiAction == 29) - { - tinyPoint3.x -= CaisseGetMove(3); - } - } - if (m_blupiSpeedX > 0.0 && m_blupiFocus) - { - if (m_blupiDir == 1 && m_blupiAction != 3 && m_blupiAction != 59 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && ((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || abs(m_blupiVitesseX) <= 8.0)) - { - if (m_blupiAir) - { - PlaySound(5, tinyPoint3); - m_blupiAction = 59; - m_blupiPhase = 0; - m_blupiDir = 2; - } - else - { - PlaySound(5, tinyPoint3); - m_blupiAction = 3; - m_blupiPhase = 0; - } - } - if (m_blupiDir == 2 && m_blupiAction != 2 && m_blupiAction != 14 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiAir) - { - m_blupiAction = 2; - m_blupiPhase = 0; - } - if (m_blupiDir == 2 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend) - { - if (m_blupiAction == 14) - { - tinyPoint3.x += CaisseGetMove(5); - } - else - { - num3 = m_blupiPhase; - if (num3 > 3 || m_blupiAir) - { - num3 = 3; - } - num4 = table_vitesse_march[num3]; - if (m_blupiPower) - { - num4 *= 3; - num4 /= 2; - } - tinyPoint3.x += Speed(m_blupiSpeedX, num4); - } - } - if (m_blupiDir == 1 && m_blupiAction == 29) - { - tinyPoint3.x += CaisseGetMove(3); - } - } - if (m_blupiHelico) - { - if (m_blupiAction == 3 && m_blupiPhase == 10) - { - m_blupiAction = 2; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiOver) - { - if (m_blupiAction == 3 && m_blupiPhase == 7) - { - m_blupiAction = 2; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiJeep) - { - if (m_blupiAction == 3 && m_blupiPhase == 7) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiTank) - { - if (m_blupiAction == 3 && m_blupiPhase == 12) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiSkate) - { - if (m_blupiAction == 3 && m_blupiPhase == 14) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiNage || m_blupiSurf) - { - if (m_blupiAction == 3 && m_blupiPhase == 10) - { - m_blupiAction = 2; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiSuspend) - { - if (m_blupiAction == 3 && m_blupiPhase == 10) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else - { - if (m_blupiAction == 3 && m_blupiPhase == 6) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - if (m_blupiAction == 59 && m_blupiPhase == 6) - { - m_blupiAction = 5; - m_blupiPhase = 0; - } - } - if (!m_blupiSuspend && m_blupiAction == 4 && m_blupiPhase == 3) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) - { - if (m_blupiAction == 14 || m_blupiAction == 7) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 2) - { - if (m_blupiSuspend || m_blupiPhase < 10) - { - m_blupiAction = 1; - } - else - { - m_blupiAction = 60; - } - m_blupiPhase = 0; - } - if (m_blupiAction == 6) - { - m_blupiAction = 1; - m_blupiPhase = 0; - PlaySound(20, tinyPoint3); - } - m_scrollAdd.y = 0; - if (blupiAction == 14) - { - StopSound(38); - } - if (blupiAction == 29 || blupiAction == 28) - { - StopSound(39); - } - } - if (!m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) - { - if (m_blupiAction == 9 && m_blupiDir == 1) - { - tinyPoint3.x += 4; - } - if (m_blupiAction == 9 && m_blupiDir == 2) - { - tinyPoint3.x -= 4; - } - if (m_blupiAction == 10 && m_blupiDir == 1) - { - tinyPoint3.x -= 4; - } - if (m_blupiAction == 10 && m_blupiDir == 2) - { - tinyPoint3.x += 4; - } - } - if ((m_keyPress & -3) == 0 && m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && (m_blupiJeep || m_blupiTank || m_blupiSkate) && m_blupiFocus) - { - if (m_blupiAction == 10 && m_blupiDir == 1) - { - tinyPoint3.x -= 5; - } - if (m_blupiAction == 10 && m_blupiDir == 2) - { - tinyPoint3.x += 5; - } - } - if ((m_keyPress & -3) == 0 && m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && m_blupiNage && m_blupiFocus && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if ((m_keyPress & -3) == 0 && m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && m_blupiSurf && m_blupiFocus && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiHelico && (m_blupiFocus || m_blupiAction == 58)) - { - if ((m_keyPress & 2) != 0 && m_blupiTimeFire == 0 && m_blupiAction != 3 && m_blupiAction != 58 && flag4) - { - if (m_blupiBullet == 0) - { - PlaySound(53, m_blupiPos); - } - else - { - m_blupiAction = 58; - m_blupiPhase = 0; - m_blupiFocus = false; - } - } - m_blupiMotorHigh = flag4; - if (m_blupiAction != 3 && m_blupiAction != 58) - { - if (flag4) - { - m_blupiAction = 2; - } - else - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiVitesseY = 0.0; - } - } - if (EasyMove) - { - if (m_blupiSpeedY <= -1.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -7.0) - { - m_blupiVitesseY -= 0.5; - } - if (m_blupiVitesseY == -0.5) - { - m_blupiVitesseY = -1.0; - } - } - else if (m_blupiSpeedY >= 1.0) - { - if (m_blupiVitesseY < 8.0) - { - m_blupiVitesseY += 0.5; - } - } - else - { - if (m_blupiVitesseY > 1.0) - { - m_blupiVitesseY -= 1.0; - } - if (m_blupiVitesseY < 1.0) - { - m_blupiVitesseY += 1.0; - } - } - tinyPoint3.y += (int)m_blupiVitesseY; - } - else - { - if (m_blupiSpeedY <= -1.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -10.0) - { - m_blupiVitesseY -= 0.5; - } - } - else if (m_blupiSpeedY >= 1.0) - { - if (m_blupiVitesseY < 12.0) - { - m_blupiVitesseY += 0.5; - } - } - else - { - if (m_blupiVitesseY > 1.0) - { - m_blupiVitesseY -= 1.0; - } - if (m_blupiVitesseY < 1.0) - { - m_blupiVitesseY += 1.0; - } - } - tinyPoint3.y += (int)m_blupiVitesseY; - } - if (EasyMove) - { - if (m_blupiSpeedX <= -1.0) - { - int num5 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX > (double)num5) - { - m_blupiVitesseX -= 0.5; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX >= 1.0) - { - int num6 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num6) - { - m_blupiVitesseX += 0.5; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - tinyPoint3.x += (int)m_blupiVitesseX; - } - else - { - if (m_blupiSpeedX <= -1.0) - { - int num7 = (int)(m_blupiSpeedX * 16.0); - if (m_blupiVitesseX > (double)num7) - { - m_blupiVitesseX -= 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX >= 1.0) - { - int num8 = (int)(m_blupiSpeedX * 16.0); - if (m_blupiVitesseX < (double)num8) - { - m_blupiVitesseX += 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - tinyPoint3.x += (int)m_blupiVitesseX; - } - MoveObjectPollution(); - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) - { - ButtonPressed = ButtonGlygh.None; - rect.left = m_blupiPos.x + 20; - rect.right = m_blupiPos.x + 22; - rect.top = m_blupiPos.y + 60 - 2; - rect.bottom = m_blupiPos.y + 60; - flag2 = !DecorDetect(rect); - rect.left = m_blupiPos.x + 60 - 22; - rect.right = m_blupiPos.x + 60 - 20; - rect.top = m_blupiPos.y + 60 - 2; - rect.bottom = m_blupiPos.y + 60; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3) - { - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; - ObjectStart(tinyPoint, 13, 0); - m_blupiHelico = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPosHelico = m_blupiPos; - m_blupiFocus = true; - StopSound(16); - StopSound(18); - PlaySound(17, m_blupiPos); - } - } - } - if (m_blupiOver && (m_blupiFocus || m_blupiAction == 58)) - { - m_blupiMotorHigh = flag4; - if (m_blupiAction != 3) - { - if (flag4) - { - m_blupiAction = 2; - } - else - { - if (m_blupiAction != 1) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - m_blupiVitesseY = 0.0; - } - } - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60 + OVERHEIGHT - 1; - bool flag7 = !DecorDetect(rect); - num = MoveAscenseurDetect(m_blupiPos, OVERHEIGHT); - if (num != -1) - { - flag7 = false; - } - if ((m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) && !flag7) - { - if (m_blupiVitesseY == 0.0 && num != -1) - { - m_blupiVitesseY = -5.0; - } - else if (m_blupiVitesseY > -5.0) - { - m_blupiVitesseY -= 1.0; - } - } - else if (m_blupiSpeedY > 0.0) - { - if (m_blupiVitesseY < 12.0) - { - m_blupiVitesseY += 5.0; - } - } - else if (m_blupiVitesseY < 12.0 && m_time % 2 == 0) - { - m_blupiVitesseY += 1.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - if (m_blupiSpeedX < 0.0 && flag4) - { - int num9 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX > (double)num9) - { - m_blupiVitesseX -= 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX > 0.0 && flag4) - { - int num10 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num10) - { - m_blupiVitesseX += 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 1.0; - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 1.0; - } - } - tinyPoint3.x += (int)m_blupiVitesseX; - MoveObjectPollution(); - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) - { - ButtonPressed = Def.ButtonGlygh.None; - rect.left = m_blupiPos.x + 20; - rect.right = m_blupiPos.x + 22; - rect.top = m_blupiPos.y + 60 - 2; - rect.bottom = m_blupiPos.y + 60; - flag2 = !DecorDetect(rect); - rect.left = m_blupiPos.x + 60 - 22; - rect.right = m_blupiPos.x + 60 - 20; - rect.top = m_blupiPos.y + 60 - 2; - rect.bottom = m_blupiPos.y + 60; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3) - { - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; - ObjectStart(tinyPoint, 46, 0); - m_blupiOver = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPosHelico = m_blupiPos; - m_blupiFocus = true; - StopSound(16); - StopSound(18); - PlaySound(17, m_blupiPos); - } - } - } - if (m_blupiBalloon && m_blupiFocus) - { - if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -5.0 && m_time % 6 == 0) - { - m_blupiVitesseY -= 1.0; - } - } - else if (m_blupiSpeedY > 0.0) - { - if (m_blupiVitesseY < 0.0 && m_time % 6 == 0) - { - m_blupiVitesseY += 1.0; - } - } - else if (m_blupiVitesseY > -3.0 && m_time % 6 == 0) - { - m_blupiVitesseY -= 1.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - if (m_blupiSpeedX < 0.0) - { - int num11 = (int)(m_blupiSpeedX * 10.0); - if (m_blupiVitesseX > (double)num11) - { - m_blupiVitesseX -= 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num12 = (int)(m_blupiSpeedX * 10.0); - if (m_blupiVitesseX < (double)num12) - { - m_blupiVitesseX += 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - tinyPoint3.x += (int)m_blupiVitesseX; - } - if (m_blupiEcrase && m_blupiFocus) - { - if (flag4) - { - if (m_blupiVitesseY < 2.0) - { - m_blupiVitesseY += 1.0; - } - } - else - { - m_blupiVitesseY = 0.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - if (flag4) - { - num3 = 7; - } - else - { - num3 = 4; - } - num3 = (int)((double)num3 * m_blupiSpeedX); - if (m_blupiSpeedX < 0.0) - { - if (m_blupiVitesseX > (double)num3) - { - m_blupiVitesseX -= 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - if (m_blupiVitesseX < (double)num3) - { - m_blupiVitesseX += 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - if (m_blupiVitesseX == 0.0 && !flag4) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - tinyPoint3.x += (int)m_blupiVitesseX; - } - if (m_blupiJeep && m_blupiFocus) - { - if (m_blupiVitesseX == 0.0 && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - m_blupiMotorHigh = (m_blupiAction != 1); - rect = BlupiRect(tinyPoint3); - rect.right -= 40; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60 - 1; - bool flag8 = !DecorDetect(rect); - rect.left += 40; - rect.right += 40; - bool flag9 = !DecorDetect(rect); - if (flag4) - { - if (m_blupiVitesseY < 50.0) - { - m_blupiVitesseY += 5.0; - } - } - else - { - if (m_blupiVitesseY != 0.0) - { - PlaySound(3, m_blupiPos); - } - m_blupiVitesseY = 0.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - if (m_blupiTransport == -1) - { - rect.left = tinyPoint3.x + 20; - rect.right = tinyPoint3.x + 60 - 20; - rect.top = tinyPoint3.y + 60 - 35; - rect.bottom = tinyPoint3.y + 60 - 1; - num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) - { - m_blupiTransport = num; - flag4 = false; - PlaySound(3, tinyPoint3); - tinyPoint3.y = m_moveObject[num]->posCurrent.y - 64 + BLUPIOFFY; - } - } - if (flag8 && !flag9) - { - int num13 = -20; - if (m_blupiVitesseX > (double)num13) - { - m_blupiVitesseX -= 1.0; - } - } - else if (!flag8 && flag9) - { - int num14 = 20; - if (m_blupiVitesseX < (double)num14) - { - m_blupiVitesseX += 1.0; - } - } - else if (m_blupiSpeedX < 0.0) - { - int num15 = (int)(m_blupiSpeedX * 20.0); - if (m_blupiVitesseX > (double)num15) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num16 = (int)(m_blupiSpeedX * 20.0); - if (m_blupiVitesseX < (double)num16) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - if (m_blupiAction == 3) - { - m_blupiVitesseX = 0.0; - } - tinyPoint3.x += (int)m_blupiVitesseX; - if (flag8 && !flag9) - { - m_blupiRealRotation = Approch(m_blupiRealRotation, -45, 5); - } - else if (!flag8 && flag9) - { - m_blupiRealRotation = Approch(m_blupiRealRotation, 45, 5); - } - else if (!flag4) - { - m_blupiRealRotation = 0; - } - m_blupiOffsetY = abs(m_blupiRealRotation / 2); - MoveObjectPollution(); - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) - { - ButtonPressed = ButtonGlygh.None; - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; - ObjectStart(tinyPoint, 19, 0); - m_blupiJeep = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPosHelico = m_blupiPos; - StopSound(29); - StopSound(31); - PlaySound(30, m_blupiPos); - } - } - if (m_blupiTank && m_blupiFocus) - { - if (m_blupiAction == 53 && m_blupiPhase == 6) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if ((m_keyPress & 2) != 0 && m_blupiTimeFire == 0 && m_blupiAction != 3) - { - if (m_blupiBullet == 0) - { - PlaySound(53, m_blupiPos); - } - else - { - if (m_blupiDir == 1) - { - tinyPoint.x = m_blupiPos.x - 35; - tinyPoint.y = m_blupiPos.y; - num4 = -5; - m_blupiVitesseX += 12.0; - } - else - { - tinyPoint.x = m_blupiPos.x + 35; - tinyPoint.y = m_blupiPos.y; - num4 = 5; - m_blupiVitesseX -= 12.0; - } - if (ObjectStart(tinyPoint, 23, num4) != -1) - { - m_blupiAction = 53; - m_blupiPhase = 0; - PlaySound(52, m_blupiPos); - m_blupiTimeFire = 10; - m_blupiBullet--; - } - } - } - if (m_blupiVitesseX == 0.0 && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - m_blupiMotorHigh = (m_blupiAction != 1); - if (flag4) - { - if (m_blupiVitesseY < 50.0) - { - m_blupiVitesseY += 5.0; - } - } - else - { - if (m_blupiVitesseY != 0.0) - { - PlaySound(3, m_blupiPos); - } - m_blupiVitesseY = 0.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - if (m_blupiTransport == -1) - { - rect.left = tinyPoint3.x + 20; - rect.right = tinyPoint3.x + 60 - 20; - rect.top = tinyPoint3.y + 60 - 35; - rect.bottom = tinyPoint3.y + 60 - 1; - num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) - { - m_blupiTransport = num; - flag4 = false; - PlaySound(3, tinyPoint3); - tinyPoint3.y = m_moveObject[num]->posCurrent.y - 64 + BLUPIOFFY; - } - } - if (m_blupiSpeedX < 0.0) - { - int num17 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX > (double)num17) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num18 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num18) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 3.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 3.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - if (m_blupiAction == 3) - { - m_blupiVitesseX = 0.0; - } - tinyPoint3.x += (int)m_blupiVitesseX; - MoveObjectPollution(); - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) - { - ButtonPressed = ButtonGlygh.None; - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y; - ObjectStart(tinyPoint, 28, 0); - m_blupiTank = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPosHelico = m_blupiPos; - StopSound(29); - StopSound(31); - PlaySound(30, m_blupiPos); - } - } - if (m_blupiSkate && m_blupiFocus) - { - if (m_blupiVitesseX == 0.0 && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX < 0.0) - { - int num19 = (int)(m_blupiSpeedX * 15.0); - if (m_blupiVitesseX > (double)num19) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num20 = (int)(m_blupiSpeedX * 15.0); - if (m_blupiVitesseX < (double)num20) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 1.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 1.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - if (m_blupiAction == 3) - { - m_blupiVitesseX = 0.0; - } - tinyPoint3.x += (int)m_blupiVitesseX; - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesseX < 8.0) - { - ButtonPressed = Def.ButtonGlygh.None; - m_blupiSkate = false; - m_blupiAction = 43; - m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiPosHelico = m_blupiPos; - } - } - if (m_blupiAction == 42) - { - if (m_blupiPhase == 8) - { - num = MoveObjectDetect(m_blupiPos, flag6); - if (num != -1) - { - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - } - } - if (m_blupiPhase == 20) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 43) - { - if (m_blupiPhase == 12) - { - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - BLUPIFLOOR + 1; - ObjectStart(tinyPoint, 24, 0); - } - if (m_blupiPhase == 20) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiNage && m_blupiFocus) - { - if (m_blupiTransport == -1) - { - if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -5.0) - { - m_blupiVitesseY -= 1.0; - } - } - else if (m_blupiSpeedY > 0.0) - { - if (m_blupiVitesseY < 5.0) - { - m_blupiVitesseY += 1.0; - } - } - else - { - if (m_blupiAction == 1) - { - num3 = -1; - } - else - { - num3 = 0; - } - if (m_blupiVitesseY > (double)num3) - { - m_blupiVitesseY -= 1.0; - } - if (m_blupiVitesseY < (double)num3) - { - m_blupiVitesseY += 1.0; - } - } - tinyPoint3.y += (int)m_blupiVitesseY; - } - if (m_blupiSpeedX < 0.0) - { - int num21 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX > (double)num21) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num22 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX < (double)num22) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - num = table_vitesse_nage[m_blupiPhase % 14 / 2]; - tinyPoint3.x += (int)(m_blupiVitesseX * (double)num / 7.0); - if (m_time % 70 == 0 || m_time % 70 == 28) - { - MoveObjectBlup(tinyPoint3); - } - if (m_time % 5 == 0) - { - if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiLevel--; - } - if (m_blupiLevel == 25) - { - m_jauges[0].SetMode(1); - } - m_jauges[0].SetLevel(m_blupiLevel); - if (m_blupiLevel == 0) - { - m_blupiAction = 24; - m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiHelico = false; - m_blupiOver = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - m_blupiNage = false; - m_blupiSurf = false; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiShield = false; - m_blupiPower = false; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiInvert = false; - m_blupiBalloon = false; - m_blupiEcrase = false; - m_blupiAir = false; - m_blupiRestart = true; - m_blupiActionOuf = 0; - m_jauges[0].SetHide(true); - m_jauges[1].SetHide(true); - PlaySound(26, tinyPoint3); - } - } - } - if (m_blupiSurf && m_blupiFocus) - { - if (m_blupiTransport == -1) - { - if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -5.0) - { - m_blupiVitesseY -= 1.0; - } - } - else if (m_blupiSpeedY > 0.0) - { - if (m_blupiVitesseY < 5.0) - { - m_blupiVitesseY += 1.0; - } - } - else - { - if (m_blupiVitesseY > -2.0) - { - m_blupiVitesseY -= 1.0; - } - if (m_blupiVitesseY < -2.0) - { - m_blupiVitesseY += 1.0; - } - } - tinyPoint3.y += (int)m_blupiVitesseY; - tinyPoint3.y += BLUPISURF; - if (tinyPoint3.y % 64 > 30) - { - tinyPoint3.y += 64 - tinyPoint3.y % 64; - } - tinyPoint3.y -= BLUPISURF; - } - if (m_blupiSpeedX < 0.0) - { - int num23 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX > (double)num23) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num24 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX < (double)num24) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - num = table_vitesse_surf[m_blupiPhase % 12 / 2]; - tinyPoint3.x += (int)(m_blupiVitesseX * (double)num / 10.0); - } - POINT tinyPoint4; - if (m_blupiSuspend && m_blupiFocus) - { - if (m_blupiSpeedX < 0.0 && m_blupiAction == 2) - { - int num25 = (int)(m_blupiSpeedX * 5.0); - tinyPoint3.x += num25; - } - if (m_blupiSpeedX > 0.0 && m_blupiAction == 2) - { - int num26 = (int)(m_blupiSpeedX * 5.0); - tinyPoint3.x += num26; - } - num = GetTypeBarre(tinyPoint3); - if (num == 2) - { - tinyPoint4.x = tinyPoint3.x; - tinyPoint4.y = tinyPoint3.y / 64 * 64 + BLUPIOFFY; - rect = BlupiRect(tinyPoint4); - if (!DecorDetect(rect, true)) - { - m_blupiSuspend = false; - m_blupiAction = 1; - m_blupiPhase = 0; - tinyPoint3 = tinyPoint4; - m_blupiPos = tinyPoint3; - } - } - if ((m_blupiSpeedY > 0.0 && m_blupiPhase > 5) || num == 0) - { - m_blupiSuspend = false; - m_blupiAir = true; - m_blupiAction = 5; - tinyPoint3.y = tinyPoint3.y; - m_blupiVitesseY = 0.0; - m_blupiNoBarre = 5; - m_blupiActionOuf = 65; - m_blupiTimeOuf = 0; - } - if (((m_keyPress & 1) != 0 || m_blupiSpeedY < 0.0) && m_blupiAction != 4 && m_blupiAction != 3) - { - m_blupiAction = 4; - m_blupiPhase = 0; - } - if ((m_keyPress & 1) == 0 && m_blupiSpeedY == 0.0 && m_blupiAction == 4) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 4 && m_blupiPhase == 10) - { - m_blupiSuspend = false; - m_blupiAir = true; - m_blupiAction = 5; - m_blupiPhase = 0; - tinyPoint3.y -= 2; - m_blupiVitesseY = -11.0; - m_blupiNoBarre = 5; - PlaySound(35, tinyPoint3); - } - } - if (ButtonPressed == ButtonGlygh.PlayAction && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiTank && !m_blupiJeep && !m_blupiSkate && !flag4 && m_blupiTransport == -1 && m_blupiFocus) - { - if (m_blupiDynamite > 0) - { - ButtonPressed = Def.ButtonGlygh.None; - rect.left = tinyPoint3.x + 18; - rect.right = tinyPoint3.x + 20; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag2 = !DecorDetect(rect); - rect.left = tinyPoint3.x + 60 - 20; - rect.right = tinyPoint3.x + 60 - 18; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3 && ObjectStart(tinyPoint3, 56, 0) != -1) - { - m_blupiAction = 87; - m_blupiPhase = 0; - m_blupiFocus = false; - PlaySound(61, tinyPoint3); - m_blupiDynamite--; - } - } - else if (m_blupiPerso > 0) - { - ButtonPressed = ButtonGlygh.None; - num = MoveObjectDetect(tinyPoint3, flag6); - if (num == -1 || m_moveObject[num]->type != 200) - { - rect.left = tinyPoint3.x + 18; - rect.right = tinyPoint3.x + 20; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag2 = !DecorDetect(rect); - rect.left = tinyPoint3.x + 60 - 20; - rect.right = tinyPoint3.x + 60 - 18; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag3 = !DecorDetect(rect); - num = MoveChargeDetect(tinyPoint3); - if (num == -1 && !flag2 && !flag3 && ObjectStart(tinyPoint3, 200, 0) != -1) - { - m_blupiAction = 46; - m_blupiPhase = 0; - m_blupiFocus = false; - PlaySound(61, tinyPoint3); - m_blupiPerso--; - } - } - if (m_blupiFocus) - { - m_blupiAction = 47; - m_blupiPhase = 0; - PlaySound(27, tinyPoint3); - } - } - } - rect = BlupiRect(m_blupiPos); - tinyPoint4 = tinyPoint3; - TestPath(rect, m_blupiPos, tinyPoint3); - if (flag && m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) - { - tinyPoint3.y = tinyPoint4.y; - TestPath(rect, m_blupiPos, tinyPoint3); - } - if (m_blupiVent && m_blupiPos.y == tinyPoint3.y && m_blupiPos.y != tinyPoint4.y) - { - tinyPoint3.x = tinyPoint4.x; - TestPath(rect, m_blupiPos, tinyPoint3); - } - if (m_blupiTransport != -1 && m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) - { - tinyPoint3.y = tinyPoint4.y; - TestPath(rect, m_blupiPos, tinyPoint3); - } - if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate || m_blupiNage) - { - if (m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) - { - tinyPoint3.y = tinyPoint4.y; - TestPath(rect, m_blupiPos, tinyPoint3); - } - else if (m_blupiPos.y == tinyPoint3.y && m_blupiPos.y != tinyPoint4.y) - { - tinyPoint3.x = tinyPoint4.x; - TestPath(rect, m_blupiPos, tinyPoint3); - } - } - POINT blupiPos = m_blupiPos; - m_blupiPos = tinyPoint3; - if ((m_blupiAction == 1 || m_blupiAction == 60 || m_blupiAction == 7 || m_blupiAction == 6) && !m_blupiAir && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiTransport != -1) - { - AscenseurVertigo(m_blupiTransport, flag2, flag3); - } - else - { - rect.left = tinyPoint3.x + 24; - rect.right = tinyPoint3.x + 26; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag2 = !DecorDetect(rect); - rect.left = tinyPoint3.x + 60 - 26; - rect.right = tinyPoint3.x + 60 - 24; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag3 = !DecorDetect(rect); - } - if (m_blupiDir == 1 && flag2 && !flag3) - { - if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport)) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - else - { - PlaySound(6, tinyPoint3); - m_blupiAction = 8; - m_blupiPhase = 0; - } - } - if (m_blupiDir == 2 && !flag2 && flag3) - { - if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport)) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - else - { - PlaySound(6, tinyPoint3); - m_blupiAction = 8; - m_blupiPhase = 0; - } - } - if (m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && (flag2 || flag3)) - { - if (!m_blupiHelico && !m_blupiOver) - { - PlaySound(6, tinyPoint3); - } - m_blupiAction = 10; - m_blupiPhase = 0; - } - } - if (m_blupiAction == 1 && m_blupiJeep && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiTransport != -1) - { - AscenseurVertigo(m_blupiTransport, flag2, flag3); - } - else - { - rect.left = tinyPoint3.x + 2; - rect.right = tinyPoint3.x + 18; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag2 = !DecorDetect(rect); - rect.left = tinyPoint3.x + 60 - 18; - rect.right = tinyPoint3.x + 60 - 2; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag3 = !DecorDetect(rect); - } - if (flag2 && !flag3) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - if (flag3 && !flag2) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - } - if (m_blupiAction == 1 && m_blupiTank && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiTransport != -1) - { - AscenseurVertigo(m_blupiTransport, flag2, flag3); - } - else - { - rect.left = tinyPoint3.x + 2; - rect.right = tinyPoint3.x + 18; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag2 = !DecorDetect(rect); - rect.left = tinyPoint3.x + 60 - 18; - rect.right = tinyPoint3.x + 60 - 2; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag3 = !DecorDetect(rect); - } - if (flag2 && !flag3) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - if (flag3 && !flag2) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - } - if (m_blupiAction == 1 && m_blupiSkate && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiTransport != -1) - { - AscenseurVertigo(m_blupiTransport, flag2, flag3); - } - else - { - rect.left = tinyPoint3.x + 12; - rect.right = tinyPoint3.x + 19; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag2 = !DecorDetect(rect); - rect.left = tinyPoint3.x + 60 - 19; - rect.right = tinyPoint3.x + 60 - 12; - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60; - flag3 = !DecorDetect(rect); - } - if (flag2 && !flag3) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - if (flag3 && !flag2) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - } - if (m_blupiFocus) - { - if (m_blupiAction == 8 && m_blupiPhase == 16) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - if (m_blupiAction == 9 && m_blupiPhase == 3) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiActionOuf = 0; - } - num3 = 5; - if (m_blupiJeep) - { - num3 = 10; - } - if (m_blupiTank) - { - num3 = 10; - } - if (m_blupiSkate) - { - num3 = 10; - } - if (m_blupiAction == 10 && m_blupiPhase == num3) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - BlupiSearchIcon(); - if (m_blupiShield) - { - if (m_blupiTimeShield == 10) - { - PlaySound(43, m_blupiPos); - } - if (m_blupiTimeShield == 0) - { - m_blupiShield = false; - m_jauges[1].SetHide(true); - } - else if (m_time % 5 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiPower) - { - if (m_blupiTimeShield == 20) - { - PlaySound(45, m_blupiPos); - } - if (m_blupiTimeShield == 0) - { - m_blupiPower = false; - m_jauges[1].SetHide(true); - } - else if (m_time % 3 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiCloud) - { - if (m_blupiTimeShield == 25) - { - PlaySound(56, m_blupiPos); - } - if (m_blupiTimeShield == 0) - { - m_blupiCloud = false; - m_jauges[1].SetHide(true); - } - else if (m_time % 4 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiHide) - { - if (m_blupiTimeShield == 20) - { - PlaySound(63, m_blupiPos); - } - if (m_blupiTimeShield == 0) - { - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - else if (m_time % 4 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiInvert) - { - if (m_blupiTimeShield == 0) - { - m_blupiInvert = false; - m_jauges[1].SetHide(true); - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y + 100; - ObjectStart(tinyPoint, 42, -60); - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - 100; - ObjectStart(tinyPoint, 42, 60); - tinyPoint.x = m_blupiPos.x - 100; - tinyPoint.y = m_blupiPos.y; - ObjectStart(tinyPoint, 42, 10); - tinyPoint.x = m_blupiPos.x + 100; - tinyPoint.y = m_blupiPos.y; - ObjectStart(tinyPoint, 42, -10); - PlaySound(67, tinyPoint3); - } - else if (m_time % 3 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiBalloon) - { - if (m_blupiTimeShield == 0) - { - m_blupiBalloon = false; - m_jauges[1].SetHide(true); - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 91, 0); - PlaySound(41, m_blupiPos); - } - else if (m_time % 2 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiEcrase) - { - if (m_blupiTimeShield == 0) - { - m_blupiEcrase = false; - m_blupiAir = true; - m_jauges[1].SetHide(true); - ObjectStart(m_blupiPos, 41, -60); - ObjectStart(m_blupiPos, 41, 60); - ObjectStart(m_blupiPos, 41, 10); - ObjectStart(m_blupiPos, 41, -10); - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 90, 0); - PlaySound(41, m_blupiPos); - } - else if (m_time % 2 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiPower && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40) - { - num = MoveObjectFree(); - if (num != -1) - { - m_moveObject[num]->type = 27; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = m_blupiPos; - m_moveObject[num]->posStart = m_moveObject[num]->posCurrent; - m_moveObject[num]->posEnd = m_moveObject[num]->posCurrent; - m_moveObject[num]->step = 1; - m_moveObject[num]->time = 0; - MoveObjectStepIcon(num); - m_blupiPosMagic = m_blupiPos; - } - } - if (m_blupiShield && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40) - { - num = MoveObjectFree(); - if (num != -1) - { - m_moveObject[num]->type = 57; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = m_blupiPos; - m_moveObject[num]->posStart = m_moveObject[num]->posCurrent; - m_moveObject[num]->posEnd = m_moveObject[num]->posCurrent; - m_moveObject[num]->step = 1; - m_moveObject[num]->time = 0; - MoveObjectStepIcon(num); - m_blupiPosMagic = m_blupiPos; - } - } - if (m_blupiHide && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 10) - { - num = MoveObjectFree(); - if (num != -1) - { - m_moveObject[num]->type = 58; - m_moveObject[num]->icon = m_blupiIcon; - m_moveObject[num]->channel = 2; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = m_blupiPos; - m_moveObject[num]->posStart = m_moveObject[num]->posCurrent; - m_moveObject[num]->posEnd = m_moveObject[num]->posCurrent; - m_moveObject[num]->step = 1; - m_moveObject[num]->time = 0; - MoveObjectStepIcon(num); - m_blupiPosMagic = m_blupiPos; - } - } - if (m_blupiTimeNoAsc > 0) - { - m_blupiTimeNoAsc--; - } - if (m_blupiHelico && m_blupiPos.y > 2 && m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 4; - rect.bottom = tinyPoint3.y + 20; - if (DecorDetect(rect)) - { - ByeByeHelico(); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiHelico = false; - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(10, m_blupiPos); - } - } - if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - if (!m_blupiNage && !m_blupiSurf && IsSurfWater(m_blupiPos)) - { - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAir = false; - m_blupiNage = false; - m_blupiSurf = true; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - MoveObjectPlouf(m_blupiPos); - if (m_blupiTransport != -1) - { - m_blupiPos.y = m_blupiPos.y - 10; - m_blupiTransport = -1; - } - if (m_blupiCloud) - { - m_blupiCloud = false; - m_jauges[1].SetHide(true); - } - } - if (!m_blupiNage && !IsSurfWater(m_blupiPos) && IsDeepWater(m_blupiPos)) - { - if (!m_blupiSurf) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - MoveObjectPlouf(m_blupiPos); - } - m_blupiAir = false; - m_blupiSurf = false; - m_blupiNage = true; - m_blupiLevel = 100; - m_jauges[0].SetLevel(m_blupiLevel); - m_jauges[0].SetMode(2); - m_jauges[0].SetHide(false); - } - if (m_blupiNage && IsSurfWater(m_blupiPos)) - { - m_blupiAir = false; - m_blupiNage = false; - m_blupiSurf = true; - PlaySound(25, m_blupiPos); - m_jauges[0].SetHide(true); - } - tinyPoint4.x = m_blupiPos.x; - tinyPoint4.y = m_blupiPos.y - 60; - if ((m_blupiSurf || m_blupiNage) && (m_blupiPos.y % 64 == 64 - BLUPISURF || m_blupiPos.y % 64 == 32) && IsOutWater(tinyPoint4) && (m_keyPress & 1) != 0) - { - m_blupiNage = false; - m_blupiSurf = false; - m_blupiAir = true; - m_blupiAction = 5; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - if (m_blupiPower) - { - m_blupiVitesseY = -16.0; - } - else - { - m_blupiVitesseY = -12.0; - } - MoveObjectTiplouf(m_blupiPos); - PlaySound(22, m_blupiPos); - m_jauges[0].SetHide(true); - } - if ((m_blupiSurf || m_blupiNage) && IsOutWater(m_blupiPos)) - { - if (m_blupiVitesseY < 0.0) - { - if (m_blupiTransport == -1) - { - m_blupiPos = blupiPos; - } - else - { - m_blupiTransport = -1; - m_blupiNage = false; - m_blupiSurf = false; - m_blupiAir = true; - m_blupiAction = 5; - m_blupiPhase = 0; - m_blupiPos.y = m_blupiPos.y - 10; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = -10.0; - PlaySound(22, m_blupiPos); - m_jauges[0].SetHide(true); - } - } - else if (m_blupiVitesseY > 0.0) - { - m_blupiNage = false; - m_blupiSurf = false; - m_blupiAir = false; - m_blupiAction = 5; - m_blupiPhase = 0; - m_blupiPos.y = m_blupiPos.y + 30; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - PlaySound(22, m_blupiPos); - m_jauges[0].SetHide(true); - } - else - { - m_blupiNage = false; - m_blupiSurf = false; - m_blupiAir = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPos.y = m_blupiPos.y - 10; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - PlaySound(22, m_blupiPos); - m_jauges[0].SetHide(true); - } - } - if ((m_blupiSurf || m_blupiNage) && m_blupiActionOuf != 44) - { - m_blupiActionOuf = 44; - m_blupiTimeOuf = 0; - } - } - if ((m_blupiHelico || m_blupiOver || m_blupiJeep || m_blupiTank || m_blupiSkate) && m_blupiFocus && (IsSurfWater(m_blupiPos) || IsDeepWater(m_blupiPos))) - { - ByeByeHelico(); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiHelico = false; - m_blupiOver = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(10, m_blupiPos); - } - if (m_blupiFocus && !m_blupiSuspend && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiNoBarre == 0 && GetTypeBarre(m_blupiPos) == 1) - { - tinyPoint4.x = m_blupiPos.x; - tinyPoint4.y = (m_blupiPos.y + 22) / 64 * 64 + BLUPISUSPEND; - rect = BlupiRect(tinyPoint4); - if (!DecorDetect(rect, true)) - { - m_blupiPos = tinyPoint4; - m_blupiSuspend = true; - m_blupiAir = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiActionOuf = 0; - PlaySound(34, m_blupiPos); - } - } - if (m_blupiNoBarre > 0) - { - m_blupiNoBarre--; - } - if (IsVentillo(m_blupiPos)) - { - if (m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - BlupiDead(11, 75); - } - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 11, 0); - m_decorAction = 2; - m_decorPhase = 0; - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(10, m_blupiPos); - } - if (m_blupiAction != 30 && m_blupiFocus) - { - num = IsWorld(m_blupiPos); - if (num != -1) - { - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(32, m_blupiPos); - m_blupiAction = 30; - m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiFront = true; - } - } - int num27 = MoveObjectDetect(m_blupiPos, flag6); - POINT tinyPoint5; - if (m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81) - { - if (IsLave(m_blupiPos) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - BlupiDead(76, -1); - m_blupiRestart = true; - m_blupiPos.y = m_blupiPos.y / 64 * 64 + BLUPIOFFY; - PlaySound(8, m_blupiPos); - } - if (IsPiege(m_blupiPos) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) - { - BlupiDead(54, -1); - m_blupiRestart = true; - m_blupiAir = true; - ObjectStart(m_blupiPos, 53, 0); - PlaySound(51, m_blupiPos); - } - if (IsGoutte(m_blupiPos, false) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) - { - BlupiDead(54, -1); - m_blupiRestart = true; - m_blupiAir = true; - PlaySound(51, m_blupiPos); - } - if (IsScie(m_blupiPos) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) - { - BlupiDead(77, -1); - m_blupiFront = true; - m_blupiRestart = true; - m_blupiAir = true; - } - if (ButtonPressed == ButtonGlygh.PlayAction && (num27 == -1 || !flag6) && IsSwitch(m_blupiPos, tinyPoint) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ActiveSwitch(m_decor[tinyPoint.x, tinyPoint.y]->icon == 385, tinyPoint); - m_blupiAction = 82; - m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - } - if (IsBlitz(m_blupiPos, false) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - BlupiDead(11, -1); - m_blupiRestart = true; - m_blupiAir = true; - m_blupiPos.y = m_blupiPos.y / 64 * 64 + BLUPIOFFY; - PlaySound(8, m_blupiPos); - } - if (IsEcraseur(m_blupiPos) && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - m_blupiEcrase = true; - m_blupiBalloon = false; - m_blupiAir = false; - m_blupiHelico = false; - m_blupiOver = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - m_blupiNage = false; - m_blupiSurf = false; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiShield = false; - m_blupiPower = false; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - if (!m_blupiJeep && !m_blupiTank) - { - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - } - PlaySound(70, m_blupiPos); - ObjectStart(m_blupiPos, 41, -60); - ObjectStart(m_blupiPos, 41, 60); - ObjectStart(m_blupiPos, 41, 10); - ObjectStart(m_blupiPos, 41, -10); - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 90, 0); - m_decorAction = 2; - m_decorPhase = 0; - } - if (IsTeleporte(m_blupiPos) != -1 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiAir && m_blupiFocus && m_blupiPosHelico.x == -1) - { - m_blupiAction = 74; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - m_blupiFocus = false; - m_blupiPos.x = m_blupiPos.x / 64 * 64; - PlaySound(71, m_blupiPos); - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - 5; - ObjectStart(tinyPoint, 92, 0); - } - if (IsBridge(m_blupiPos, tinyPoint2) && m_blupiFocus) - { - tinyPoint2.x *= 64; - tinyPoint2.y *= 64; - ObjectStart(tinyPoint2, 52, 0); - } - int num2 = IsDoor(m_blupiPos, tinyPoint2); - if (num2 != -1 && (m_blupiCle & 1 << num2 - 334) != 0) - { - OpenDoor(tinyPoint2); - m_blupiCle &= ~(1 << num2 - 334); - tinyPoint.x = 520; - tinyPoint.y = 418; - tinyPoint5.x = tinyPoint2.x * 64 - m_posDecor.x; - tinyPoint5.y = tinyPoint2.y * 64 - m_posDecor.y; - VoyageInit(tinyPoint, m_pPixmap->MouseHotSpot(tinyPoint5), 214 + (num2 - 334) * 7, 10); - } - } - if (!m_blupiHelico && !m_blupiSuspend && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiSkate && !m_blupiJeep && !m_blupiTank && !m_blupiJeep && m_blupiFocus) - { - num = MockeryDetect(m_blupiPos); - if (num != 0) - { - m_blupiActionOuf = num; - m_blupiTimeOuf = 0; - } - } - MoveObjectFollow(m_blupiPos); - num = num27; - if (num != -1 && !flag6 && m_moveObject[num]->type == 2 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiShield && !m_bSuperBlupi && m_blupiFocus) - { - m_blupiActionOuf = 48; - m_blupiTimeOuf = 0; - } - if (num != -1 && flag6) - { - if (m_moveObject[num]->type == 13 && (ButtonPressed == ButtonGlygh.PlayAction || IsFloatingObject(num)) && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAir = false; - m_blupiHelico = true; - m_blupiRealRotation = 0; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if (ButtonPressed == ButtonGlygh.PlayAction && m_moveObject[num]->type == 46 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAir = false; - m_blupiOver = true; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if (ButtonPressed == ButtonGlygh.PlayAction && m_moveObject[num]->type == 19 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiAir = false; - m_blupiJeep = true; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if (ButtonPressed == ButtonGlygh.PlayAction && m_moveObject[num]->type == 28 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiAir = false; - m_blupiTank = true; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if (m_moveObject[num]->type == 29 && m_blupiFocus && m_blupiBullet < 10) - { - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - tinyPoint.x = m_moveObject[num]->posCurrent.x - m_posDecor.x; - tinyPoint.y = m_moveObject[num]->posCurrent.y - m_posDecor.y; - tinyPoint5.x = 570; - tinyPoint5.y = 430; - VoyageInit(m_pPixmap->MouseHotSpot(tinyPoint), tinyPoint5, 177, 10); - m_blupiBullet += 10; - if (m_blupiBullet > 10) - { - m_blupiBullet = 10; - } - } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[num].type == 24 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = Def.ButtonGlygh.None; - m_scrollAdd.X = 0; - m_scrollAdd.Y = 0; - m_blupiAction = 42; - m_blupiPhase = 0; - m_blupiPos.Y = m_moveObject[num].posCurrent.Y / 64 * 64 + Decor.BLUPIOFFY; - m_blupiFocus = false; - m_blupiAir = false; - m_blupiSkate = true; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if ((m_moveObject[num].type == 3 || m_moveObject[num].type == 16 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97) && m_blupiBalloon && m_blupiPosHelico.X == -1) - { - m_blupiBalloon = false; - m_blupiAir = true; - m_blupiTimeShield = 0; - m_jauges[1].SetHide(true); - m_decorAction = 0; - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; - ObjectStart(tinyPoint, 91, 0); - PlaySound(41, m_blupiPos); - m_blupiPos.Y = m_blupiPos.Y + 4; - m_blupiVitesseY = 0.0; - m_blupiPosHelico = m_blupiPos; - } - else if ((m_moveObject[num].type == 2 || m_moveObject[num].type == 3 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97 || m_moveObject[num].type == 16 || m_moveObject[num].type == 4 || m_moveObject[num].type == 17 || m_moveObject[num].type == 20) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPosHelico.X == -1) - { - if (!m_blupiJeep && !m_blupiTank && !m_blupiSkate && (m_blupiFocus || m_blupiAction == 5 || m_blupiAction == 36)) - { - if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase) - { - m_blupiAir = true; - } - BlupiDead(11, 75); - } - if (m_moveObject[num].type == 17 || m_moveObject[num].type == 20) - { - tinyPoint = m_moveObject[num].posCurrent; - ObjectDelete(tinyPoint, m_moveObject[num].type); - tinyPoint.X -= 34; - tinyPoint.Y -= 34; - ObjectStart(tinyPoint, 10, 0); - m_decorAction = 2; - m_decorPhase = 0; - } - else - { - tinyPoint = m_moveObject[num].posCurrent; - ObjectDelete(tinyPoint, m_moveObject[num].type); - tinyPoint.X -= 34; - tinyPoint.Y -= 34; - ObjectStart(tinyPoint, 8, 0); + switch (cheat) + { + case 2: // cleanall + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + mob = &m_moveObject[i]; + switch (mob->type) + { + case TYPE_BOMBEDOWN: + case TYPE_BOMBEUP: + case TYPE_BOMBEFOLLOW1: + case TYPE_BOMBEFOLLOW2: + case TYPE_BULLDOZER: + case TYPE_BOMBEMOVE: + case TYPE_POISSON: + case TYPE_OISEAU: + case TYPE_GUEPE: + case TYPE_CREATURE: + case TYPE_BLUPIHELICO: + case TYPE_BLUPITANK: m_decorAction = 1; m_decorPhase = 0; - } - if (!m_blupiJeep && !m_blupiTank) - { - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - } - PlaySound(10, m_moveObject[num].posCurrent); - } - if (m_moveObject[num].type == 44 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - ByeByeHelico(); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - m_blupiBalloon = true; - m_blupiEcrase = false; - m_blupiAir = false; - m_blupiHelico = false; - m_blupiOver = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - m_blupiNage = false; - m_blupiSurf = false; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiShield = false; - m_blupiPower = false; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - if (!m_blupiJeep && !m_blupiTank) - { - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - } - PlaySound(40, m_moveObject[num].posCurrent); - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; - ObjectStart(tinyPoint, 90, 0); - m_decorAction = 5; - m_decorPhase = 0; - } - if (m_moveObject[num].type == 54 && m_moveObject[num].step != 2 && m_moveObject[num].step != 4 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - ByeByeHelico(); - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = (m_blupiPos.Y + 64 - 10) / 64 * 64 + 4; - ObjectStart(tinyPoint, 53, 0); - m_blupiAction = 54; - m_blupiPhase = 0; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiFocus = false; - m_blupiRestart = true; - if (flag4) - { - m_blupiAir = true; - } - if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate) - { - m_blupiHelico = false; - m_blupiOver = false; - m_blupiBalloon = false; - m_blupiEcrase = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - tinyPoint = m_moveObject[num].posCurrent; - tinyPoint.X -= 34; - tinyPoint.Y -= 34; - ObjectStart(tinyPoint, 10, 0); - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(10, m_moveObject[num].posCurrent); - m_decorAction = 1; - m_decorPhase = 0; - } - else - { - PlaySound(51, m_moveObject[num].posCurrent); - } - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - if (m_moveObject[num].type == 23 && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiAction != 13 && m_blupiAction != 30 && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81 && m_blupiAction != 54 && m_blupiAction != 57 && m_blupiAction != 35) - { - ByeByeHelico(); - tinyPoint = m_moveObject[num].posCurrent; - ObjectDelete(tinyPoint, m_moveObject[num].type); - m_blupiAction = 54; - m_blupiPhase = 0; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiFocus = false; - m_blupiRestart = true; - if (flag4) - { - m_blupiAir = true; - } - if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate) - { - m_blupiHelico = false; - m_blupiOver = false; - m_blupiBalloon = false; - m_blupiEcrase = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - } - StartSploutchGlu(m_moveObject[num].posCurrent); - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - if (m_moveObject[num].type == 5) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - TinyPoint end; - end.X = 430; - end.Y = 430; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), end, 6, 10); - ObjectStart(m_moveObject[num].posCurrent, 39, -60); - ObjectStart(m_moveObject[num].posCurrent, 39, 60); - ObjectStart(m_moveObject[num].posCurrent, 39, 10); - ObjectStart(m_moveObject[num].posCurrent, 39, -10); - } - if (m_moveObject[num].type == 49 && (m_voyageIcon != 215 || m_voyageChannel != 10) && (m_blupiCle & 1) == 0) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - TinyPoint end2; - end2.X = 520; - end2.Y = 418; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), end2, 215, 10); - ObjectStart(m_moveObject[num].posCurrent, 39, -60); - ObjectStart(m_moveObject[num].posCurrent, 39, 60); - ObjectStart(m_moveObject[num].posCurrent, 39, 10); - ObjectStart(m_moveObject[num].posCurrent, 39, -10); - } - if (m_moveObject[num].type == 50 && (m_voyageIcon != 222 || m_voyageChannel != 10) && (m_blupiCle & 2) == 0) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - TinyPoint end3; - end3.X = 530; - end3.Y = 418; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), end3, 222, 10); - ObjectStart(m_moveObject[num].posCurrent, 39, -60); - ObjectStart(m_moveObject[num].posCurrent, 39, 60); - ObjectStart(m_moveObject[num].posCurrent, 39, 10); - ObjectStart(m_moveObject[num].posCurrent, 39, -10); - } - if (m_moveObject[num].type == 51 && (m_voyageIcon != 229 || m_voyageChannel != 10) && (m_blupiCle & 4) == 0) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - TinyPoint end4; - end4.X = 540; - end4.Y = 418; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), end4, 229, 10); - ObjectStart(m_moveObject[num].posCurrent, 39, -60); - ObjectStart(m_moveObject[num].posCurrent, 39, 60); - ObjectStart(m_moveObject[num].posCurrent, 39, 10); - ObjectStart(m_moveObject[num].posCurrent, 39, -10); - } - if (m_moveObject[num].type == 6 && m_nbVies < 10 && m_blupiFocus) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), VoyageGetPosVie(m_nbVies + 1), 21, 10); - } - if (m_moveObject[num].type == 25 && !m_blupiShield && !m_blupiHide && !m_blupiPower && m_blupiFocus) - { - PlaySound(42, m_moveObject[num].posCurrent); - m_blupiShield = true; - m_blupiPower = false; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[num].type == 26 && !m_blupiShield && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - ButtonPressed = Def.ButtonGlygh.None; - m_sucettePos = m_moveObject[num].posCurrent; - m_sucetteType = m_moveObject[num].type; - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_blupiAction = 49; - m_blupiPhase = 0; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiFocus = false; - PlaySound(50, tinyPoint3); - } - if (m_moveObject[num].type == 40 && !m_blupiHide && m_blupiFocus) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_blupiInvert = true; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - PlaySound(66, tinyPoint3); - ObjectStart(m_blupiPos, 41, -60); - ObjectStart(m_blupiPos, 41, 60); - ObjectStart(m_blupiPos, 41, 10); - ObjectStart(m_blupiPos, 41, -10); - } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[num].type == 30 && !m_blupiShield && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - ButtonPressed = Def.ButtonGlygh.None; - m_sucettePos = m_moveObject[num].posCurrent; - m_sucetteType = m_moveObject[num].type; - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_blupiAction = 55; - m_blupiPhase = 0; - m_blupiShield = false; - m_blupiPower = false; - m_blupiJumpAie = false; - m_blupiFocus = false; - PlaySound(57, tinyPoint3); - } - if (m_moveObject[num].type == 31 && !m_blupiShield && !m_blupiHide && !m_blupiPower && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - m_blupiAction = 56; - m_blupiPhase = 0; - m_blupiShield = false; - m_blupiPower = false; - m_blupiJumpAie = false; - m_blupiFocus = false; - m_blupiCloud = true; - m_blupiTimeShield = 100; - PlaySound(58, tinyPoint3); - if (m_blupiHide) - { - m_blupiHide = false; - m_jauges[1].SetHide(true); + mob->type = TYPE_EXPLO1; + mob->phase = 0; + mob->posCurrent -= { 34, 34 }; + mob->posStart = mob->posCurrent; + mob->posEnd = mob->posCurrent; + MoveObjectStepIcon(i); + PlaySound(SOUND_BOUM, mob->posCurrent, FALSE); } } - if (m_moveObject[num].type >= 200 && m_moveObject[num].type <= 203 && m_blupiFocus) + break; + case 6: // funskate + m_blupiAir = FALSE; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = FALSE; + m_blupiSkate = TRUE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiVent = FALSE; + m_blupiSuspend = FALSE; + StopVehicleSound(); + break; + case 7: // givecopter + m_blupiAir = FALSE; + m_blupiHelico = TRUE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiVent = FALSE; + m_blupiSuspend = FALSE; + StopVehicleSound(); + PlaySound(SOUND_HELICOSTART, m_blupiPos, FALSE); + PlaySound(SOUND_HELICOLOW, m_blupiPos, TRUE); + break; + case 8: // jeepdrive + m_blupiAir = FALSE; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = TRUE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiVent = FALSE; + m_blupiSuspend = FALSE; + StopVehicleSound(); + PlaySound(SOUND_JEEPLOW, m_blupiPos, TRUE); + break; + case 9: // alltreasure + for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[num].type == 200) + if (m_moveObject[i].type == TYPE_TRESOR) { - if (m_blupiPerso < 5 && ButtonPressed == Def.ButtonGlygh.PlayAction) - { - ButtonPressed = Def.ButtonGlygh.None; - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - tinyPoint5.X = 0; - tinyPoint5.Y = 438; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), tinyPoint5, 108, 4); - } - } - else if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - BlupiDead(11, 75); - tinyPoint = m_moveObject[num].posCurrent; - tinyPoint.X -= 34; - tinyPoint.Y -= 34; - ObjectStart(tinyPoint, 10, 0); - PlaySound(10, m_moveObject[num].posCurrent); - m_decorAction = 1; - m_decorPhase = 0; + m_moveObject[i].type = 0; + m_nbTresor++; + OpenDoorsTresor(); + PlaySound(SOUND_TRESOR, m_moveObject[i].posCurrent, FALSE); } } - if (m_moveObject[num].type == 55 && m_blupiFocus && m_blupiDynamite == 0 && (m_voyageIcon != 252 || m_voyageChannel != 10) && ButtonPressed == Def.ButtonGlygh.PlayAction) + break; + case 10: // endgoal + for (int i = 0; i < MAXMOVEOBJECT; i++) { - ButtonPressed = Def.ButtonGlygh.None; - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - tinyPoint5.X = 505; - tinyPoint5.Y = 414; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), tinyPoint5, 252, 10); - m_blupiAction = 86; - m_blupiPhase = 0; - m_blupiFocus = false; - } - if (m_moveObject[num].type == 12 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus && m_blupiAction == 2) - { - tinyPoint3 = m_moveObject[num].posCurrent; - if (m_blupiDir == 1 && m_blupiPos.X > tinyPoint3.X) - { - tinyPoint3.X = m_blupiPos.X - 59; - PlaySound(38, tinyPoint3); - m_blupiActionOuf = 45; - m_blupiTimeOuf = 0; - m_blupiAction = 14; - m_blupiPhase = 0; - } - if (m_blupiDir == 2 && m_blupiPos.X < tinyPoint3.X) - { - tinyPoint3.X = m_blupiPos.X + 55; - PlaySound(38, tinyPoint3); - m_blupiActionOuf = 45; - m_blupiTimeOuf = 0; - m_blupiAction = 14; - m_blupiPhase = 0; - } - if (!TestPushCaisse(num, tinyPoint3, false)) - { - m_blupiPos.X = blupiPos.X; - } - } - if ((m_moveObject[num].type == 7 || m_moveObject[num].type == 21) && m_blupiFocus) - { - if (m_goalPhase == 0) + mob = &m_moveObject[i]; + if (mob->type == TYPE_GOAL || mob->type == TYPE_CLE) { + m_blupiPos = mob->posCurrent; if (m_nbTresor >= m_totalTresor) { - if (m_moveObject[num].type == 21) + if (mob->type == TYPE_CLE) { - m_bFoundCle = true; + m_bFoundCle = TRUE; } - ByeByeHelico(); - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(14, m_moveObject[num].posCurrent); - m_blupiAction = 13; + StopVehicleSound(); + PlaySound(SOUND_ENDOK, mob->posCurrent, FALSE); + m_blupiAction = ACTION_WIN; m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiFront = true; - m_blupiPos.Y = m_moveObject[num].posCurrent.Y; + m_blupiFocus = FALSE; + m_blupiFront = TRUE; + m_blupiAir = FALSE; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = TRUE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiVent = FALSE; + m_blupiSuspend = FALSE; + m_blupiShield = FALSE; + m_blupiPower = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + m_blupiInvert = FALSE; + m_blupiBalloon = FALSE; + m_blupiEcrase = FALSE; } else { - PlaySound(13, m_moveObject[num].posCurrent); + PlaySound(SOUND_ENDKO, mob->posCurrent, FALSE); } m_goalPhase = 50; } - else - { - m_goalPhase--; - } } - else - { - m_goalPhase = 0; - } - } - else - { - m_goalPhase = 0; - } - if (m_blupiAction == 14 && m_blupiFocus) - { - num = CaisseInFront(); - if (num != -1) - { - tinyPoint3 = m_moveObject[num].posCurrent; - if (m_blupiDir == 1) - { - tinyPoint3.X = m_blupiPos.X - 59; - } - else - { - tinyPoint3.X = m_blupiPos.X + 55; - } - if (!TestPushCaisse(num, tinyPoint3, false)) - { - m_blupiPos.X = blupiPos.X; - } - } - else - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - if (m_blupiAction == 29 && m_blupiFocus) - { - num = CaisseInFront(); - if (num != -1) - { - tinyPoint3 = m_moveObject[num].posCurrent; - if (m_blupiDir == 1) - { - tinyPoint3.X = m_blupiPos.X - 59; - } - else - { - tinyPoint3.X = m_blupiPos.X + 55; - } - if (!TestPushCaisse(num, tinyPoint3, true)) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - else - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) - { - if (m_blupiActionOuf == 44 && m_blupiAction == 1) - { - if (m_blupiTimeOuf > 50) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - PlaySound(46, m_blupiPos); - } - m_blupiActionOuf = 0; - } - if (m_blupiActionOuf == 45 && m_blupiAction == 1) - { - if (m_blupiTimeOuf > 50) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - } - m_blupiActionOuf = 0; - } - if (m_blupiAction == 45 && m_blupiPhase == 4) - { - PlaySound(46, m_blupiPos); - } - if (m_blupiActionOuf == 65 && m_blupiAction == 1) - { - if (m_blupiTimeOuf > 10 && m_blupiTimeOuf < 50) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - } - m_blupiActionOuf = 0; - } - if (m_blupiActionOuf == 47 && m_blupiAction == 1) - { - if (m_blupiTimeOuf > 60) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - PlaySound(48, m_blupiPos); - } - m_blupiActionOuf = 0; - } - if (m_blupiActionOuf == 48 && m_blupiAction == 1) - { - if (m_blupiTimeOuf < 10) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - PlaySound(49, m_blupiPos); - } - m_blupiActionOuf = 0; - } - if ((m_blupiActionOuf == 63 || m_blupiActionOuf == 64 || m_blupiActionOuf == 83) && m_blupiAction == 1) - { - if (m_blupiTimeOuf < 20) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - } - m_blupiActionOuf = 0; - } - } - if (m_blupiAction == 2 && m_blupiActionOuf != 63 && m_blupiActionOuf != 64 && m_blupiActionOuf != 83 && !m_blupiSurf && !m_blupiNage) - { - m_blupiActionOuf = 0; - } - if (m_blupiActionOuf != 0) - { - m_blupiTimeOuf++; - } - if (m_blupiTimeMockery > 0) - { - m_blupiTimeMockery--; - } - if (m_blupiAction == 86 && m_blupiPhase == 18) - { - m_blupiAction = 1; + break; + case 12: // roundshield + PlaySound(SOUND_STARTSHIELD, m_blupiPos, FALSE); + m_blupiShield = TRUE; + m_blupiPower = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + m_blupiTimeShield = 100; + m_blupiPosMagic = m_blupiPos; + m_jauges[1].SetHide(FALSE); + break; + case 13: // quicklollipop + m_blupiAction = ACTION_SUCETTE; m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 87 && m_blupiPhase == 26) - { - m_blupiAction = 1; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiShield = FALSE; + m_blupiPower = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + m_blupiFocus = FALSE; + PlaySound(SOUND_SUCETTE, m_blupiPos, FALSE); + break; + case 14: // tenbombs + m_blupiPerso = 10; + PlaySound(SOUND_PERSOTAKE, m_blupiPos, FALSE); + break; + case 15: // birdlime + m_blupiBullet = 10; + break; + case 16: // drivetank + m_blupiAir = FALSE; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = TRUE; + m_blupiSkate = FALSE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiVent = FALSE; + m_blupiSuspend = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + PlaySound(SOUND_JEEPLOW, m_blupiPos, TRUE); + break; + case 17: // powercharge + m_blupiAction = ACTION_CHARGE; m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiPos.X - 30 > m_blupiPosHelico.X || m_blupiPos.X + 30 < m_blupiPosHelico.X || m_blupiPos.Y - 30 > m_blupiPosHelico.Y || m_blupiPos.Y + 30 < m_blupiPosHelico.Y) - { - m_blupiPosHelico.X = -1; - } - if (m_blupiTimeFire > 0) - { - m_blupiTimeFire--; - } - if (m_blupiAction == 74 && m_blupiPhase == 128) - { - TinyPoint blupiPos2 = default(TinyPoint); - if (SearchTeleporte(m_blupiPos, ref blupiPos2)) - { - m_blupiPos = blupiPos2; - ObjectStart(m_blupiPos, 27, 20); - ObjectStart(m_blupiPos, 27, -20); - } - m_blupiFocus = true; - m_blupiPosHelico = m_blupiPos; - } - if (m_blupiAction == 82 && m_blupiPhase == 10) - { - m_blupiAction = 1; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = TRUE; + m_blupiSkate = FALSE; + m_blupiShield = FALSE; + m_blupiPower = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + m_blupiJumpAie = FALSE; + m_blupiFocus = FALSE; + PlaySound(SOUND_CHARGE, m_blupiPos, FALSE); + break; + case 18: // hidedrink + m_blupiAction = ACTION_DRINK; m_blupiPhase = 0; - m_blupiFocus = true; + m_blupiHelico = FALSE; + m_blupiOver = FALSE; + m_blupiJeep = FALSE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiShield = FALSE; + m_blupiPower = FALSE; + m_blupiCloud = FALSE; + m_blupiHide = FALSE; + m_blupiJumpAie = FALSE; + m_blupiFocus = FALSE; + PlaySound(SOUND_DRINK, m_blupiPos, FALSE); + break; + case 22: // iovercraft + m_blupiAir = FALSE; + m_blupiHelico = FALSE; + m_blupiOver = TRUE; + m_blupiJeep = FALSE; + m_blupiTank = FALSE; + m_blupiSkate = FALSE; + m_blupiNage = FALSE; + m_blupiSurf = FALSE; + m_blupiVent = FALSE; + m_blupiSuspend = FALSE; + StopVehicleSound(); + PlaySound(SOUND_HELICOSTART, m_blupiPos, FALSE); + PlaySound(SOUND_HELICOLOW, m_blupiPos, TRUE); + break; + case 23: // udynamite + m_blupiDynamite = 1; + PlaySound(SOUND_PERSOTAKE, m_blupiPos, FALSE); + break; + case 24: // wellkeys + m_blupiCle |= CLE_RED | CLE_GREEN | CLE_BLUE; + break; } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_blupiAction == 1) + if (!m_blupiShield && !m_blupiHide && !m_blupiCloud && !m_blupiPower) { - m_blupiAction = 84; - m_blupiPhase = 0; - PlaySound(27, m_blupiPos); + m_jauges[1].SetHide(TRUE); } - if ((m_blupiAction == 11 && m_blupiPhase == 70) || (m_blupiAction == 75 && m_blupiPhase == 100) || (m_blupiAction == 76 && m_blupiPhase == 70) || (m_blupiAction == 77 && m_blupiPhase == 110) || (m_blupiAction == 78 && m_blupiPhase == 90) || (m_blupiAction == 79 && m_blupiPhase == 90) || (m_blupiAction == 80 && m_blupiPhase == 90) || (m_blupiAction == 81 && m_blupiPhase == 90) || (m_blupiAction == 24 && m_blupiPhase == 90) || (m_blupiAction == 54 && m_blupiPhase == 100) || (m_blupiAction == 57 && m_blupiPhase == 90)) + if (!m_blupiHelico && !m_blupiOver) { - if (m_nbVies > 0) - { - m_blupiAction = 35; - m_blupiIcon = -1; - m_blupiPhase = 0; - if (m_blupiRestart) - { - m_blupiPos = m_blupiValidPos; - } - TinyPoint posDecor = GetPosDecor(m_blupiPos); - tinyPoint.X = m_blupiPos.X - posDecor.X - 30; - tinyPoint.Y = m_blupiPos.Y - posDecor.Y; - VoyageInit(VoyageGetPosVie(m_nbVies), m_pixmap.HotSpotToHud(tinyPoint), 48, 2); - } - else - { - m_nbVies = -1; - m_term = -1; - DoorsLost(); - } - m_blupiFront = false; + StopSound(SOUND_HELICOHIGH); + StopSound(SOUND_HELICOLOW); } - if (m_dimDecor.Y == 0) + if (m_blupiJeep && m_blupiTank) { - num3 = 480; + StopSound(SOUND_JEEPHIGH); + StopSound(SOUND_JEEPLOW); } - else - { - num3 = 6400; - } - if (m_blupiPos.Y >= num3 + 1 && m_blupiPos.Y <= num3 + 40) - { - PlaySound(8, m_blupiPos); - } - if (m_blupiPos.Y > num3 + 1000) - { - m_term = -1; - DoorsLost(); - } - if (m_blupiAction == 13 && m_blupiPhase == 40) - { - if (m_bPrivate) - { - m_term = 1; - } - else if (m_mission == 1) - { - m_term = 199; - } - else if (m_mission == 199) - { - m_term = -2; - } - else if (m_bFoundCle) - { - OpenGoldsWin(); - m_term = 1; - } - else - { - OpenDoorsWin(); - m_term = m_mission / 10 * 10; - } - } - if (m_blupiAction == 30 && m_blupiPhase == 30) - { - num = IsWorld(m_blupiPos); - if (num != -1) - { - if (m_mission == 1) - { - m_term = num * 10; - } - else if (num == 199) - { - m_term = 1; - } - else - { - m_term = m_mission / 10 * 10 + num; - } - } - } - if (blupiAction == 63 && m_blupiAction != 63) - { - StopSound(65); - } - if (blupiAction == 64 && m_blupiAction != 64) - { - StopSound(65); - } - if (blupiAction == 83 && m_blupiAction != 83) - { - StopSound(47); - } - if (m_blupiFocus && !m_blupiAir && (!m_blupiHelico || BlupiIsGround()) && (!m_blupiOver || BlupiIsGround()) && !m_blupiBalloon && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !flag2 && !flag3 && m_blupiTransport == -1 && !IsLave(m_blupiPos) && !IsPiege(m_blupiPos) && !IsGoutte(m_blupiPos, true) && !IsScie(m_blupiPos) && !IsBridge(m_blupiPos, ref tinyPoint) && IsTeleporte(m_blupiPos) == -1 && !IsBlitz(m_blupiPos, true) && !IsTemp(m_blupiPos) && !IsBalleTraj(m_blupiPos) && !IsMoveTraj(m_blupiPos)) - { - if (m_blupiFifoNb > 0) - { - m_blupiValidPos = m_blupiFifoPos[0]; - } - BlupiAddFifo(m_blupiPos); - } - tinyPoint3.X = m_blupiPos.X + 30 + m_scrollAdd.X; - tinyPoint3.Y = m_blupiPos.Y + 30 + m_scrollAdd.Y; - int num28 = Math.Abs(m_scrollPoint.X - tinyPoint3.X); - int num29 = Math.Abs(m_scrollPoint.Y - tinyPoint3.Y); - num4 = Decor.SCROLL_SPEED; - if (num28 > Decor.SCROLL_MARGX * 2) - { - num4 += (num28 - Decor.SCROLL_MARGX * 2) / 4; - } - if (num29 > Decor.SCROLL_MARGY * 2) - { - num4 += (num29 - Decor.SCROLL_MARGY * 2) / 4; - } - if (m_scrollPoint.X < tinyPoint3.X) - { - m_scrollPoint.X = m_scrollPoint.X + num4; - if (m_scrollPoint.X >= tinyPoint3.X) - { - m_scrollPoint.X = tinyPoint3.X; - } - } - if (m_scrollPoint.X > tinyPoint3.X) - { - m_scrollPoint.X = m_scrollPoint.X - num4; - if (m_scrollPoint.X <= tinyPoint3.X) - { - m_scrollPoint.X = tinyPoint3.X; - } - } - if (m_scrollPoint.Y < tinyPoint3.Y) - { - m_scrollPoint.Y = m_scrollPoint.Y + num4; - if (m_scrollPoint.Y >= tinyPoint3.Y) - { - m_scrollPoint.Y = tinyPoint3.Y; - } - } - if (m_scrollPoint.Y > tinyPoint3.Y) - { - m_scrollPoint.Y = m_scrollPoint.Y - num4; - if (m_scrollPoint.Y <= tinyPoint3.Y) - { - m_scrollPoint.Y = tinyPoint3.Y; - } - } - if (m_blupiAction != 75 && m_blupiAction != 76) - { - m_posDecor = GetPosDecor(m_scrollPoint); - } - if (m_time % 4 == 0) - { - PosSound(m_blupiPos); - } - VoyageStep(); - m_blupiLastSpeedX = m_blupiSpeedX; - m_blupiLastSpeedY = m_blupiSpeedY; - m_lastKeyPress = m_keyPress; -} -*/ - -BOOL CDecor::GetInvincible() -{ - return m_bSuperBlupi; } -void CDecor::SetInvincible(BOOL invincible) +BOOL CDecor::GetSuperBlupi() { - m_bSuperBlupi = invincible; + return m_bSuperBlupi; } -BOOL CDecor::GetShowSecret() +void CDecor::SetSuperBlupi(BOOL bSuper) { - return m_bShowSecret; + m_bSuperBlupi = bSuper; } -void CDecor::SetShowSecret(BOOL secret) +BOOL CDecor::GetDrawSecret() { - m_bShowSecret = secret; + return m_bDrawSecret; } -void CDecor::SetAccessBuild(BOOL build) +void CDecor::SetDrawSecret(BOOL bDrawSecret) { - m_bAccessBuild = build; + m_bDrawSecret = bDrawSecret; +} + +void CDecor::SetBuildOfficialMissions(BOOL bBuild) +{ + m_bBuildOfficialMissions = bBuild; } BOOL CDecor::GetNetPacked() { - return m_bNetPacked; + return m_bNetPacked; } -void CDecor::SetNetPacked(BOOL net) +void CDecor::SetNetPacked(BOOL bNetPacked) { - m_bNetPacked = net; + m_bNetPacked = bNetPacked; } BOOL CDecor::GetNetMovePredict() { - return m_bNetMovePredict; + return m_bNetMovePredict; } -void CDecor::SetNetMovePredict(BOOL netmove) +void CDecor::SetNetMovePredict(BOOL bNetMovePredict) { - m_bNetMovePredict = netmove; + m_bNetMovePredict = bNetMovePredict; } BOOL CDecor::GetNetDebug() { - return m_bNetDebug; -} - -void CDecor::SetMulti(int multi) -{ - m_bMulti = multi; -} - -void CDecor::SetTeam(int team) -{ - m_team = team; + return m_bNetDebug; } void CDecor::SetNetDebug(BOOL bNetDebug) { m_bNetDebug = bNetDebug; - - if (bNetDebug != FALSE) - { - remove("debug.txt"); - } - return; -} - -void CDecor::MemorizeDoors(BYTE* doors) -{ - int i; - - for (i = 0; i < 200; i++) - { - m_doors[i] = *(BYTE*)(i + doors); - } - return; -} - -BOOL CDecor::BlupiIsGround() -{ - if (m_blupiTransport == -1) - { - RECT rect = BlupiRect(m_blupiPos); - rect.top = m_blupiPos.y + 60 - 2; - rect.bottom = m_blupiPos.y + 60 - 1; - return DecorDetect(rect); - } -} - -RECT CDecor::BlupiRect(POINT pos) -{ - RECT result; - if (m_blupiNage || m_blupiSurf) - { - result.left = pos.x + 12; - result.right = pos.x + 60 - 12; - if (m_blupiAction == 1) - { - result.top = pos.y + 5; - result.bottom = pos.y + 60 - 10; - } - else - { - result.top = pos.y + 15; - result.bottom = pos.y + 60 - 10; - } - } - else if (m_blupiJeep) - { - result.left = pos.x + 2; - result.right = pos.x + 60 - 2; - result.top = pos.y + 10; - result.bottom = pos.y + 60 - 2; - } - else if (m_blupiTank) - { - result.left = pos.x + 2; - result.right = pos.x + 60 - 2; - result.top = pos.y + 10; - result.bottom = pos.y + 60 - 2; - } - else if (m_blupiOver) - { - result.left = pos.x + 2; - result.right = pos.x + 60 - 2; - result.top = pos.y + 2; - result.bottom = pos.y + 60 - 2; - } - else if (m_blupiBalloon) - { - result.left = pos.x + 10; - result.right = pos.x + 60 - 10; - result.top = pos.y + 5; - result.bottom = pos.y + 60 - 2; - } - else if (m_blupiEcrase) - { - result.left = pos.x + 5; - result.right = pos.x + 60 - 5; - result.top = pos.y + 39; - result.bottom = pos.y + 60 - 2; - } - else - { - result.left = pos.x + 12; - result.right = pos.x + 60 - 12; - result.top = pos.y + 11; - result.bottom = pos.y + 60 - 2; - } - return result; -} - -void CDecor::BlupiAdjust() -{ - RECT tinyRect = BlupiRect(m_blupiPos); - - if (DecorDetect(tinyRect)) - { - return; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.bottom = rect.top + 2; - rect.left = m_blupiPos.x + 12; - rect.right = m_blupiPos.x + 60 - 12; - if (DecorDetect(rect)) - { - break; - } - tinyRect.top += 2; - tinyRect.bottom += 2; - m_blupiPos.y = m_blupiPos.y + 2; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.right = rect.left + 2; - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - if (DecorDetect(rect)) - { - break; - } - tinyRect.left += 2; - tinyRect.right += 2; - m_blupiPos.x = m_blupiPos.x + 2; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.left = rect.right - 2; - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - if (DecorDetect(rect)) - { - break; - } - tinyRect.left -= 2; - tinyRect.right -= 2; - m_blupiPos.x = m_blupiPos.x - 2; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.right = rect.left + 2; - if (DecorDetect(rect)) - { - break; - } - tinyRect.left += 2; - tinyRect.right += 2; - m_blupiPos.x = m_blupiPos.x + 2; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.left = rect.right - 2; - if (DecorDetect(rect)) - { - return; - } - tinyRect.left -= 2; - tinyRect.right -= 2; - m_blupiPos.x = m_blupiPos.x - 2; - } -} - -BOOL CDecor::BlupiBloque(POINT pos, int dir) -{ - RECT rect = BlupiRect(pos); - rect.top = rect.bottom - 20; - rect.bottom -= 2; - if (dir > 0) - { - rect.left = rect.right - 2; - } - if (dir < 0) - { - rect.right = rect.left + 2; - } - return DecorDetect(rect); -} - -void CDecor::BlupiDead(int action1, int action2) -{ - if (action2 == -1) - { - m_blupiAction = action1; - } - else - { - m_blupiAction = ((rand() % 2 == 0) ? action1 : action2); - } - m_blupiPhase = 0; - m_blupiFocus = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - m_blupiJumpAie = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiInvert = FALSE; - m_blupiBalloon = FALSE; - m_blupiEcrase = FALSE; - m_blupiRestart = FALSE; - m_blupiActionOuf = 0; - m_jauges[0].SetHide(TRUE); - m_jauges[1].SetHide(TRUE); - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - - POINT pos; - POINT pos2; - if (m_blupiAction == 75) - { - pos.x = m_blupiPos.x - m_posDecor.x; - pos.y = m_blupiPos.y - m_posDecor.y; - pos2.x = m_blupiPos.x - m_posDecor.x; - pos2.y = m_blupiPos.y - m_posDecor.y - 300; - VoyageInit(pos, pos2, 230, 10); - PlaySoundB(SOUND_74_ANGEL, m_blupiPos, 0); - } - if (m_blupiAction == 76) - { - pos.x = m_blupiPos.x - m_posDecor.x; - pos.y = m_blupiPos.y - m_posDecor.y; - pos2.x = m_blupiPos.x - m_posDecor.x; - pos2.y = m_blupiPos.y - m_posDecor.y - 2000; - VoyageInit(pos, pos2, 40, 10); - PlaySoundB(SOUND_74_ANGEL, m_blupiPos, 0); - } - if (m_blupiAction == 77) - { - ObjectStart(m_blupiPos, 41, -70); - ObjectStart(m_blupiPos, 41, 20); - ObjectStart(m_blupiPos, 41, -20); - PlaySoundB(SOUND_75_SCIE, m_blupiPos, 0); - } -} - -POINT CDecor::GetPosDecor(POINT pos) -{ - POINT result; - if (m_dimDecor.x == 0) - { - result.x = 0; - } - else - { - result.x = pos.x - (m_drawBounds.right - m_drawBounds.left) / 2; - result.x = (result.x < 0); - result.x = (result.x > 5760) - (m_drawBounds.right - m_drawBounds.left); - } - if (m_dimDecor.y == 0) - { - result.y = 0; - } - else - { - result.y = pos.y - (m_drawBounds.bottom - m_drawBounds.top) / 2; - result.y = (result.y < 0); - result.y = (result.y > 5920) - (m_drawBounds.bottom - m_drawBounds.top) / 2; - } - return result; -} - -void CDecor::BlupiAddFifo(POINT pos) -{ - if (m_blupiFifoNb < 10) - { - if (m_blupiFifoNb > 0 && pos.x == m_blupiFifoPos[m_blupiFifoNb - 1].x && pos.y == m_blupiFifoPos[m_blupiFifoNb - 1].y) - { - return; - } - m_blupiFifoPos[m_blupiFifoNb] = pos; - m_blupiFifoNb++; - return; - } - else - { - if (pos.x == m_blupiFifoPos[9].x && pos.y == m_blupiFifoPos[9].y) - { - return; - } - for (int i = 0; i < 9; i++) - { - m_blupiFifoPos[i] = m_blupiFifoPos[i + 1]; - } - m_blupiFifoPos[9] = pos; - return; - } -} - -BOOL CDecor::DecorDetect(RECT rect) -{ - return DecorDetect(rect, TRUE); -} - -BOOL CDecor::DecorDetect(RECT rect, BOOL bCaisse) -{ - m_detectIcon = -1; - if (rect.left < 0 || rect.top < 0) - { - return TRUE; - } - int num; - if (m_dimDecor.x == 0) - { - num = 640; - } - else - { - num = 6400; - } - if (rect.right > num) - { - return TRUE; - } - if (m_blupiHelico || - m_blupiOver || - m_blupiBalloon || - m_blupiEcrase || - m_blupiNage || - m_blupiSurf) - { - if (m_dimDecor.y == 0) - { - num = 480; - } - else - { - num = 6400; - } - if (rect.bottom > num) - { - return TRUE; - } - } - int num2 = rect.left / 16; - int num3 = (rect.right + 16 - 1) / 16; - int num4 = rect.top / 16; - int num5 = (rect.bottom + 16 - 1) / 16; - RECT src; - for (int i = num4; i <= num5; i++) - { - for (int j = num2; j <= num3; j++) - { - int num6 = j / 4; - int num7 = i / 4; - if (num6 >= 0 && num6 < 100 && num7 >= 0 && num7 < 100) - { - int icon = m_decor[num6, num7]->icon; - if (icon >= 0 && icon < MAXQUART && (!m_blupiHelico || icon != 214) && (m_blupiOver || icon != 214) && (icon != 324 || m_time / 4 % 20 < 18)) - { - num6 = j % 4; - num7 = i % 4; - if (table_decor_quart[icon * 16 + num7 * 4 + num6] != 0) - { - src.left = j * 16; - src.right = src.left + 16; - src.top = i * 16; - src.bottom = src.top + 16; - RECT tinyRect; - tinyRect.left = 0; - tinyRect.right = 0; - tinyRect.top = 0; - tinyRect.bottom = 0; - - if (IntersectRect(&tinyRect, &src, &rect)) - { - m_detectIcon = icon; - return TRUE; - } - - } - - } - } - } - } - if (!bCaisse) - { - return FALSE; - } - for (int k = 0; k < m_nbRankCaisse; k++) - { - int num8 = m_rankCaisse[k]; - src.left = m_moveObject[num8]->posCurrent.x; - src.right = m_moveObject[num8]->posCurrent.x + 64; - src.top = m_moveObject[num8]->posCurrent.y; - src.bottom = m_moveObject[num8]->posCurrent.y + 64; - RECT tinyRect; - tinyRect.left = 0; - tinyRect.right = 0; - tinyRect.top = 0; - tinyRect.bottom = 0; - if (IntersectRect(&tinyRect, &src, &rect)) - { - m_detectIcon = m_moveObject[num8]->icon; - return TRUE; - } - - } - return FALSE; -} - -BOOL CDecor::TestPath(RECT rect, POINT start, POINT end) -{ - int num = abs(end.x - start.x); - int num2 = abs(end.y - start.y); - - POINT tinyPoint = start; - if (num > num2) - { - RECT rect2; - if (end.x > start.x) - { - for (int i = 0; i <= num; i++) - { - int j = i * (end.y - start.y) / num; - rect2.left = rect.left + i; - rect2.right = rect.right + i; - rect2.top = rect.top + j; - rect2.bottom = rect.bottom + j; - if (DecorDetect(rect2)) - { - end = tinyPoint; - return FALSE; - } - tinyPoint.x = start.x + i; - tinyPoint.y = start.y + j; - } - } - if (end.x < start.x) - { - for (int i = 0; i >= -num; i--) - { - int j = i * (start.y - end.y) / num; - rect2.left = rect.left + i; - rect2.right = rect.right + i; - rect2.top = rect.top + j; - rect2.bottom = rect.bottom + j; - if (DecorDetect(rect2)) - { - end = tinyPoint; - return FALSE; - } - tinyPoint.x = start.x + i; - tinyPoint.y = start.y + j; - } - } - } - else - { - RECT rect2; - if (end.y > start.y) - { - for (int j = 0; j <= num2; j++) - { - int i = j * (end.x - start.x) / num2; - rect2.left = rect.left + i; - rect2.right = rect.right + i; - rect2.top = rect.top + j; - rect2.bottom = rect.bottom + j; - if (DecorDetect(rect2)) - { - end = tinyPoint; - return FALSE; - } - tinyPoint.x = start.x + i; - tinyPoint.y = start.y + j; - } - } - if (end.y < start.y) - { - for (int j = 0; j >= -num2; j--) - { - int i = j * (start.x - end.x) / num2; - rect2.left = rect.left + i; - rect2.right = rect.right + i; - rect2.top = rect.top + j; - rect2.bottom = rect.bottom + j; - if (DecorDetect(rect2)) - { - end = tinyPoint; - return FALSE; - } - tinyPoint.x = start.x + i; - tinyPoint.y = start.y + j; - } - } - } - return TRUE; -} - -void CDecor::MoveObjectPlouf(POINT pos) -{ - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 14) - { - return; - } - } - pos.y -= 45; - PlaySoundB(SOUND_23_PLOUF, pos, 0); - ObjectStart(pos, 14, 0); -} - -void CDecor::MoveObjectTiplouf(POINT pos) -{ - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 35) - { - return; - } - } - if (m_blupiDir == 2) - { - pos.x += 5; - } - else - { - pos.x -= 5; - } - pos.y -= 45; - PlaySoundB(SOUND_64_TIPLOUF, pos, 0); - ObjectStart(pos, 35, 0); -} - -void CDecor::MoveObjectBlup(POINT pos) -{ - PlaySoundB(SOUND_24_BLUP, pos, 0); - pos.y -= 20; - int num = 0; - POINT tinyPoint = pos; - while (tinyPoint.y > 0) - { - int icon = m_decor[(tinyPoint.x + 16) / 64, tinyPoint.y / 64]->icon; - if (icon != 91 && icon != 92) - { - break; - } - num++; - tinyPoint.y -= 64; - } - num--; - if (num <= 0) - { - return; - } - int num2 = MoveObjectFree(); - if (num2 == -1) - { - return; - } - m_moveObject[num2]->type = 15; - m_moveObject[num2]->phase = 0; - m_moveObject[num2]->posCurrent.x = pos.x; - m_moveObject[num2]->posCurrent.y = pos.y; - m_moveObject[num2]->posStart = m_moveObject[num2]->posCurrent; - m_moveObject[num2]->posEnd.x = pos.x; - m_moveObject[num2]->posEnd.y = pos.y - num * 64; - m_moveObject[num2]->timeStopStart = 0; - m_moveObject[num2]->stepAdvance = num * 10; - m_moveObject[num2]->step = 2; - m_moveObject[num2]->time = 0; - MoveObjectStepIcon(num2); -} - - -void CDecor::ActiveSwitch(BOOL bState, POINT cel) -{ - POINT pos; - pos.x = cel.x * 64; - pos.y = cel.y * 64; - ModifDecor(pos, 385 - (UINT)(bState != FALSE), TRUE); - PlaySoundB((bState != FALSE) + SOUND_76_SWITCHOFF, pos, 0); - cel.x -= 20; - for (int i = 0; i < 41; i++) - { - if (cel.x >= 0 && cel.x < 100 && m_decor[cel.x, cel.y]->icon == (bState ? 379 : 378)) - { - pos.x = cel.x * 64; - pos.y = cel.y * 64; - ModifDecor(pos, 379 - (UINT)(bState != FALSE), TRUE); - } - cel.x++; - } -} - -int CDecor::IsWorld(POINT pos) -{ - pos.x += 30; - pos.y += 30; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return -1; - } - int icon = m_decor[pos.x / 64, pos.y / 64]->icon; - if (icon >= 158 && icon <= 165) - { - return icon - 158 + 1; - } - if (icon >= 166 && icon <= 173) - { - return icon - 166 + 1; - } - if (icon == 309 || icon == 310) - { - return 9; - } - if (icon >= 411 && icon <= 415) - { - return icon - 411 + 10; - } - if (icon >= 416 && icon <= 420) - { - return icon - 416 + 10; - } - if (icon >= 174 && icon <= 181) - { - return icon - 174 + 1; - } - if (icon == 184) - { - return 199; - } - return -1; -} - -int CDecor::GetTypeBarre(POINT pos) -{ - POINT pos2 = pos; - pos.x += 30; - pos.y += 22; - if (pos.y % 64 > 44) - { - return 0; - } - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return 0; - } - int icon = m_decor[pos.x / 64, pos.y / 64]->icon; - if (icon != 138 && icon != 202) - { - return 0; - } - if (pos.y >= 6336) - { - return 1; - } - icon = m_decor[pos.x / 64, pos.y / 64 + 1]->icon; - if (IsPassIcon(icon)) - { - return 2; - } - RECT rect = BlupiRect(pos2); - rect.top = pos2.y + 60 - 2; - rect.bottom = pos2.y + 60 - 1; - if (DecorDetect(rect, TRUE)) - { - return 2; - } - return 1; -} - -BOOL CDecor::IsLave(POINT pos) -{ - pos.x += 30; - return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 68; -} - -BOOL CDecor::IsPiege(POINT pos) -{ - pos.x += 30; - pos.y += 60; - return pos.x % 64 >= 15 && pos.x % 64 <= 49 && pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 373; -} - -BOOL CDecor::IsGoutte(POINT pos, BOOL bAlways) -{ - pos.x += 30; - if (pos.x % 64 < 15 || pos.x % 64 > 49) - { - return FALSE; - } - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return FALSE; - } - int icon = m_decor[pos.x / 64, pos.y / 64]->icon; - if (bAlways) - { - return icon == 404 || icon == 410; - } - return icon == 404; -} - -BOOL CDecor::IsScie(POINT pos) -{ - pos.x += 30; - return pos.x % 64 >= 4 && pos.x % 64 <= 60 && pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 378; -} - -BOOL CDecor::IsSwitch(POINT pos, POINT celSwitch) -{ - pos.x += 30; - if (pos.x % 64 < 4 || pos.x % 64 > 60) - { - return FALSE; - } - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return FALSE; - } - celSwitch.x = pos.x / 64; - celSwitch.y = pos.y / 64; - return m_decor[pos.x / 64, pos.y / 64]->icon == 384 || m_decor[pos.x / 64, pos.y / 64]->icon == 385; -} - -BOOL CDecor::IsEcraseur(POINT pos) -{ - if (m_time / 3 % 10 > 2) - { - return FALSE; - } - pos.x += 30; - return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 317; -} - -BOOL CDecor::IsBlitz(POINT pos, BOOL bAlways) -{ - pos.x += 30; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return FALSE; - } - POINT tinyPoint; - tinyPoint.x = pos.x / 64; - tinyPoint.y = pos.y / 64; - return m_decor[tinyPoint.x, tinyPoint.y]->icon == 305 && (bAlways || BlitzActif(tinyPoint.x, tinyPoint.y)); -} - -BOOL CDecor::IsRessort(POINT pos) -{ - pos.x += 30; - pos.y += 60; - return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 211; -} - -BOOL CDecor::IsTemp(POINT pos) -{ - pos.x += 30; - pos.y += 60; - return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 324; -} - -BOOL CDecor::IsBridge(POINT pos, POINT celBridge) -{ - pos.x += 30; - pos.y += 60; - if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 364) - { - celBridge.x = pos.x / 64; - celBridge.y = pos.y / 64; - return TRUE; - } - pos.y -= 60; - if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 364) - { - celBridge.x = pos.x / 64; - celBridge.y = pos.y / 64; - return TRUE; - } - return FALSE; - -} - -int CDecor::IsDoor(POINT pos, POINT celPorte) -{ - int num; - if (m_blupiDir == 1) - { - num = -60; - } - else - { - num = 60; - } - pos.x += 30; - for (int i = 0; i < 2; i++) - { - if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon >= 334 && m_decor[pos.x / 64, pos.y / 64]->icon <= 336) - { - celPorte.x = pos.x / 64; - celPorte.y = pos.y / 64; - return m_decor[pos.x / 64, pos.y / 64]->icon; - } - pos.x += num; - } - return -1; -} - -int CDecor::IsTeleporte(POINT pos) -{ - if (pos.x % 64 > 6) - { - return -1; - } - pos.x += 30; - pos.y -= 60; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return -1; - } - if (m_decor[pos.x / 64, pos.y / 64]->icon >= 330 && m_decor[pos.x / 64, pos.y / 64]->icon <= 333) - { - return m_decor[pos.x / 64, pos.y / 64]->icon; - } - return -1; -} - -BOOL CDecor::SearchTeleporte(POINT pos, POINT newpos) -{ - int num = IsTeleporte(pos); - if (num == -1) - { - return FALSE; - } - for (int i = 0; i < 100; i++) - { - for (int j = 0; j < 100; j++) - { - if (num == m_decor[i, j]->icon) - { - newpos.x = i * 64; - newpos.y = j * 64 + 60; - if (newpos.x < pos.x - 40 || newpos.x > pos.x + 40 || newpos.y < pos.y - 40 || newpos.y > pos.y + 40) - { - return TRUE; - } - } - } - } - return FALSE; -} - -BOOL CDecor::SomethingMissionPath(int user, int mission, BOOL bUser) -{ - char str[260]; - - GetMissionPath(str, user, mission, bUser); - remove(str); - return TRUE; -} - -BOOL CDecor::IsNormalJump(POINT pos) -{ - pos.x += 32; - pos.y -= 32; - if (m_blupiDir == 1) - { - pos.x -= 15; - } - else - { - pos.x += 15; - } - for (int i = 0; i < 2; i++) - { - int num = pos.x / 64; - int num2 = pos.y / 64; - if (num2 < 0) - { - return FALSE; - } - int icon = m_decor[num, num2]->icon; - if (!IsPassIcon(icon)) - { - return FALSE; - } - pos.y -= 64; - } - return TRUE; -} - -BOOL CDecor::IsSurfWater(POINT pos) -{ - if (pos.y % 64 < 64 - BLUPISURF) - { - return FALSE; - } - int icon = m_decor[(pos.x + 30) / 64, pos.y / 64]->icon; - int icon2 = m_decor[(pos.x + 30) / 64, (pos.y + BLUPISURF) / 64]->icon; - return icon != 92 && icon2 == 92; -} - -BOOL CDecor::IsDeepWater(POINT pos) -{ - int num = (pos.x + 30) / 64; - int num2 = pos.y / 64; - if (num < 0 || num >= 100 || num2 < 0 || num2 >= 100) - { - return FALSE; - } - int icon = m_decor[num, num2]->icon; - return icon == 91 || icon == 92; -} - -BOOL CDecor::IsOutWater(POINT pos) -{ - int icon = m_decor[(pos.x + 30) / 64, (pos.y + 30) / 64]->icon; - return icon != 91 && icon != 92 && IsPassIcon(icon); -} - -BOOL CDecor::IsPassIcon(int icon) -{ - if (icon == 324 && m_time / 4 % 20 >= 18) - { - return TRUE; - } - if (icon >= 0 && icon < MAXQUART) - { - for (int i = 0; i < 16; i++) - { - if (table_decor_quart[icon * 16 + i] != 0) - { - return FALSE; - } - } - } - return TRUE; -} - -BOOL CDecor::IsBlocIcon(int icon) -{ - if (icon < 0 || icon >= MAXQUART) - { - return FALSE; - } - if (icon == 324 && m_time / 4 % 20 < 18) - { - return FALSE; - } - for (int i = 0; i < 16; i++) - { - if (table_decor_quart[icon * 16 + i] == 0) - { - return FALSE; - } - } - return FALSE; -} - -void CDecor::FlushBalleTraj() -{ - for (int i = 0; i < 1300; i++) - { - m_balleTraj[i] = 0; - } -} - -void CDecor::SetBalleTraj(POINT pos) -{ - if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) - { - return; - } - int num = pos.y * 13; - num += pos.x / 8; - int num2 = pos.x & 7; - m_balleTraj[num] |= 1 << num2; -} - -BOOL CDecor::IsBalleTraj(POINT pos) -{ - pos.x = (pos.x + 32) / 64; - pos.y = (pos.y + 32) / 64; - if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) - { - return FALSE; - } - int num = pos.y * 13; - num += pos.x / 8; - int num2 = pos.x & 7; - return (m_balleTraj[num] & 1 << num2) != 0; -} - -void CDecor::FlushMoveTraj() -{ - for (int i = 0; i < 1300; i++) - { - m_moveTraj[i] = 0; - } -} - -void CDecor::SetMoveTraj(POINT pos) -{ - - if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) - { - return; - } - int num = pos.y * 13; - num += pos.x / 8; - int num2 = pos.x & 7; - m_moveTraj[num] |= 1 << num2; -} - -BOOL CDecor::IsMoveTraj(POINT pos) -{ - pos.x = (pos.x + 32) / 64; - pos.y = (pos.y + 32) / 64; - if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) - { - return FALSE; - } - int num = pos.y * 13; - num += pos.x / 8; - int num2 = pos.x & 7; - return (m_moveTraj[num] & 1 << num2) != 0; -} - -int CDecor::SearchDistRight(POINT pos, POINT dir, int type) -{ - int num = 0; - if (type == 36 || type == 39 || type == 41 || type == 42 || type == 93) - { - return 500; - } - pos.x = (pos.x + 32) / 64; - pos.y = (pos.y + 32) / 64; - while (pos.x >= 0 && pos.x < 100 && pos.y >= 0 && pos.y < 100 && !IsBlocIcon(m_decor[pos.x, pos.y]->icon)) - { - if (type == 23) - { - SetBalleTraj(pos); - } - num += 64; - pos.x += dir.x; - pos.y += dir.y; - } - if ((type == 34 || type == 38) && num >= 64) - { - num -= 64; - } - if (type == 23 && num >= 10) - { - num -= 10; - } - return num; -} - -BOOL CDecor::IsVentillo(POINT pos) -{ - int num = 0; - BOOL flag = FALSE; - POINT tinyPoint; - pos.x += 30; - pos.y += 30; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return FALSE; - } - int icon = m_decor[pos.x / 64, pos.y / 64]->icon; - if (icon < 126 || icon > 137) - { - return FALSE; - } - if (icon == 126) - { - if (pos.x % 64 <= 16) - { - flag = TRUE; - } - tinyPoint.x = -64; - tinyPoint.y = 0; - num = 110; - } - if (icon == 129) - { - if (pos.x % 64 >= 48) - { - flag = TRUE; - } - tinyPoint.x = 64; - tinyPoint.y = 0; - num = 114; - } - if (icon == 132) - { - if (pos.y % 64 <= 32) - { - flag = TRUE;; - } - tinyPoint.x = 0; - tinyPoint.y = -64; - num = 118; - } - if (icon == 135) - { - if (pos.y % 64 >= 48) - { - flag = TRUE; - } - tinyPoint.x = 0; - tinyPoint.y = 64; - num = 122; - } - if (!flag) - { - return FALSE; - } - ModifDecor(pos, -1, TRUE); - do - { - pos.x += tinyPoint.x; - pos.y += tinyPoint.y; - if (num != m_decor[pos.x / 64, pos.y / 64]->icon) - { - break; - } - ModifDecor(pos, -1, TRUE); - } - while (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400); - return TRUE; -} - -// Birdlime - -void CDecor::StartSploutchGlu(POINT pos) -{ - POINT pos2; - pos2.x = pos.x; - pos2.y = pos.y; - ObjectStart(pos2, 98, 0); - pos2.x = pos.x + 15; - pos2.y = pos.y + 20; - ObjectStart(pos2, 99, 0); - pos2.x = pos.x - 20; - pos2.y = pos.y + 18; - ObjectStart(pos2, 99, 0); - pos2.x = pos.x + 23; - pos2.y = pos.y - 18; - ObjectStart(pos2, 99, 0); - pos2.x = pos.x - 15; - pos2.y = pos.y - 18; - ObjectStart(pos2, 99, 0); - pos2.x = pos.x + 32; - pos2.y = pos.y + 10; - ObjectStart(pos2, 100, 0); - pos2.x = pos.x - 28; - pos2.y = pos.y + 15; - ObjectStart(pos2, 100, 0); - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(SOUND_51_GLU, pos, 0); -} - -int CDecor::ObjectStart(POINT pos, int type, int speed) -{ - int num = MoveObjectFree(); - if (num == -1) - { - return -1; - } - m_moveObject[num]->type = type; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = pos; - m_moveObject[num]->posStart = pos; - m_moveObject[num]->posEnd = pos; - MoveObjectStepIcon(num); - if (speed != 0) - { - POINT tinyPoint = pos; - int num2 = speed; - int num3 = 0; - if (num2 > 50) - { - num2 -= 50; - POINT dir; - dir.x = 0; - dir.y = 1; - num3 = SearchDistRight(tinyPoint, dir, type); - tinyPoint.y += num3; - } - else if (num < -50) - { - num2 += 50; - POINT dir; - dir.x = 0; - dir.y = -1; - num3 = SearchDistRight(tinyPoint, dir, type); - tinyPoint.y -= num3; - } - else if (num2 > 0) - { - POINT dir; - dir.x = 1; - dir.y = 0; - num3 = SearchDistRight(tinyPoint, dir, type); - tinyPoint.x += num3; - } - else if (num2 < 0) - { - POINT dir; - dir.x = -1; - dir.y = 0; - num3 = SearchDistRight(tinyPoint, dir, type); - tinyPoint.x -= num3; - } - if (num3 == 0) - { - if (type == 23) - { - m_moveObject[num]->type = 0; - return num; - } - } - else - { - m_moveObject[num]->posEnd = tinyPoint; - m_moveObject[num]->timeStopStart = 0; - m_moveObject[num]->stepAdvance = abs(num2 * num3 / 64); - m_moveObject[num]->step = 2; - m_moveObject[num]->time = 0; - } - } - MoveObjectPriority(num); - return num; -} - -BOOL CDecor::ObjectDelete(POINT pos, int type, int something) -{ - POINT pos1; - int move; - int type2; - - pos1 = pos; - move = MoveObjectSearch(pos, type); - - if (move == -1) - { - return FALSE; - } - m_moveObject[move]->type = TYPE_EMPTY; - - if (something != 0) - { - LOWORD(pos.x = 21); - HIWORD(pos.x = 0); - LOWORD(pos.y = pos.y); - HIWORD(pos.y = type); - NetMessagePush((NetMessage*)&pos); - } - return TRUE; -} - -void CDecor::ModifDecor(POINT pos, int icon, BOOL bMulti) -{ - int num, num2; - POINT pos2; - - pos2 = pos; - num = pos.x; - num2 = pos.y; - - pos.y = (short)icon; - - m_decor[(int)(num + (num >> 31 & 63)) >> 6][(int)(num2 + (num2 >> 31 & 63)) >> 6].icon = pos.y; - - if (bMulti != FALSE) - { - LOWORD(pos.x = 30); - HIWORD(pos.x = num); - LOWORD(pos.y = num2); - HIWORD(pos.y = pos2.y); - NetMessagePush((NetMessage*)&pos); - } - return; -} - -void CDecor::NetMessageIndexFlush() -{ - m_netMessageIndex1 = 0; - m_netMessageIndex2 = 0; - m_netMessageIndex3 = 0; - return; -} - -void CDecor::NotifFlush() -{ - int players; - char(*notifBuffer)[100]; - - notifBuffer = m_notifText; - - m_notifTime = 0; -} - -void CDecor::NotifPop() -{ - char(*notifText)[100]; - int i; - int num; - const void* num2; - void* num3; - int string; - - notifText = m_notifText; - i = 3; - do - { - string = strlen((const char*)(i + 100)) + 1; - num = (int)notifText + 100 + string++; - num2 = (const void*)(num + 1 - string); - num3 = (void*)notifText; - string += 100; - memcpy(num3, num2, string - 1); - --i; - } while (i); - if (i == 0) - { - m_notifText[3][0] = '\0'; - m_notifTime = 200; - } - return; -} - -void CDecor::NotifPush(char* str) -{ - int i; - char* num; - char(*text)[100]; - POINT pos; - - i = 0; - text = m_notifText; - - while (*text) - { - i++; - text += 100; - if (i >= 4) - { - NotifPop(); - num = (char*)m_notifText + i; - goto LABEL_5; - } - } - num = (char*)m_notifText + 3; - -LABEL_5: - strcpy(num, str); - m_notifTime = 200; - pos.x = 320; - pos.y = 240; - m_pSound->PlayImage(11, pos, -1); - return; -} - -BOOL CDecor::NetMessagePush(NetMessage* message) -{ - NetMessage* messages; - BYTE data; - short pos; - int i; - - if (m_netMessageIndex1 == NETEVENTMAX) - { - return FALSE; - } - - i = m_netMessageIndex2; - data = message->data1; - pos = message->x; - messages = m_netMessages + i; - messages->messageType = message->messageType; - messages->data1 = data; - pos = message->channel; - - m_netMessages[i].y = message->y; - m_netMessages[i].channel = pos; - i = m_netMessageIndex2 + 1; - m_netMessageIndex1++; - m_netMessageIndex2 = i; - - if (i == NETEVENTMAX) - { - m_netEventIndex2 = 0; - } - return TRUE; -} - -void CDecor::NetSendData(BYTE bufferSize, UCHAR send) -{ - int data; - - data = ((UINT)bufferSize, 4); - data = (send, (int)data); - m_pNetwork->Send(&data, 4, DPSEND_GUARANTEED); - return; -} - -void CDecor::NetPlayerCollide(POINT pos, int* out) -{ - tagRECT rect1; - RECT rect2; - RECT rect3; - - -} - -void CDecor::NetDataFlush() -{ - int i; - LONG* net; - int* playerPackets; - - playerPackets = m_netPlayerPacketsRecieved; - net = (LONG*)m_netVitesses[0].y; - - i = 4; - - while (i != 0) - { - m_netPacketIcon.icon = 65535; - m_netPacketIcon.type = 65535; - playerPackets = 0; - playerPackets[4] = 0; - m_netVitesses->x = 0; - ((POINT*)(net + -1))->x = 0; - playerPackets++; - net++; - i++; - } - m_netPacketsSent = 0; - m_netPacketsSent2 = 0; - m_netPacketsRecieved = 0; - m_netPacketsRecieved2 = 0; - m_netPacketIcon.icon = 65535; - m_netPacketIcon.type = 65535; - NetMessageIndexFlush(); -} - -void CDecor::NetPlaySound(short channel, POINT pos) -{ - NetMessage event; - - event.y = (short)pos.y; - event.x = (short)pos.x; - event.messageType = PK_PLAYSOUND; - event.data1 = 0; - event.channel = channel; - NetMessagePush(&event); - return; -} - -void CDecor::NetStopCloud(int rank) -{ - NetMessage cloud; - - cloud.data1 = 0; - cloud.x = 0; - cloud.y = 0; - cloud.messageType = 60; - cloud.channel = (short)rank; - NetMessagePush(&cloud); - return; -} - -void CDecor::MoveObjectStep() -{ - m_blupiVector.x = 0; - m_blupiVector.y = 0; - m_blupiTransport = -1; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0) - { - MoveObjectStepLine(i); - MoveObjectStepIcon(i); - if (m_moveObject[i]->type == 4 || - m_moveObject[i]->type == 33 || - m_moveObject[i]->type == 32) - { - int num = MovePersoDetect(m_moveObject[i]->posCurrent); - if (num != -1) - { - POINT posCurrent = m_moveObject[i]->posCurrent; - posCurrent.x -= 34; - posCurrent.y -= 34; - ObjectStart(posCurrent, 8, 0); - PlaySoundB(SOUND_10_BOUM, m_moveObject[i]->posCurrent, 0); - m_decorAction = 1; - m_decorPhase = 0; - posCurrent = m_moveObject[i]->posCurrent; - posCurrent.x += 2; - posCurrent.y += BLUPIOFFY; - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 1); - ObjectStart(posCurrent, 37, 0); - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type, 1); - } - if (BlupiElectro(m_moveObject[i]->posCurrent)) - { - POINT posCurrent = m_moveObject[i]->posCurrent; - posCurrent.x += 2; - posCurrent.y += BLUPIOFFY; - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 1); - ObjectStart(posCurrent, 38, 55); - PlaySoundB(SOUND_59_ELECTRO, posCurrent, 0); - } - } - - } - } -} - - -void CDecor::MoveObjectStepLine(int i) -{ - MoveObject moveObject; - POINT tinyPoint; - BOOL flag = FALSE; - RECT tinyRect; - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48 && !m_blupiSuspend) - { - RECT src; - src.left = m_blupiPos.x + 20; - src.right = m_blupiPos.x + 60 - 20; - src.top = m_blupiPos.y + 60 - 2; - src.bottom = m_blupiPos.y + 60 - 1; - tinyRect.left = m_moveObject[i]->posCurrent.x; - tinyRect.right = m_moveObject[i]->posCurrent.x + 64; - tinyRect.top = m_moveObject[i]->posCurrent.y; - tinyRect.bottom = m_moveObject[i]->posCurrent.y + 16; - RECT tinyRect2; - flag = IntersectRect(&tinyRect2, &tinyRect, &src); - tinyPoint = m_moveObject[i]->posCurrent; - } - POINT posCurrent; - if (m_blupiFocus && !m_blupiHide && m_moveObject[i]->type == 97) - { - posCurrent = m_moveObject[i]->posCurrent; - if (posCurrent.x < m_blupiPos.x) - { - posCurrent.x++; - } - if (posCurrent.x > m_blupiPos.x) - { - posCurrent.x--; - } - if (posCurrent.y < m_blupiPos.y) - { - posCurrent.y++; - } - if (posCurrent.y > m_blupiPos.y) - { - posCurrent.y--; - } - tinyRect.left = posCurrent.x + 10; - tinyRect.right = posCurrent.x + 60 - 10; - tinyRect.top = posCurrent.y + 10; - tinyRect.bottom = posCurrent.y + 60 - 10; - if (TestPath(tinyRect, m_moveObject[i]->posCurrent, posCurrent)) - { - m_moveObject[i]->posCurrent = posCurrent; - m_moveObject[i]->posStart = posCurrent; - m_moveObject[i]->posEnd = posCurrent; - } - else - { - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 1); - posCurrent.x -= 34; - posCurrent.y -= 34; - ObjectStart(posCurrent, 9, 0); - PlaySoundB(SOUND_10_BOUM, posCurrent, 0); - m_decorAction = 1; - m_decorPhase = 0; - } - } - if (m_moveObject[i]->posStart.x != m_moveObject[i]->posEnd.x || m_moveObject[i]->posStart.y != m_moveObject[i]->posEnd.y) - { - if (m_moveObject[i]->step == 1) - { - if (m_moveObject[i]->time < m_moveObject[i]->timeStopStart) - { - - m_moveObject[i]->time = m_moveObject[i]->time + 1; - } - else - { - m_moveObject[i]->step = 2; - m_moveObject[i]->time = 0; - } - } - else if (m_moveObject[i]->step == 2) - { - if (m_moveObject[i]->posCurrent.x != m_moveObject[i]->posEnd.x || m_moveObject[i]->posCurrent.x != m_moveObject[i]->posEnd.y) - { - - m_moveObject[i]->time = m_moveObject[i]->time + 1; - if (m_moveObject[i]->stepAdvance != 0) - { - m_moveObject[i]->posCurrent.x = (m_moveObject[i]->posEnd.x - m_moveObject[i]->posStart.x) * m_moveObject[i]->time / m_moveObject[i]->stepAdvance + m_moveObject[i]->posStart.x; - m_moveObject[i]->posCurrent.y = (m_moveObject[i]->posEnd.y - m_moveObject[i]->posStart.y) * m_moveObject[i]->time / m_moveObject[i]->stepAdvance + m_moveObject[i]->posStart.y; - } - - } - else if (m_moveObject[i]->type == 15 || m_moveObject[i]->type == 23) - { - m_moveObject[i]->type = 0; - } - else if (m_moveObject[i]->type == 34) - { - m_moveObject[i]->posStart = m_moveObject[i]->posCurrent; - m_moveObject[i]->posEnd = m_moveObject[i]->posCurrent; - m_moveObject[i]->step = 3; - m_moveObject[i]->time = 0; - } - else - { - m_moveObject[i]->step = 3; - m_moveObject[i]->time = 0; - } - } - else if (m_moveObject[i]->step == 3) - { - if (m_moveObject[i]->time < m_moveObject[i]->timeStopEnd) - { - - m_moveObject[i]->time = m_moveObject[i]->time + 1; - } - else - { - m_moveObject[i]->step = 4; - m_moveObject[i]->time = 0; - } - } - else if (m_moveObject[i]->step == 4) - { - if (m_moveObject[i]->posCurrent.x != m_moveObject[i]->posStart.x || m_moveObject[i]->posCurrent.y != m_moveObject[i]->posStart.y) - { - m_moveObject[i]->time = m_moveObject[i]->time + 1; - if (m_moveObject[i]->stepRecede != 0) - { - m_moveObject[i]->posCurrent.x = (m_moveObject[i]->posStart.x - m_moveObject[i]->posEnd.x) * - m_moveObject[i]->time / m_moveObject[i]->stepRecede + m_moveObject[i]->posEnd.x; - m_moveObject[i]->posCurrent.y = (m_moveObject[i]->posStart.y - m_moveObject[i]->posEnd.y) * - m_moveObject[i]->time / m_moveObject[i]->stepRecede + m_moveObject[i]->posEnd.y; - } - } - else - { - m_moveObject[i]->step = 1; - m_moveObject[i]->time = 0; - } - } - } - if (m_moveObject[i]->type == 22 && m_moveObject[i]->step == 3) - { - m_moveObject[i]->type = 0; - } - posCurrent = m_moveObject[i]->posCurrent; - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48) - { - posCurrent.y -= 64; - } - posCurrent.x = (posCurrent.x + 32) / 64; - posCurrent.y = (posCurrent.y + 32) / 64; - SetMoveTraj(posCurrent); - if (flag) - { - m_blupiVector.x = m_moveObject[i]->posCurrent.x - tinyPoint.x; - m_blupiVector.y = m_moveObject[i]->posCurrent.y - (m_blupiPos.y + 60 - BLUPIFLOOR); - if (m_moveObject[i]->type == 47) - { - m_blupiVector.x = m_blupiVector.x + 2; - } - if (m_moveObject[i]->type == 48) - { - m_blupiVector.x = m_blupiVector.x - 2; - } - if (m_blupiTimeNoAsc == 0) - { - m_blupiTransport = i; - } - } -} - - - -void CDecor::MoveObjectStepIcon(int i) -{ - if (m_moveObject[i]->type == 47) - { - m_moveObject[i]->icon = table_chenille[m_moveObject[i]->phase / 1 % 6]; - } - if (m_moveObject[i]->type == 48) - { - m_moveObject[i]->icon = table_chenillei[m_moveObject[i]->phase / 1 % 6]; - } - if (m_moveObject[i]->type == 2) - { - m_moveObject[i]->icon = 12 + m_moveObject[i]->phase / 2 % 9; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 3) - { - m_moveObject[i]->icon = 48 + m_moveObject[i]->phase / 2 % 9; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 16) - { - m_moveObject[i]->icon = 69 + m_moveObject[i]->phase / 1 % 9; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 96) - { - m_moveObject[i]->icon = table_follow1[m_moveObject[i]->phase / 1 % 26]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 97) - { - m_moveObject[i]->icon = table_follow2[m_moveObject[i]->phase / 1 % 5]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 200) - { - m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6; - m_moveObject[i]->channel = 2; - } - if (m_moveObject[i]->type == 201) - { - m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6; - m_moveObject[i]->channel = 11; - } - if (m_moveObject[i]->type == 202) - { - m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6; - m_moveObject[i]->channel = 12; - } - if (m_moveObject[i]->type == 203) - { - m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6; - m_moveObject[i]->channel = 13; - } - if (m_moveObject[i]->type == 55) - { - m_moveObject[i]->icon = 252; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 56) - { - m_moveObject[i]->icon = table_dynamitef[m_moveObject[i]->phase / 1 % 100]; - m_moveObject[i]->channel = 10; - if (m_moveObject[i]->phase == 50) - { - DynamiteStart(i, 0, 0); - } - if (m_moveObject[i]->phase == 53) - { - DynamiteStart(i, -100, 8); - } - if (m_moveObject[i]->phase == 55) - { - DynamiteStart(i, 80, 10); - } - if (m_moveObject[i]->phase == 56) - { - DynamiteStart(i, -15, -100); - } - if (m_moveObject[i]->phase == 59) - { - DynamiteStart(i, 20, 70); - } - if (m_moveObject[i]->phase == 62) - { - DynamiteStart(i, 30, -50); - } - if (m_moveObject[i]->phase == 64) - { - DynamiteStart(i, -40, 30); - } - if (m_moveObject[i]->phase == 67) - { - DynamiteStart(i, -180, 10); - } - if (m_moveObject[i]->phase == 69) - { - DynamiteStart(i, 200, -10); - } - if (m_moveObject[i]->phase >= 70) - { - m_moveObject[i]->type = 0; - } - } - if (m_moveObject[i]->type == 5) - { - if (m_moveObject[i]->phase / 3 % 22 < 11) - { - m_moveObject[i]->icon = m_moveObject[i]->phase / 3 % 11; - } - else - { - m_moveObject[i]->icon = 11 - m_moveObject[i]->phase / 3 % 11; - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 6) - { - m_moveObject[i]->icon = 21 + m_moveObject[i]->phase / 4 % 8; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 7) - { - m_moveObject[i]->icon = 29 + m_moveObject[i]->phase / 3 % 8; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 21) - { - m_moveObject[i]->icon = table_cle[m_moveObject[i]->phase / 3 % 12]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 49) - { - m_moveObject[i]->icon = table_cle1[m_moveObject[i]->phase / 3 % 12]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 50) - { - m_moveObject[i]->icon = table_cle2[m_moveObject[i]->phase / 3 % 12]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 51) - { - m_moveObject[i]->icon = table_cle3[m_moveObject[i]->phase / 3 % 12]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 24) - { - m_moveObject[i]->icon = table_skate[m_moveObject[i]->phase / 1 % 34]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 25) - { - m_moveObject[i]->icon = table_shield[m_moveObject[i]->phase / 2 % 16]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 26) - { - m_moveObject[i]->icon = table_power[m_moveObject[i]->phase / 2 % 8]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 40) - { - m_moveObject[i]->icon = table_invert[m_moveObject[i]->phase / 2 % 20]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 31) - { - m_moveObject[i]->icon = table_charge[m_moveObject[i]->phase / 2 % 6]; - m_moveObject[i]->channel = 1; - } - if (m_moveObject[i]->type == 27) - { - m_moveObject[i]->icon = table_magictrack[m_moveObject[i]->phase / 1 % 24]; - m_moveObject[i]->channel = 10; - if (m_moveObject[i]->phase >= 24) - { - m_moveObject[i]->type = 0; - } - } - if (m_moveObject[i]->type == 57) - { - m_moveObject[i]->icon = table_shieldtrack[m_moveObject[i]->phase / 1 % 20]; - m_moveObject[i]->channel = 10; - if (m_moveObject[i]->phase >= 20) - { - m_moveObject[i]->type = 0; - } - } - if (m_moveObject[i]->type == 39) - { - m_moveObject[i]->icon = table_tresortrack[m_moveObject[i]->phase / 1 % 11]; - m_moveObject[i]->channel = 10; - if (m_moveObject[i]->phase >= 11) - { - m_moveObject[i]->type = 0; - } - } - if (m_moveObject[i]->type == 58 && m_moveObject[i]->phase >= 20) - { - m_moveObject[i]->type = 0; - } - if (m_moveObject[i]->type == 8) - { - if (m_moveObject[i]->phase >= (int)table_explo1) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo1[m_moveObject[i]->phase]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 9) - { - if (m_moveObject[i]->phase >= 20) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo2[m_moveObject[i]->phase % 20]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 10) - { - if (m_moveObject[i]->phase >= 20) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo3[m_moveObject[i]->phase / 1 % 20]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 11) - { - if (m_moveObject[i]->phase >= 9) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo4[m_moveObject[i]->phase / 1 % 9]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 90) - { - if (m_moveObject[i]->phase >= 12) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo5[m_moveObject[i]->phase / 1 % 12]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 91) - { - if (m_moveObject[i]->phase >= 6) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo6[m_moveObject[i]->phase / 1 % 6]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 92) - { - if (m_moveObject[i]->phase >= 128) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo7[m_moveObject[i]->phase / 1 % 128]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 93) - { - if (m_moveObject[i]->phase >= 5) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo8[m_moveObject[i]->phase / 1 % 5]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 98) - { - if (m_moveObject[i]->phase >= 10) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_sploutch1[m_moveObject[i]->phase / 1 % 10]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 99) - { - if (m_moveObject[i]->phase >= 13) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_sploutch2[m_moveObject[i]->phase / 1 % 13]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 100) - { - if (m_moveObject[i]->phase >= 18) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_sploutch3[m_moveObject[i]->phase / 1 % 18]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 53) - { - if (m_moveObject[i]->phase >= 90) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_tentacule[m_moveObject[i]->phase / 2 % 45]; - m_moveObject[i]->channel = 9; - } - } - POINT pos; - if (m_moveObject[i]->type == 52) - { - if (m_moveObject[i]->phase == 0) - { - PlaySoundB(72, m_moveObject[i]->posStart, 0); - } - if (m_moveObject[i]->phase == 137) - { - PlaySoundB(73, m_moveObject[i]->posStart, 0); - } - if (m_moveObject[i]->phase >= 157) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_bridge[m_moveObject[i]->phase / 1 % 157]; - m_moveObject[i]->channel = 1; - pos.x = m_moveObject[i]->posStart.x / 64; - pos.y = m_moveObject[i]->posStart.y / 64; - m_decor[pos.x, pos.y]->icon = m_moveObject[i]->icon; - } - } - if (m_moveObject[i]->type == 36) - { - if (m_moveObject[i]->phase >= 16) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_pollution[m_moveObject[i]->phase / 2 % 8]; - m_moveObject[i]->channel = 10; - } - } - if (m_moveObject[i]->type == 41) - { - if (m_moveObject[i]->phase >= 16) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_invertstart[m_moveObject[i]->phase / 2 % 8]; - m_moveObject[i]->channel = 10; - } - } - if (m_moveObject[i]->type == 42) - { - if (m_moveObject[i]->phase >= 16) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_invertstop[m_moveObject[i]->phase / 2 % 8]; - m_moveObject[i]->channel = 10; - } - } - if (m_moveObject[i]->type == 14) - { - if (m_moveObject[i]->phase >= 14) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_plouf[m_moveObject[i]->phase / 2 % 7]; - m_moveObject[i]->channel = 1; - } - } - if (m_moveObject[i]->type == 35) - { - if (m_moveObject[i]->phase >= 6) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_tiplouf[m_moveObject[i]->phase / 2 % 7]; - m_moveObject[i]->channel = 1; - } - } - if (m_moveObject[i]->type == 15) - { - m_moveObject[i]->icon = table_blup[m_moveObject[i]->phase / 2 % 20]; - m_moveObject[i]->channel = 1; - } - if (m_moveObject[i]->type == 4) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_bulldozer_turn2l[m_moveObject[i]->time % 22]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_bulldozer_turn2r[m_moveObject[i]->time % 22]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_bulldozer_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_bulldozer_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_bulldozer_turn2r[m_moveObject[i]->time % 22]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_bulldozer_turn2l[m_moveObject[i]->time % 22]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_bulldozer_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_bulldozer_left[m_moveObject[i]->time % 8]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 17) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_poisson_turn2l[m_moveObject[i]->time % 48]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_poisson_turn2r[m_moveObject[i]->time % 48]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_poisson_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_poisson_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_poisson_turn2r[m_moveObject[i]->time % 48]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_poisson_turn2l[m_moveObject[i]->time % 48]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_poisson_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_poisson_left[m_moveObject[i]->time % 8]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 20) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_oiseau_turn2l[m_moveObject[i]->time % 10]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_oiseau_turn2r[m_moveObject[i]->time % 10]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_oiseau_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_oiseau_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_oiseau_turn2r[m_moveObject[i]->time % 10]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_oiseau_turn2l[m_moveObject[i]->time % 10]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_oiseau_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_oiseau_left[m_moveObject[i]->time % 8]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 44) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_guepe_turn2l[m_moveObject[i]->time % 5]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_guepe_turn2r[m_moveObject[i]->time % 5]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_guepe_left[m_moveObject[i]->time % 6]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_guepe_right[m_moveObject[i]->time % 6]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_guepe_turn2r[m_moveObject[i]->time % 5]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_guepe_turn2l[m_moveObject[i]->time % 5]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_guepe_right[m_moveObject[i]->time % 6]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_guepe_left[m_moveObject[i]->time % 6]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 54) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_creature_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_creature_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_creature_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_creature_left[m_moveObject[i]->time % 8]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 32) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_blupih_turn2l[m_moveObject[i]->time % 26]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_blupih_turn2r[m_moveObject[i]->time % 26]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_blupih_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_blupih_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_blupih_turn2r[m_moveObject[i]->time % 26]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_blupih_turn2l[m_moveObject[i]->time % 26]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_blupih_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_blupih_left[m_moveObject[i]->time % 8]; - } - } - if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 21) - { - pos.x = m_moveObject[i]->posCurrent.x; - pos.y = m_moveObject[i]->posCurrent.y + 40; - if (ObjectStart(pos, 23, 55) != -1) - { - PlaySoundB(52, pos, 0); - } - } - } - if (m_moveObject[i]->type == 33) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_blupit_turn2l[m_moveObject[i]->time % 24]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_blupit_turn2r[m_moveObject[i]->time % 24]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_blupit_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_blupit_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_blupit_turn2r[m_moveObject[i]->time % 24]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_blupit_turn2l[m_moveObject[i]->time % 24]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_blupit_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_blupit_left[m_moveObject[i]->time % 8]; - } - } - if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 3) - { - int speed; - if ((m_moveObject[i]->posStart.x < m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 1) || (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 3)) - { - pos.x = m_moveObject[i]->posCurrent.x - 30; - pos.y = m_moveObject[i]->posCurrent.x + BLUPIOFFY; - speed = -5; - } - else - { - pos.x = m_moveObject[i]->posCurrent.x + 30; - pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY; - speed = 5; - } - if (ObjectStart(pos, 23, speed) != -1) - { - PlaySoundB(52, pos, 0); - } - } - if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 21) - { - int speed; - if ((m_moveObject[i]->posStart.x < m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 1) || (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 3)) - { - pos.x = m_moveObject[i]->posCurrent.x + 30; - pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY; - speed = 5; - } - else - { - pos.x = m_moveObject[i]->posCurrent.x - 30; - pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY; - speed = -5; - } - if (ObjectStart(pos, 23, speed) != -1) - { - PlaySoundB(52, pos, 0); - } - } - } - if (m_moveObject[i]->type == 34) - { - m_moveObject[i]->icon = table_glu[m_moveObject[i]->phase / 1 % 25]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 37) - { - if (m_moveObject[i]->phase >= 70) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_clear[m_moveObject[i]->phase / 1 % 70]; - m_moveObject[i]->channel = 10; - } - } - if (m_moveObject[i]->type == 38) - { - if (m_moveObject[i]->phase >= 90) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_electro[m_moveObject[i]->phase / 1 % 90]; - if (m_moveObject[i]->phase < 30) - { - m_moveObject[i]->channel = 12; - } - else - { - m_moveObject[i]->channel = 10; - } - } - } - if (m_moveObject[i]->type == 13) - { - m_moveObject[i]->icon = 68; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 46) - { - m_moveObject[i]->icon = 208; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 19) - { - m_moveObject[i]->icon = 89; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 28) - { - m_moveObject[i]->icon = 167; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 23) - { - m_moveObject[i]->icon = 176; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 29) - { - m_moveObject[i]->icon = 177; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 30) - { - m_moveObject[i]->icon = 178; - m_moveObject[i]->channel = 10; - } - m_moveObject[i]->phase = m_moveObject[i]->phase + 1; - if (m_moveObject[i]->phase > 32700) - { - m_moveObject[i]->phase = 0; - } -} - - -void CDecor::DynamiteStart(int i, int dx, int dy) -{ - POINT posStart = m_moveObject[i]->posStart; - posStart.x -= 34; - posStart.y -= 34; - posStart.x += dx; - posStart.y -= dy; - ObjectStart(posStart, 8, 0); - if (dx == 0 && dy == 0) - { - PlaySoundB(SOUND_10_BOUM, posStart, 0); - m_decorAction = 1; - m_decorPhase = 0; - } - RECT src; - src.left = posStart.x; - src.right = posStart.x + 128; - src.top = posStart.y; - src.bottom = posStart.y + 128; - POINT tinyPoint; - for (int j = 0; j < 2; j++) - { - tinyPoint.x = posStart.x / 64; - for (int k = 0; k < 2; j++) - { - if (tinyPoint.x >= 0 && tinyPoint.x < 100 && tinyPoint.y >= 0 && tinyPoint.y < 100) - { - int icon = m_decor[tinyPoint.x, tinyPoint.y]->icon; - if (icon == 378 || icon == 379 || icon == 404 || icon == 410) - { - POINT pos; - pos.x = tinyPoint.x * 64; - pos.y = tinyPoint.y * 64; - ModifDecor(pos, -1, TRUE); - } - } - tinyPoint.x++; - } - tinyPoint.y++; - } - for (i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 2 || m_moveObject[i]->type == 3 || m_moveObject[i]->type == 96 || m_moveObject[i]->type == 97 || m_moveObject[i]->type == 4 || - m_moveObject[i]->type == 6 || m_moveObject[i]->type == 12 || m_moveObject[i]->type == 13 || m_moveObject[i]->type == 16 || m_moveObject[i]->type == 17 || - m_moveObject[i]->type == 19 || m_moveObject[i]->type == 20 || m_moveObject[i]->type == 24 || m_moveObject[i]->type == 25 || m_moveObject[i]->type == 26 || m_moveObject[i]->type == 28 || - m_moveObject[i]->type == 30 || m_moveObject[i]->type == 32 || m_moveObject[i]->type == 33 || m_moveObject[i]->type == 34 || m_moveObject[i]->type == 40 || m_moveObject[i]->type == 44 || - m_moveObject[i]->type == 46 || m_moveObject[i]->type == 52 || m_moveObject[i]->type == 54 || m_moveObject[i]->type == 200 || m_moveObject[i]->type == 201 || m_moveObject[i]->type == 202 || - m_moveObject[i]->type == 203) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x; - src2.right = m_moveObject[i]->posCurrent.x + 60; - src2.top = m_moveObject[i]->posCurrent.y; - src2.bottom = m_moveObject[i]->posCurrent.y + 20; - RECT tinyRect; - - if (IntersectRect(&tinyRect, &src2, &src)) - { - if (m_moveObject[i]->type == 12) - { - SearchLinkCaisse(i, TRUE); - for (int l = 0; l < m_nbLinkCaisse; l++) - { - int channel = m_moveObject[m_linkCaisse[l]]->channel; - int icon2 = m_moveObject[m_linkCaisse[l]]->icon; - POINT posCurrent = m_moveObject[m_linkCaisse[l]]->posCurrent; - double num = (double)Random(7, 23); - if (rand() % 2 == 0) - { - num = -num; - } - m_moveObject[m_linkCaisse[l]]->type = 0; - } - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 0); - UpdateCaisse(); - } - else - { - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 0); - } - } - - } - } - if (m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPos.x > posStart.x - 30 && m_blupiPos.x < posStart.x + 30 + 64 && m_blupiPos.y > posStart.y - 30 && m_blupiPos.y < posStart.y + 30 + 64) - { - BlupiDead(11, -1); - m_blupiAir = TRUE; - } - + //if (bNetDebug) FUN_2bfb0("debug.txt"); } - -/* -int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos) -{ - if (m_blupiTimeNoAsc != 0) - { - return -1; - } - int num = newpos.y - oldpos.y; - int num2; - if (num < 0) - { - num2 = -30; - } - else - { - num2 = 30; - } - num = abs(num); - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48) - { - RECT src; - src.left = m_moveObject[i]->posCurrent.x; - src.right = m_moveObject[i]->posCurrent.x + 64; - src.top = m_moveObject[i]->posCurrent.y; - src.bottom = m_moveObject[i]->posCurrent.y + 16; - if (num < 30) - { - tagRECT tinyRect; - if (IntersectRect(tinyRect, src, rect)) - { - return i; - } - } - else - { - RECT src2 = rect; - src2.top -= num / 30 * num2; - src2.bottom -= num / 30 * num2; - for (int j = 0; j <= num / 30; j++) - { - tagRECT tinyRect; - if (IntersectRect(tinyRect, src, src2)) - { - return i; - } - src2.top += num2; - src2.bottom += num; - } - } - - } - } - return -1; -} - -void CDecor::AscenseurVertigo(int i, BOOL bVertigoLeft, BOOL bVertigoRight) -{ - bVertigoLeft = FALSE; - bVertigoRight = FALSE; - if (m_blupiPos.x + 20 + 4 < m_moveObject[i]->posCurrent.x) - { - bVertigoLeft = TRUE; - } - if (m_blupiPos.x + 60 - 20 - 4 > m_moveObject[i]->posCurrent.x + 64) - { - bVertigoRight = TRUE; - } - if (AscenseurShift(i)) - { - if (bVertigoLeft) - { - bVertigoLeft = FALSE; - bVertigoRight = TRUE; - m_blupiTimeNoAsc = 10; - return; - } - if (bVertigoRight) - { - bVertigoRight = FALSE; - bVertigoLeft = TRUE; - m_blupiTimeNoAsc = 10; - } - } -} -*/ - -BOOL CDecor::AscenseurShift(int i) -{ - return i != -1 && m_moveObject[i]->icon >= 311 && m_moveObject[i]->icon <= 316; -} - -void CDecor::AscenseurSynchro(int i) +void CDecor::OutputNetDebug(char* text) { - for (i = 0; i < MAXMOVEOBJECT; i++) - { - m_moveObject[i]->posCurrent = m_moveObject[i]->posStart; - m_moveObject[i]->step = 1; - m_moveObject[i]->time = 0; - m_moveObject[i]->phase = 0; - } -} + char textbuffer[100]; -int CDecor::CaisseInFront() -{ - POINT tinyPoint; - if (m_blupiDir == 1) - { - tinyPoint.x = m_blupiPos.x + 16 - 32; - tinyPoint.y = m_blupiPos.y; - } - else - { - tinyPoint.x = m_blupiPos.x + 60 - 16 + 32; - tinyPoint.y = m_blupiPos.y; - } - for (int i = 0; i < m_nbRankCaisse; i++) - { - int num = m_rankCaisse[i]; - if (tinyPoint.x > m_moveObject[num]->posCurrent.x && - tinyPoint.x < m_moveObject[num]->posCurrent.x + 64 && - tinyPoint.y > m_moveObject[num]->posCurrent.y && - tinyPoint.y < m_moveObject[num]->posCurrent.y + 64) - { - return num; - } - } - return -1; -} + if (!m_bNetDebug) return; -int CDecor::CaisseGetMove(int max) -{ - max -= (m_nbLinkCaisse - 1) / 2; - if (max < 1) - { - max = 1; - } - if (m_blupiPower) - { - max *= 2; - } - if (m_blupiPhase < 20) - { - max = max * m_blupiPhase / 20; - if (max == 0) - { - max++; - } - } - return max; + sprintf(textbuffer, "/ snd=%d(%d)_rcv=%d(%d)", m_netPacketsSent, m_netPacketsSent2, m_netPacketsReceived, m_netPacketsReceived2); + // ...? } - -int CDecor::MockeryDetect(POINT pos) +void CDecor::SetMulti(BOOL multi) { - if (m_blupiTimeMockery > 0) - { - return 0; - } - if (m_blupiAir) - { - POINT tinyPoint; - tinyPoint.x = pos.x + 30; - tinyPoint.y = pos.y + 30 + 64; - if (tinyPoint.x >= 0 && tinyPoint.x < 6400 && tinyPoint.y >= 0 && tinyPoint.y < 6400) - { - int icon = m_decor[tinyPoint.x / 64, tinyPoint.y / 64]->icon; - if (icon == 68 || icon == 317) - { - return 64; - } - } - } - RECT src; - src.left = pos.x; - src.right = pos.x + 60; - src.top = pos.y + 11; - src.bottom = pos.y + 60; - if (m_blupiAir) - { - src.bottom += 90; - } - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 2 || - m_moveObject[i]->type == 16 || - m_moveObject[i]->type == 96 || - m_moveObject[i]->type == 97 || - m_moveObject[i]->type == 4 || - m_moveObject[i]->type == 20 || - m_moveObject[i]->type == 44 || - m_moveObject[i]->type == 54 || - m_moveObject[i]->type == 23 || - m_moveObject[i]->type == 32 || - m_moveObject[i]->type == 33) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x; - src2.right = m_moveObject[i]->posCurrent.x + 60; - src2.top = m_moveObject[i]->posCurrent.y + 36; - src2.bottom = m_moveObject[i]->posCurrent.y + 60; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - if (m_moveObject[i]->type == 54) - { - return 83; - } - if (m_blupiDir == 2) - { - if (pos.x >= src2.left) - { - return 64; - } - if (m_moveObject[i]->type == 2) - { - return 0; - } - return 63; - } - else - { - if (pos.x < src2.left) - { - return 64; - } - if (m_moveObject[i]->type == 2) - { - return 0; - } - return 63; - } - } - */ - } - } - return 0; -} - -BOOL CDecor::BlupiElectro(POINT pos) -{ - if (m_blupiCloud) - { - return FALSE; - } - RECT src; - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - src.top = pos.y + 11; - src.bottom = pos.y + 60 - 2; - RECT src2; - src2.left = m_blupiPos.x - 16 - 40; - src2.right = m_blupiPos.x + 60 + 16 + 40; - src2.top = m_blupiPos.y + 11 - 40; - src2.bottom = m_blupiPos.y + 60 - 2 + 40; - RECT tinyRect; - return FALSE; //IntersectRect(tinyRect, src, src2); -} - -void CDecor::MoveObjectFollow(POINT pos) -{ - if (m_blupiHide) - { - return; - } - RECT src = BlupiRect(pos); - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 96) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x - 100; - src2.right = m_moveObject[i]->posCurrent.x + 60 + 100; - src2.top = m_moveObject[i]->posCurrent.y - 100; - src2.bottom = m_moveObject[i]->posCurrent.y + 60 + 100; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - m_moveObject[i]->type = 97; - PlaySoundB(SOUND_92_FOLLOW, m_moveObject[i]->posCurrent, 0); - } - */ - } - } -} - -int CDecor::MoveObjectDetect(POINT pos, BOOL bNear) -{ - RECT src = BlupiRect(pos); - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - RECT src2; - src2.left = src.left - 20; - src2.right = src.right + 20; - src2.top = src.top - 40; - src2.bottom = src.bottom + 30; - - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0 && - m_moveObject[i]->type != 27 && - m_moveObject[i]->type != 57 && - m_moveObject[i]->type != 39 && - m_moveObject[i]->type != 58 && - m_moveObject[i]->type != 34 && - m_moveObject[i]->type != 37 && - m_moveObject[i]->type != 38 && - (m_blupiAction != 14 && m_blupiAction != 29) || - m_moveObject[i]->type != 12) - { - RECT src3; - - } - } - if (199 < pos.x) - { - return -1; - } -} - -int CDecor::MoveAscenseurDetect(POINT pos, int height) -{ - if (m_blupiTimeNoAsc != 0) - { - return -1; - } - RECT src; - src.left = pos.x + 12; - src.right = pos.x + 60 - 12; - src.top = pos.y + 60 - 2; - src.bottom = pos.y + 60 + height - 1; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x; - src2.right = m_moveObject[i]->posCurrent.x + 64; - src2.top = m_moveObject[i]->posCurrent.y; - src2.bottom = m_moveObject[i]->posCurrent.y + 16; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - return i; - } - */ - } - } - return -1; -} - -int CDecor::MoveChargeDetect(POINT pos) -{ - RECT src; - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - src.top = pos.y + 11; - src.bottom = pos.y + 60 - 2; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 31) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x - 10; - src2.right = m_moveObject[i]->posCurrent.x + 60 + 10; - src2.top = m_moveObject[i]->posCurrent.y + 36; - src2.bottom = m_moveObject[i]->posCurrent.y + 60; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - return i; - } - */ - } - } - return -1; -} - -int CDecor::MovePersoDetect(POINT pos) -{ - RECT src; - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - src.top = pos.y + 11; - src.bottom = pos.y + 60 - 2; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type >= 200 && m_moveObject[i]->type <= 203) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x - 16; - src2.right = m_moveObject[i]->posCurrent.x + 60 + 16; - src2.top = m_moveObject[i]->posCurrent.y + 36; - src2.bottom = m_moveObject[i]->posCurrent.y + 60; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - return i; - } - */ - } - } - return -1; -} - -int CDecor::MoveObjectDelete(POINT cel) -{ - int result = -1; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0) - { - if (cel.x == m_moveObject[i]->posStart.x / 64 && cel.y == m_moveObject[i]->posStart.y / 64) - { - result = m_moveObject[i]->type; - m_moveObject[i]->type = 0; - } - else if (cel.x == m_moveObject[i]->posEnd.x / 64 && cel.y == m_moveObject[i]->posEnd.y / 64) - { - result = m_moveObject[i]->type; - m_moveObject[i]->type = 0; - } - } - } - return result; -} - -int CDecor::MoveObjectFree() -{ - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 0) - { - m_moveObject[i]->type = 0; - return i; - } - } - return -1; -} - -int CDecor::SortGetType(int type) -{ - if (type == 2 || type == 3 || type == 96 || type == 97) - { - return 1; - } - if (type == 12) - { - return 2; - } - return 3; -} - -void CDecor::MoveObjectSort() -{ - int num = 0; - int i; - MoveObject* object; - MoveObject* moveObject; - - *(MoveObject*)moveObject = m_moveObject[100][100]; - - for (i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0) - { - num++; - object = (MoveObject*)m_moveObject; - moveObject += 48; - memcpy(object, m_moveObject, 48); - } - moveObject += 24; - i--; - } - for (i = num; i < MAXMOVEOBJECT; i++) - { - m_moveObject[i]->type = 0; - } - if (num <= 1) - { - return; - } - BOOL flag; - do - { - flag = FALSE; - for (int i = 0; i < num - 1; i++) - { - if (SortGetType(m_moveObject[i]->type) > SortGetType(m_moveObject[i + 1]->type)) - { - flag = TRUE; - } - } - } while (flag); - UpdateCaisse(); - m_nbLinkCaisse = 0; -} - - -void CDecor::MoveObjectPriority(int i) -{ - if ((i != 0) && (m_moveObject + i, m_moveObject[i]->type == TYPE_BALLE)) - { - - } + m_bMulti = multi; } -int CDecor::MoveObjectSearch(POINT pos) +void CDecor::SetTeam(int team) { - return MoveObjectSearch(pos, -1); + m_team = team; } -int CDecor::MoveObjectSearch(POINT pos, int type) +POINT CDecor::VoyageGetPosVie(int nbVies) { - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0 && (type == -1 || - m_moveObject[i]->type == type)) - { - if (m_moveObject[i]->type == 23 && - m_moveObject[i]->posStart.x != m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->posCurrent.x >= pos.x - 100 && - m_moveObject[i]->posCurrent.x <= pos.x + 100 && - m_moveObject[i]->posCurrent.y == pos.y) - { - return i; - } - } - else if (m_moveObject[i]->type == 23 && - m_moveObject[i]->posStart.y != m_moveObject[i]->posEnd.y) - { - if (m_moveObject[i]->posCurrent.y >= pos.y - 100 && - m_moveObject[i]->posCurrent.y <= pos.y + 100 && - m_moveObject[i]->posCurrent.x == pos.x) - { - return i; - } - } - else if (m_moveObject[i]->posCurrent.x == pos.x && - m_moveObject[i]->posCurrent.y == pos.y) - { - return i; - } - } - } - return -1; + return { nbVies * 20 - 5, 417 }; } void CDecor::VoyageInit(POINT start, POINT end, int icon, int channel) @@ -8569,801 +1557,184 @@ void CDecor::VoyageInit(POINT start, POINT end, int icon, int channel) void CDecor::VoyageStep() { - UINT time; - if (m_voyageIcon != -1) +} + +void CDecor::VoyageDraw() +{ + +} + +BOOL CDecor::DrawMap(BOOL bPlay, int team) +{ + return FALSE; +} + +BOOL CDecor::SearchWorld(int world, POINT *blupi, int *dir) +{ + return FALSE; +} + +BOOL CDecor::SearchDoor(int n, POINT *cel, POINT *blupi) +{ + for (int i = 0; i < 100; i++) { - if (m_voyagePhase < m_voyageTotal) + for (int j = 0; j < 100; j++) { - time = m_time >> 31; - if ((((((m_time ^ time) - time & 1 ^ time) == time) && (229 < m_voyageIcon)) && (m_voyageIcon < 242)) && ((m_voyageChannel == CHELEMENT && (m_voyageIcon = m_voyageChannel + 1, 241 < m_voyageIcon + 1)))) + int icon = m_decor[i][j].icon; + if (icon >= 174 && icon <= 181 && icon - 174 + 1 == n) { - m_voyageIcon = icon_element_blupiangel; - m_voyagePhase = m_voyagePhase + 1; - return; - } - } - else - { - if (m_voyageIcon == icon_blupi_life) - { - m_voyageIcon = GetBlupiChannelActual(); - if (m_voyageIcon == m_voyageIcon) + if (i > 0 && m_decor[i - 1, j]->icon == 182) { - m_blupiAction = ACTION_STOP; - m_blupiPhase = 0; - m_blupiFocus = TRUE; - m_energyUnused = 100; + cel->x = i - 1; + cel->y = j; + blupi->x = (i - 2) * 64 + 2; + blupi->y = j * 64 + BLUPIOFFY; + return TRUE; + } + if (i > 1 && m_decor[i - 2, j]->icon == 182) + { + cel->x = i - 2; + cel->y = j; + blupi->x = (i - 3) * 64 + 2; + blupi->y = j * 64 + BLUPIOFFY; + return TRUE; + } + if (i < 99 && m_decor[i + 1, j]->icon == 182) + { + cel->x = i + 1; + cel->y = j; + blupi->x = (i + 2) * 64 + 2; + blupi->y = j * 64 + BLUPIOFFY; + return TRUE; + } + if (i < 98 && m_decor[i + 2, j]->icon == 182) + { + cel->x = i + 2; + cel->y = j; + blupi->x = (i + 3) * 64 + 2; + blupi->y = j * 64 + BLUPIOFFY; + return TRUE; } } - if ((m_voyageIcon == icon_element_egg) && (m_voyageChannel == CHELEMENT)) - { - m_nbVies = m_nbVies + 1; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_chest) && (m_voyageChannel == CHELEMENT)) - { - m_nbTresor = m_nbTresor + 1; - OpenDoorsTresor(); - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_keyred) && (m_voyageChannel == CHELEMENT)) - { - m_blupiCle = m_blupiCle | 1; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_keygreen) && (m_voyageChannel == CHELEMENT)) - { - m_blupiCle = m_blupiCle | 2; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_keyblue) && (m_voyageChannel == CHELEMENT)) - { - m_blupiCle = m_blupiCle | 4; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == GetIconPerso()) && (m_voyageChannel == CHBUTTON)) - { - m_blupiPerso = m_blupiPerso + 1; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_dynamite) && (m_voyageChannel == CHELEMENT)) - { - m_blupiDynamite = m_blupiDynamite + 1; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_gluepile) && (m_voyageChannel == CHELEMENT)) - { - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - m_voyageIcon = -1; } - m_voyagePhase = m_voyagePhase + 1; } - return; + return FALSE; } -// Add VoyageDraw - -BOOL CDecor::IsFloatingObject(int i) +void CDecor::AdaptDoors(BOOL bPrivate, int mission) { - POINT posCurrent = m_moveObject[i]->posCurrent; - int num = (posCurrent.x + 32) / 64; - int num2 = posCurrent.y / 64 + 1; - int icon = m_decor[num, num2]->icon; - return IsPassIcon(icon); -} -BOOL CDecor::IsRightBorder(int x, int y, int dx, int dy) -{ - return TRUE; -} - -BOOL CDecor::IsFromage(int x, int y) -{ - if (x < 0 || x >= 100 || y < 0 || y >= 100) - { - return FALSE; - } - int icon = m_decor[x, y]->icon; - return (icon >= 246 && icon <= 249) || icon == 339; -} - -BOOL CDecor::IsGrotte(int x, int y) -{ - if (x < 0 || x >= 100 || y < 0 || y >= 100) - { - return FALSE; - } - int icon = m_decor[x, y]->icon; - return icon = 284 || icon == 301 || icon == 337; -} - -void CDecor::AdaptMidBorder(int x, int y) -{ - if (x < 0 || x >= 100 || y < 0 || y >= 100) - { - return; - } - int num = 15; - if (!IsRightBorder(x, y + 1, 0, -1)) - { - num &= -2; - } - if (!IsRightBorder(x, y + 1, 0, 1)) - { - num &= -3; - } - if (!IsRightBorder(x + 1, y, -1, 0)) - { - num &= -5; - } - if (!IsRightBorder(x - 1, y, 1, 0)) - { - num &= -9; - } - int num2 = m_decor[x, y]->icon; - if (num2 == 156) - { - num2 = 35; - } - if (num2 == 252 || num2 == 253) - { - num2 = 251; - } - if (num2 == 255) - { - num2 = 254; - } - if (num2 == 362) - { - num2 = 347; - } - if (num2 == 363) - { - num2 = 348; - } - if (num2 >= 341 && num2 <= 346) - { - num2 = 341; - } - for (int i = 0; i < 144; i++) - { - if (num2 == table_adapt_decor[i]) - { - num2 = table_adapt_decor[i / 16 * 16 + num]; - if (num2 == 35 && rand() % 2 == 0) - { - num2 = 156; - } - if (num2 == 251) - { - num2 = Random(251, 253); - } - if (num2 == 254 && rand() % 2 == 0) - { - num2 = 255; - } - if (num2 == 347 && rand() % 2 == 0) - { - num2 = 362; - } - if (num2 == 348 && rand() % 2 == 0) - { - num2 = 363; - } - if (num2 == 341) - { - num2 = Random(341, 346); - } - m_decor[x, y]->icon = num2; - return; - } - } - num2 = m_decor[x, y]->icon; - if (num2 == -1 || (num2 >= 264 && num2 <= 282)) - { - num = 15; - if (!IsFromage(x, y + 1)) - { - num &= -2; - } - if (!IsFromage(x, y - 1)) - { - num &= -3; - } - if (!IsFromage(x + 1, y)) - { - num &= -5; - } - if (!IsFromage(x - 1, y)) - { - num &= -9; - } - num2 = table_adapt_fromage[num]; - if (num2 == 268 && rand() % 2 == 0) - { - num2 = 279; - } - if (num2 == 269 && rand() % 2 == 0) - { - num2 = 280; - } - if (num2 == 264 && rand() % 2 == 0) - { - num2 = 281; - } - if (num2 == 265 && rand() % 2 == 0) - { - num2 = 282; - } - m_decor[x, y]->icon = num2; - } - num2 = m_decor[x, y]->icon; - if (num2 == -1 || (num2 >= 285 && num2 <= 303 && num2 != 301)) - { - num = 15; - if (!IsGrotte(x, y + 1)) - { - num &= -2; - } - if (!IsGrotte(x, y - 1)) - { - num &= -3; - } - if (!IsGrotte(x + 1, y)) - { - num &= -5; - } - if (!IsGrotte(x - 1, y)) - { - num &= -9; - } - num2 = table_adapt_fromage[num + 16]; - if (num2 == 289 && rand() % 2 == 0) - { - num2 == 300; - } - if (num2 == 285 && rand() % 2 == 0) - { - num2 = 302; - } - if (num2 == 286 && rand() % 2 == 0) - { - num2 = 303; - } - m_decor[x, y]->icon = num2; - } -} - -void CDecor::AdaptBorder(POINT cel) -{ - AdaptMidBorder(cel.x, cel.y); - AdaptMidBorder(cel.x + 1, cel.y); - AdaptMidBorder(cel.x - 1, cel.y); - AdaptMidBorder(cel.x, cel.y + 1); - AdaptMidBorder(cel.x, cel.y - 1); - int icon = m_decor[cel.x, cel.y]->icon; - if (icon != -1 && !IsPassIcon(icon)) - { - MoveObjectDelete(cel); - } - icon = m_decor[cel.x, cel.y]->icon; - if (icon == 304) - { - for (int i = 0; i < 4; i++) - { - cel.y++; - if (cel.y >= 100) - { - break; - } - icon = m_decor[cel.x, cel.y]->icon; - if (icon != -1) - { - break; - } - m_decor[cel.x, cel.y]->icon = 305; - } - } - if (icon == -1) - { - for (int i = 0; i < 4; i++) - { - cel.y++; - if (cel.y >= 100) - { - return; - } - icon = m_decor[cel.x, cel.y]->icon; - if (icon != 305) - { - return; - } - m_decor[cel.x, cel.y]->icon = -1; - } - } -} - -BOOL CDecor::SearchDoor(int n, POINT cel, POINT blupi) -{ - for (int i = 0; i < 100; i++) - { - for (int j = 0; j < 100; j++) - { - int icon = m_decor[i, j]->icon; - if (icon >= 174 && icon <= 181 && icon - 174 + 1 == n) - { - if (i > 0 && m_decor[i - 1, j]->icon == 182) - { - cel.x = i - 1; - cel.y = j; - blupi.x = (i - 2) * 64 + 2; - blupi.y = j * 64 + BLUPIOFFY; - return TRUE; - } - if (i > 1 && m_decor[i - 2, j]->icon == 182) - { - cel.x = i - 2; - cel.y = j; - blupi.x = (i - 3) * 64 + 2; - blupi.y = j * 64 + BLUPIOFFY; - return TRUE; - } - if (i < 99 && m_decor[i + 1, j]->icon == 182) - { - cel.x = i + 1; - cel.y = j; - blupi.x = (i + 2) * 64 + 2; - blupi.y = j * 64 + BLUPIOFFY; - return TRUE; - } - if (i < 98 && m_decor[i + 2, j]->icon == 182) - { - cel.x = i + 2; - cel.y = j; - blupi.x = (i + 3) * 64 + 2; - blupi.y = j * 64 + BLUPIOFFY; - return TRUE; - } - } - } - } - return FALSE; -} - -BOOL CDecor::SearchGold(int n, POINT cel) -{ - for (int i = 99; i >= 0; i--) - { - for (int j = 99; j >= 0; j--) - { - if (m_decor[j, i]->icon == 183) - { - cel.x = j; - cel.y = i; - return TRUE; - } - } - } - return FALSE; } void CDecor::OpenDoorsTresor() { - for (int i = 0; i < 100; i++) - { - for (int j = 0; j < 100; j++) - { - int icon = m_decor[i, j]->icon; - if (icon >= 421 && icon <= 421 + m_nbTresor - 1) - { - POINT cel; - cel.x = i; - cel.y = j; - OpenDoor(cel); - } - } - } + for (int x = 0; x < MAXCELX; x++) + { + for (int y = 0; y < MAXCELY; y++) + { + int icon = m_decor[x][y].icon; + if (icon >= 0x1a5 && icon <= 0x1a5 + m_nbTresor - 1) + { + OpenDoor({ x, y }); + } + } + } } void CDecor::OpenDoor(POINT cel) { - int icon = m_decor[cel.x, cel.y]->icon; - m_decor[cel.x, cel.y]->icon = -1; - int num = MoveObjectFree(); - m_moveObject[num]->type = 22; - m_moveObject[num]->stepAdvance = 50; - m_moveObject[num]->stepRecede = 1; - m_moveObject[num]->timeStopStart = 0; - m_moveObject[num]->timeStopEnd = 0; - m_moveObject[num]->posStart.x = 64 * cel.x; - m_moveObject[num]->posStart.y = 64 * cel.y; - m_moveObject[num]->posEnd.x = 64 * cel.x; - m_moveObject[num]->posEnd.y = 64 * (cel.y - 1); - m_moveObject[num]->posCurrent = m_moveObject[num]->posStart; - m_moveObject[num]->step = 1; - m_moveObject[num]->time = 0; - m_moveObject[num]->phase = 0; - m_moveObject[num]->channel = 1; - m_moveObject[num]->icon = icon; - PlaySoundB(SOUND_33_DOOR, m_moveObject[num]->posStart, 0); + int icon = m_decor[cel.x][cel.y].icon; + m_decor[cel.x, cel.y]->icon = -1; + int num = MoveObjectFree(); + m_moveObject[num].type = TYPE_DOOR; + m_moveObject[num].stepAdvance = 50; + m_moveObject[num].stepRecede = 1; + m_moveObject[num].timeStopStart = 0; + m_moveObject[num].timeStopEnd = 0; + m_moveObject[num].posStart.x = DIMOBJX * cel.x; + m_moveObject[num].posStart.y = DIMOBJY * cel.y; + m_moveObject[num].posEnd.x = DIMOBJX * cel.x; + m_moveObject[num].posEnd.y = DIMOBJY * (cel.y - 1); + m_moveObject[num].posCurrent = m_moveObject[num].posStart; + m_moveObject[num].step = STEP_STOPSTART; + m_moveObject[num].time = 0; + m_moveObject[num].phase = 0; + m_moveObject[num].channel = CHOBJECT; + m_moveObject[num].icon = icon; + PlaySound(33, m_moveObject[num].posStart, FALSE); } void CDecor::OpenDoorsWin() { - m_doors[m_mission + 1] = 1; + m_doors[m_mission + 1] = 1; } void CDecor::OpenGoldsWin() { - m_doors[180 + m_mission / 10] = 1; + m_doors[180 + m_mission / 10] = 1; } void CDecor::DoorsLost() { - m_nbVies = 3; -} - -void CDecor::OutputNetDebug(char* text) -{ - char textbuffer[100]; - - if (m_bNetDebug != FALSE) - { - sprintf(textbuffer, "/ snd=%d(%d)_rcv=%d(%d)", m_netPacketsSent, m_netPacketsSent2, m_netPacketsRecieved, m_netPacketsRecieved2); - strcat(text, textbuffer); - } - return; -} - -void CDecor::InitalizeDoors(BYTE* doors) -{ - int i; - - for (i = 0; i < 200; i++) - { - *(BYTE*)(i + doors) = m_doors[i]; - } - return; -} - -void CDecor::GetBlupiInfo(BOOL bHelico, BOOL bJeep, BOOL bSkate, BOOL bNage) -{ - bHelico = m_blupiHelico; - bJeep = (m_blupiJeep) | (m_blupiTank); - bSkate = m_blupiSkate; - bNage = (m_blupiNage) | (m_blupiSurf); -} - -char* CDecor::GetMissionTitle() -{ - return m_missionTitle; -} - -void CDecor::GetMissionsCleared() -{ - -} - -void CDecor::SetDemoState(BOOL demoState) -{ - m_demoState = demoState; -} - -void CDecor::GetMissionPath(char* str, int user, int mission, BOOL bUser) -{ - if (bUser != 0) - { - sprintf(str, "data\%.3d-%.3d.blp", user, mission); - AddUserPath(str); - return; - } - sprintf(str, "data\world%.3d.blp", mission); - AddUserPath(str); - return; + m_nbVies = 3; + // more... } +// Winphone functions, likely unnecessary /* -BOOL CDecor::CurrentRead(int gamer, int mission, BOOL bUser) +BOOL CDecor::SearchGold(int n, POINT cel) { - char filename[MAX_PATH]; - FILE* file = NULL; - int* pBuffer = NULL; - int nb, i, num; - int* num2; - POINT* num3; - - InitDecor(); - GetMissionPath(filename, gamer, mission, bUser); - file = fopen(filename, "rb"); - - if (!file) - { - pBuffer = (int*)malloc(868); - if (pBuffer != NULL) if (file != NULL) fclose(file); - - } - +for (int i = 99; i >= 0; i--) +{ +for (int j = 99; j >= 0; j--) +{ +if (m_decor[j][i].icon == 183) +{ +cel.x = j; +cel.y = i; +return TRUE; } -*/ - -/* -BOOL CDecor::MissionStart(int gamer, int rank, BOOL bUser) -{ - char filename[MAX_PATH]; - int* pBuffer; - FILE* stream; - int num; - Cellule(*pDecor)[100]; - - pBuffer = NULL; - sprintf(filename, "data\\s%.3d-%.3d.blp", gamer, rank); - AddUserPath(filename); - stream = fopen(filename, "wb"); - - if (!stream) - { - pBuffer = (int*)malloc(57008); - if (pBuffer == NULL) if (stream != NULL) fclose(stream); - } - - if (pBuffer) - { - memset(pBuffer, 0, 57008); - *pBuffer = 57008; - pBuffer[1] = 1; - pBuffer[2] = 4; - pBuffer[3] = 0; - memcpy(pBuffer + 53, m_decor, 20000); - memcpy(pBuffer + 5053, m_bigDecor, 20000); - memcpy(pBuffer + 10053, m_balleTraj, 1300); - memcpy(pBuffer + 10378, m_moveTraj, 1300); - memcpy(pBuffer + 10703, m_moveObject, 9600); - pBuffer[13153] = m_posDecor.x; - pBuffer[13154] = m_posDecor.y; - pBuffer[13155] = m_dimDecor.x; - pBuffer[13156] = m_dimDecor.y; - pBuffer[13157] = m_phase; - pBuffer[13158] = m_term; - pBuffer[13159] = m_music; - pBuffer[13160] = m_region; - pBuffer[13161] = m_time; - memcpy(pBuffer + 13162, m_missionTitle, 100); - pBuffer[13237] = m_nbRankCaisse; - memcpy(pBuffer + 13238, m_rankCaisse, 804); - pBuffer[13438] = m_nbLinkCaisse; - memcpy(pBuffer + 13439, m_linkCaisse, 800); - } - } -*/ - -BOOL CDecor::Read(int gamer, int rank, BOOL* pbMission, BOOL* pbPrivate) -{ - int* ptr; - int i; - int num; - FILE* stream; - char pBuffer[260]; - - ptr = NULL; - sprintf(pBuffer, "data\\s%.3d-%.3d.blp", gamer, rank); - stream = fopen(pBuffer, "rb"); - - if (stream != NULL) - { - ptr = (int*)malloc(57008); - if (ptr == NULL) if (stream != NULL) fclose(stream); - } - if (fread(ptr, 57008, 1, stream) < 1 || *ptr != 57008) - { - memcpy(m_decor, ptr + 53, 20000); - memcpy(m_bigDecor, ptr + 5053, 20000); - } - if (ptr[2] < 3) - { - FlushBalleTraj(); - } - else - { - memcpy(m_balleTraj, ptr + 10053, 1300); - } - if (ptr[2] < 4) - { - FlushMoveTraj(); - } - else - { - memcpy(m_moveTraj, ptr + 10378, 1300); - memcpy(m_moveObject, ptr + 10703, 9600); - } - m_posDecor.x = ptr[13153]; - m_posDecor.y = ptr[13154]; - m_dimDecor.x = ptr[13155]; - m_dimDecor.y = ptr[13156]; - m_phase = (WMessage)ptr[13157]; - m_term = ptr[13158]; - m_music = ptr[13159]; - m_region = ptr[13160]; - m_time = ptr[13161]; - memcpy(m_missionTitle, ptr + 13162, 100); - m_nbRankCaisse = ptr[13237]; - memcpy((int*)m_nbRankCaisse, ptr + 13238, 804); - memcpy((int*)m_nbLinkCaisse, ptr + 13438, 800); - m_blupiPos.x = ptr[13689]; - m_blupiPos.y = ptr[13690]; - m_blupiValidPos.x = ptr[13691]; - m_blupiValidPos.y = ptr[13692]; - m_blupiAction = ptr[13693]; - m_blupiDir = ptr[13694]; - m_blupiPhase = ptr[13695]; - m_blupiIcon = *(Icon4*)(ptr + 13698); - m_blupiSec = ptr[13699]; - m_blupiChannel.blupiChannel = *(short*)(ptr + 13700); - m_blupiVector.x = ptr[13701]; - m_blupiVector.y = ptr[13702]; - m_blupiTransport = ptr[13703]; - m_blupiFocus = ptr[13704]; - m_blupiAir = ptr[13705]; - m_blupiHelico = ptr[13706]; - m_blupiOver = ptr[13756]; - m_blupiJeep = ptr[13707]; - m_blupiTank = ptr[13708]; - m_blupiSkate = ptr[13709]; - m_blupiNage = ptr[13710]; - m_blupiSurf = ptr[13711]; - m_blupiVent = ptr[13712]; - m_blupiSuspend = ptr[13713]; - m_blupiJumpAie = ptr[13714]; - m_blupiShield = ptr[13715]; - m_blupiPower = ptr[13716]; - m_blupiCloud = ptr[13717]; - m_blupiHide = ptr[13718]; - m_blupiInvert = ptr[13754]; - m_blupiBalloon = ptr[13755]; - m_blupiEcrase = ptr[13757]; - m_blupiPosHelico.x = ptr[13719]; - m_blupiPosHelico.y = ptr[13720]; - m_blupiPosMagic.x = ptr[13721]; - m_blupiPosMagic.y = ptr[13722]; - m_blupiRestart = ptr[13723]; - m_blupiFront = ptr[13724]; - m_blupiBullet = ptr[13725]; - m_blupiCle = ptr[13726]; - m_blupiPerso = ptr[13727]; - m_blupiDynamite = ptr[13759]; - m_blupiNoBarre = ptr[13728]; - m_blupiTimeShield = ptr[13729]; - m_blupiTimeFire = ptr[13730]; - m_blupiTimeNoAsc = ptr[13758]; - m_blupiTimeOuf = ptr[13731]; - m_blupiActionOuf = ptr[13732]; - m_blupiFifoNb = ptr[13733]; - memcpy(m_blupiFifoPos, ptr + 13734, 80); - memcpy(m_blupiStartPos, ptr + 13801, 32); - m_blupiStartDir[0] = ptr[13809]; - m_blupiStartDir[1] = ptr[13810]; - m_blupiStartDir[2] = ptr[13811]; - m_blupiStartDir[3] = ptr[13812]; - - i = 2; - num = (int)ptr + 13865; - while (i != 0) - { - int jauges = (int)m_jauges; - num++; - jauges++; - i--; - } - m_blupiLevel = ptr[13869]; - m_energyUnused = ptr[13870]; - m_bHelicopterFlying = ptr[13921]; - m_bHelicopterStationary = ptr[13922]; - m_bJeepMarch = ptr[13923]; - m_bJeepStop = ptr[13924]; - m_bFoundCle = ptr[13975]; - m_bPrivate = ptr[13976]; - m_bCheatDoors = ptr[13977]; - m_bSuperBlupi = ptr[13978]; - m_bShowSecret = ptr[13979]; - m_bJoystick = ptr[13980]; - m_mission = ptr[13982]; - memcpy(m_doors, ptr + 13983, 216); - m_lives = ptr[14033]; - m_nbTresor = ptr[14034]; - m_totalTresor = ptr[14034]; - m_goalPhase = ptr[14036]; - m_scrollPoint.x = ptr[14088]; - m_scrollPoint.y = ptr[14089]; - m_scrollAdd.x = ptr[14090]; - m_scrollAdd.y = ptr[14091]; - m_voyageIcon = ptr[14142]; - m_voyageChannel = ptr[14143]; - m_voyagePhase = ptr[14144]; - m_voyageTotal = ptr[14145]; - m_voyageStart.x = ptr[14146]; - m_voyageStart.y = ptr[14147]; - m_voyageEnd.x = ptr[14148]; - m_voyageEnd.y = ptr[14149]; - m_decorAction = ptr[14200]; - m_decorPhase = ptr[14201]; - *pbPrivate = m_bPrivate; - *pbMission = m_mission; - free(ptr); - fclose(stream); - return FALSE; +} +return FALSE; } -/* -BOOL CDecor::Write(int gamer, int mission, char* pFilename) +BOOL CDecor::IsFloatingObject(int i) { - int* ptr; - int i = 0; - int num = 0; - int string1, string2, string3; - FILE* stream; - char format[100]; - char buffer[260]; - - ptr = 0; - sprintf(buffer, "data\\s%.3d-%.3d.blp", gamer, mission); - AddUserPath(buffer); - stream = fopen(buffer, "rb"); - - if (stream != 0) - { - ptr = (int*)malloc(57008); - if (ptr == NULL) if (stream != NULL) fclose(stream); - } - if (fread(ptr, 57008, 1, stream) && (*ptr == 57008)) - { - while (i < 200) - { - i++; - if ((i + 55932 + ptr) == '\0') - { - num++; - } - } - if (ptr[13976] == 0) - { - i = ptr[13982]; - if (i == 99) - { - LoadString(TX_GAMEWRITE, format, 100); - sprintf(pFilename, format, num, ptr[14033], ptr[14034], ptr[14035]); - } - else - { - if (i < 99) - { - LoadString(i / 10 + TX_GAMEFINAL, format, 100); - i = ptr[14035]; - string1 = ptr[14034]; - string2 = ptr[14033]; - string3 = ptr[13982] % 10; - } - else - { - LoadString(TX_GAMEMISS, format, 100); - i = ptr[14035]; - string1 = ptr[14034]; - string2 = ptr[14033]; - string3 = ptr[13982]; - } - sprintf(pFilename, format, string3, num, string2, string1, i); - } - } - else - { - LoadString(TX_GAMEDES, format, 100); - sprintf(pFilename, format, ptr[13982], ptr[14034], ptr[14035]); - } - free(ptr); - fclose(stream); - return TRUE; - } - return FALSE; +POINT posCurrent = m_moveObject[i]->posCurrent; +int num = (posCurrent.x + 32) / 64; +int num2 = posCurrent.y / 64 + 1; +int icon = m_decor[num, num2]->icon; +return IsPassIcon(icon); } -*/ \ No newline at end of file + +BOOL CDecor::IsNormalJump(POINT pos) +{ +pos.x += 32; +pos.y -= 32; +if (m_blupiDir == 1) +{ +pos.x -= 15; +} +else +{ +pos.x += 15; +} +for (int i = 0; i < 2; i++) +{ +int num = pos.x / DIMOBJX; +int num2 = pos.y / DIMOBJY; +if (num2 < 0) +{ +return FALSE; +} +int icon = m_decor[num, num2]->icon; +if (!IsPassIcon(icon)) +{ +return FALSE; +} +pos.y -= 64; +} +return TRUE; +}*/ \ No newline at end of file diff --git a/src/decor.h b/src/decor.h index 64cbeaa..7b13bfa 100644 --- a/src/decor.h +++ b/src/decor.h @@ -1,317 +1,68 @@ // Decor.h - #pragma once -using namespace std; - -#include -#include -#include -#include "def.h" +#include "DEF.H" +#include "JAUGE.H" +#include "SOUND.H" +#include "PIXMAP.H" #include "network.h" -#include "jauge.h" - ///////////////////////////////////////////////////////////////////////////// +#define MAXNETMESSAGE 20 +#define MAXMOVEOBJECT 200 +#define MAXNOTIF 4 +#define MAXNETPLAYER 4 -#define MAXENERGY 4000 -#define MAXFIRE 400 +#define MAXQUART 441 +#define SCROLL_SPEED 8 +#define SCROLL_MARGX 80 +#define SCROLL_MARGY 40 -#define ICON_HILI_STAT 112 -#define ICON_HILI_SEL 113 -#define ICON_HILI_ANY 114 -#define ICON_HILI_OP 115 -#define ICON_HILI_GO 117 -#define ICON_HILI_BUILD 118 -#define ICON_HILI_ERR 119 -#define ICON_BUTTON_PERSONALBOMBICON 108 -#define MAXMOVEOBJECT 200 - //#define MAXQUART 441 -#define BLUPIFLOOR 2 -#define BLUPIOFFY 4 + BLUPIFLOOR -#define BLUPISURF 12 -#define BLUPISUSPEND 12 -#define OVERHEIGHT 80 -#define MAXQUART 441 +#define BLUPIFLOOR 2 +#define BLUPIOFFY 4 + BLUPIFLOOR +#define BLUPISURF 12 +#define BLUPISUSPEND 12 +#define OVERHEIGHT 80 + +#define TEXTDELAY 10 // tooltip popup delay +#define NOTIFDELAY 200 -// Descripteur d'une cellule du d�cor. typedef struct { - short floorChannel; - short floorIcon; - short objectChannel; - short objectIcon; - short fog; // brouillard - short rankMove; // rang dans m_move - short workBlupi; // rang du blupi travaillant ici - short fire; - short icon; + short icon; } Cellule; -// Cette structure doit �tre la plus petite possible, car -// il en existe un tableau de 100x100 = 10'000 cellules ! - -// Descripteur d'un blupi anim�. -#define MAXBLUPI 100 -#define MAXUSED 50 -#define MAXLIST 10 typedef struct { - BOOL bExist; // TRUE -> utilis� - BOOL bHili; // TRUE -> s�lectionn� - - short perso; - short goalAction; // action (long terme) - short goalPhase; // phase (long terme) - POINT goalCel; // cellule vis�e (long terme) - POINT passCel; // cellule tranversante - - short energy; // �nergie restante - - POINT cel; // cellule actuelle - POINT destCel; // cellule destination - short action; // action en cours - short aDirect; // direction actuelle - short sDirect; // direction souhait�e - - POINT pos; // position relative � partir de la cellule - short posZ; // d�placement z + short type; + short stepAdvance; + short stepRecede; + short timeStopStart; + short timeStopEnd; + short unknown1; + POINT posStart; + POINT posEnd; + POINT posCurrent; + short step; + short time; + short phase; short channel; - short lastIcon; short icon; - short phase; // phase dans l'action - short step; // pas global - short interrupt; // 0=prioritaire, 1=normal, 2=misc - short clipLeft; - - int nbUsed; // nb de points d�j� visit�s - char nextRankUsed; - POINT posUsed[MAXUSED]; - char rankUsed[MAXUSED]; - - short takeChannel; // objet transport� - short takeIcon; - - POINT fix; // point fixe (cultive, pont) - - short jaugePhase; - short jaugeMax; - short stop; // 1 -> devra stopper - short bArrow; // TRUE -> fl�che en dessus de blupi - short bRepeat; // TRUE -> r�p�te l'action - short nLoop; // nb de boucles pour GOAL_OTHERLOOP - short cLoop; // boucle en cours - short vIcon; // ic�ne variable - POINT goalHili; // but vis� - short bMalade; // TRUE -> blupi malade - short bCache; // TRUE -> cach� (pas dessin�) - short vehicule; // v�hicule utilis� par blupi, voir (**) - char busyCount; - char busyDelay; - char clicCount; - char clicDelay; - char reserve2[2]; - short listButton[MAXLIST]; - POINT listCel[MAXLIST]; - short listParam[MAXLIST]; - short repeatLevelHope; - short repeatLevel; - short reserve3[88]; -} -Blupi; - -// (*) Personnages : -// 0 -> blupi -// 1 -> araign�e -// 2 -> virus -// 3 -> tracks -// 4 -> robot -// 5 -> bombe -// 6 -> d�tonnateur de mine (invisible) -// 7 -> �lectro -// 8 -> disciple (robot2) - -// (**) V�hicule : -// 0 -> � pied -// 1 -> en bateau -// 2 -> en jeep -// 3 -> armure - -typedef struct -{ - int type; - int stepAdvance; - int stepRecede; - int timeStopStart; - int timeStopEnd; - POINT posStart; - POINT posEnd; - POINT posCurrent; - int step; - int time; - int phase; - int channel; - int icon; + short unknown2; } MoveObject; typedef struct { - short icon; - short type; -} -Icon4; - -typedef struct -{ + char type; + char data1; + short x; + short y; short channel; - short blupiChannel; - short itemChannel; } -IconChannel; - -typedef enum -{ - icon_element_chest = 6, - icon_element_egg = 21, - icon_element_blupiburn = 40, - icon_blupi_life = 48, - icon_button_personalbombyellow = 108, - icon_element_glueball = 176, - icon_element_gluepile = 177, - icon_element_keyred = 215, - icon_element_keygreen = 222, - icon_element_keyblue = 229, - icon_element_blupiangel = 230, - icon_element_dynamite = 252 -} -IconItem; - -typedef enum -{ - STEP_STOPSTART = 1, - STEP_ADVANCE = 2, - STEP_STOPEND = 3, - STEP_RECEDE = 4 -} -MoveObjectStep; - -typedef enum -{ - TYPE_EMPTY, - TYPE_ASCENSEUR, - TYPE_BOMBEDOWN, - TYPE_BOMBEUP, - TYPE_CAISSE, - TYPE_GOAL, - TYPE_CLE, - TYPE_BLUPIHELICO, - TYPE_BLUPITANK, - TYPE_BALLE, - TYPE_DOOR -} -MoveObjectType; - -typedef enum -{ - WM_NOMUSIC = 1044 -} -WMessage; - -typedef enum -{ - DIR_LEFT, - DIR_RIGHT -} -Direction; - - -typedef struct -{ - short move_frames_forward; - short move_frames_backward; - short delay_frames_start; - short delay_frames_end; - POINT pos_start; - POINT pos_end; - POINT pos; - short move_phase; - short move_timer; - short life_time; - short channel; - short icon; -} -PersoType; - -typedef struct -{ - short move_frames_forward; - short move_frames_backward; - short delay_frames_start; - short delay_frames_end; - POINT pos_start; - POINT pos_end; - POINT pos; - short move_phase; - short move_timer; - short life_time; - short channel; - short icon; -} -Perso; - - - -// Descripteur d'un d�cor anim�. -#define MAXMOVE 100 -#define MOVEICONNB 1000 - -typedef struct -{ - BOOL bExist; // TRUE -> utilis� - - POINT cel; // cellule du d�cor - short rankBlupi; // blupi travaillant ici - - BOOL bFloor; // TRUE -> floor, FALSE -> object - short channel; - short icon; - short maskChannel; - short maskIcon; - short phase; // phase pour pMoves ou pIcon - short rankMoves; // *nb,dx,dy,... - short rankIcons; // *nb,i,i,... - - short total; // nb total d'�tapes - short delai; // d�lai entre deux pas - short stepY; // pas vertical *100 - - short cTotal; - short cDelai; -} -Move; - -typedef struct -{ - short majRev; - short minRev; - short reserve1[100]; - POINT posDecor; - POINT dimDecor; - short world; - short music; - short region; - short reserve2[51]; - POINT blupiPos[4]; - int blupiDir[4]; - char name[100]; - short reserve3[196]; -} -DescFile; - -#define MAXLASTDRAPEAU 50 +NetMessage; class CDecor { @@ -319,334 +70,73 @@ public: CDecor(); ~CDecor(); - // Arrange.cpp - void ArrangeFloor(POINT cel); - void ArrangeMur(POINT cel, int &icon, int index); - void ArrangeBuild(POINT cel, int &channel, int &icon); - void ArrangeObject(POINT cel); - - BOOL ArrangeFillTestFloor(POINT cel1, POINT cel2); - BOOL ArrangeFillTest(POINT pos); - void ArrangeFillPut(POINT pos, int channel, int icon); - void ArrangeFillSearch(POINT pos); - void ArrangeFill(POINT pos, int channel, int icon, BOOL bFloor); - - void ArrangeBlupi(); - - // Obstacle.cpp - void SearchFloor(int rank, int icon, POINT cel, int *pBits); - void SearchObject(int rank, int icon, POINT cel, int *pBits); - void AjustFloor(int rank, int icon, POINT cel, int *pBits); - void AjustObject(int rank, int icon, POINT cel, int *pBits); - BOOL IsFreeDirect(POINT cel, int direct, int rank); - BOOL IsFreeCelObstacle(POINT cel); - BOOL IsFreeCelFloor(POINT cel, int rank); - BOOL IsFreeCelGo(POINT cel, int rank); - BOOL IsFreeCelHili(POINT cel, int rank); - BOOL IsFreeCel(POINT cel, int rank); - BOOL IsFreeCelDepose(POINT cel, int rank); - BOOL IsFreeCelEmbarque(POINT cel, int rank, int &action, POINT &limit); - BOOL IsFreeCelDebarque(POINT cel, int rank, int &action, POINT &limit); - BOOL IsFreeJump(POINT cel, int direct, int rank, int &action); - BOOL IsFreeGlisse(POINT cel, int direct, int rank, int &action); - int DirectSearch(POINT cel, POINT goal); - void FlushUsed(int rank); - void AddUsedPos(int rank, POINT pos); - BOOL IsUsedPos(int rank, POINT pos); - BOOL SearchBestBase(int rank, int &action, POINT &newCel, int &direct); - BOOL SearchBestPass(int rank, int &action); - BOOL IsWorkableObject(POINT cel, int rank); - BOOL SearchOtherObject(int rank, POINT initCel, int action, - int distMax, int channel, - int firstIcon1, int lastIcon1, - int firstIcon2, int lastIcon2, - POINT &foundCel, int &foundIcon); - BOOL SearchOtherDrapeau(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL SearchOtherBateau(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL IsSpiderObject(int icon); - BOOL SearchSpiderObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL IsTracksObject(int icon); - BOOL SearchTracksObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL IsRobotObject(int icon); - BOOL SearchRobotObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon, - int &foundAction); - BOOL IsBombeObject(int icon); - BOOL SearchBombeObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL SearchElectroObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL IsUsineBuild(int rank, POINT cel); - BOOL IsUsineFree(int rank, POINT cel); - BOOL IsFireCel(POINT cel); - BOOL IsVirusCel(POINT cel); - int IsBuildPont(POINT &cel, int &iconBuild); - BOOL IsBuildBateau(POINT cel, int &direct); - void InitDrapeau(); - void AddDrapeau(POINT cel); - void SubDrapeau(POINT cel); - BOOL TestDrapeau(POINT cel); - - // DecBlupi.cpp - void BlupiFlush(); - int BlupiCreate(POINT cel, int action, int direct, - int perso, int energy); - BOOL BlupiDelete(POINT cel, int perso=-1); - void BlupiDelete(int rank); - void BlupiKill(int exRank, POINT cel, int type); - BOOL BlupiIfExist(int rank); - void BlupiCheat(int cheat); - void BlupiActualise(int rank); - void BlupiAdaptIcon(int rank); - void BlupiPushFog(int rank); - void BlupiSound(int rank, int sound, POINT pos, BOOL bStop=FALSE); - void BlupiInitAction(int rank, int action, int direct=-1); - void BlupiChangeAction(int rank, int action, int direct=-1); - void ListFlush(int rank); - int ListGetParam(int rank, int button, POINT cel); - BOOL ListPut(int rank, int button, POINT cel, POINT cMem); - void ListRemove(int rank); - int ListSearch(int rank, int button, POINT cel, int &textForButton); - BOOL RepeatAdjust(int rank, int button, POINT &cel, POINT &cMem, - int param, int list); - void GoalStart(int rank, int action, POINT cel); - BOOL GoalNextPhase(int rank); - void SetTotalTime(int total); - int GetTotalTime(); - void GoalInitJauge(int rank); - void GoalInitPassCel(int rank); - void GoalAdjustCel(int rank, int &x, int &y); - BOOL GoalNextOp(int rank, short *pTable); - void GoalUnwork(int rank); - void GoalStop(int rank, BOOL bError=FALSE, BOOL bSound=TRUE); - BOOL BlupiIsGoalUsed(POINT cel); - void BlupiStartStopRayon(int rank, POINT startCel, POINT endCel); - BOOL BlupiRotate(int rank); - BOOL BlupiNextAction(int rank); - void BlupiNextGoal(int rank); - void BlupiStep(BOOL bFirst); - void BlupiGetRect(int rank, RECT &rect); - int GetTargetBlupi(POINT pos); - void BlupiDeselect(); - void BlupiDeselect(int rank); - void BlupiSetArrow(int rank, BOOL bArrow); - void InitOutlineRect(); - void BlupiHiliDown(POINT pos, BOOL bAdd=FALSE); - void BlupiHiliMove(POINT pos, BOOL bAdd=FALSE); - void BlupiHiliUp(POINT pos, BOOL bAdd=FALSE); - void BlupiDrawHili(); - int GetDefButton(POINT cel); - BOOL BlupiGoal(int rank, int button, POINT cel, POINT cMem); - void BlupiGoal(POINT cel, int button); - void BlupiDestCel(int rank); - BOOL IsTracksHere(POINT cel, BOOL bSkipInMove); - BOOL IsBlupiHereEx(POINT cel1, POINT cel2, int exRank, BOOL bSkipInMove); - BOOL IsBlupiHereEx(POINT cel, int exRank, BOOL bSkipInMove); - BOOL IsBlupiHere(POINT cel, BOOL bSkipInMove); - BOOL IsBlupiHere(POINT cel, int direct, BOOL bSkipInMove); - void GetLevelJauge(int *pLevels, int *pTypes); - BOOL IsWorkBlupi(int rank); - void BlupiGetButtons(POINT pos, int &nb, int *pButtons, int *pErrors, int &perso); - void TerminatedInit(); - int IsTerminated(); - Term* GetTerminated(); - - // DecMove.cpp - void MoveFlush(); - int MoveMaxFire(); - void MoveFixInit(); - BOOL MoveCreate(POINT cel, int rankBlupi, BOOL bFloor, - int channel, int icon, - int maskChannel, int maskIcon, - int total, int delai, int stepY, - BOOL bMisc=FALSE, BOOL bNotIfExist=FALSE); - BOOL MoveAddMoves(POINT cel, int rankMoves); - BOOL MoveAddIcons(POINT cel, int rankIcons, BOOL bContinue=FALSE); - BOOL MoveStartFire(POINT cel); - void MoveProxiFire(POINT cel); - void MoveFire(int rank); - void MoveStep(); - void MoveFinish(POINT cel); - void MoveFinish(int rankBlupi); - BOOL MoveIsUsed(POINT cel); - BOOL MoveGetObject(POINT cel, int &channel, int &icon); - BOOL MovePutObject(POINT cel, int channel, int icon); - - // DecIO.cpp - BOOL Write(int gamer, int mission, char* rank); - BOOL Read(int gamer, int rank, BOOL* pbMission, BOOL* pbPrivate); - BOOL FileExist(int rank, BOOL bUser, int &world, int &time, int &total); - void Flush(); - - // DecMap.cpp - void MapInitColors(); - POINT ConvCelToMap(POINT cel); - POINT ConvMapToCel(POINT pos); - BOOL MapMove(POINT pos); - void MapPutCel(POINT pos); - BOOL GenerateMap(); - - // DecStat.cpp - void StatisticInit(); - void StatisticUpdate(); - int StatisticGetBlupi(); - int StatisticGetFire(); - void StatisticDraw(); - void GenerateStatictic(); - BOOL StatisticDown(POINT pos, int fwKeys); - BOOL StatisticMove(POINT pos, int fwKeys); - BOOL StatisticUp(POINT pos, int fwKeys); - int StatisticDetect(POINT pos); - - // Chemin.cpp - void CheminMemPos(int exRank); - BOOL CheminTestPos(POINT pos, int &rank); - int CheminARebours(int rank); - void CheminFillTerrain(int rank); - BOOL CheminTestDirection(int rank, int pos, int dir, - int &next, int &li, - int &cout, int &action); - BOOL CheminCherche(int rank, int &action); - BOOL IsCheminFree(int rank, POINT dest, int button); - // Decor.cpp - void SetShiftOffset(POINT offset); - POINT ConvCelToPos(POINT cel); - POINT ConvPosToCel(POINT pos, BOOL bMap=FALSE); - POINT ConvPosToCel2(POINT pos); - - void Create(HWND hWnd, CSound *pSound, CPixmap *pPixmap, CNetwork *pNetwork); - + void Create(HWND hWnd, CSound *pSound, CPixmap *pPixmap, + CNetwork *pNetwork); BOOL LoadImages(); void InitGamer(); - BOOL AddLinkCaisse(int rank); void InitDecor(); - void InitAfterBuild(); + void SetTime(int time); + int GetTime(); void PlayPrepare(BOOL bTest); void BuildPrepare(); + int IsTerminated(); + void MoveStep(); + int GetBlupiChannelStandard(); + int GetBlupiChannelActual(); + int GetIconPerso(); void Build(RECT rect); - BOOL BlitzActif(int celx, int cely); void DrawInfo(); - void UpdateCaisse(); POINT DecorNextAction(); - void SetInput(UINT input); - void SetSpeedX(double speed); - void SetSpeedY(double speed); - int SoundEnviron(int sound, int obstacle); - void StopSound(Sound sound); - void AdaptMotorVehicleSound(); - BOOL TestPushCaisse(int i, POINT pos, BOOL bPop); - void SearchLinkCaisse(int rank, BOOL bPop); - void ResetHili(); - BOOL LoadBackgroundImages(); - BOOL TestPushOneCaisse(int i, POINT move, int b); - void ClearFog(); - void ClearFire(); - void SetBuild(BOOL bBuild); - void EnableFog(BOOL bEnable); - BOOL GetInvincible(); - void SetInvincible(BOOL bInvincible); - BOOL GetSuper(); - void SetSuper(BOOL bSuper); - void FlipOutline(); - BOOL PutFloor(POINT cel, int channel, int icon); - BOOL PutObject(POINT cel, int channel, int icon); - BOOL GetFloor(POINT cel, int &channel, int &icon); - BOOL GetObject(POINT cel, int &channel, int &icon); - BOOL SetFire(POINT cel, BOOL bFire); + void SetInput(int keys); + void SetJoystickEnable(BOOL bJoystick); + void SetFieldD814(BOOL param_1); + void PlaySound(int sound, POINT pos, BOOL bLocal); + void PlaySound(int sound, POINT pos); // hack + void StopSound(int sound); + void AdaptMotorVehicleSound(POINT pos); + void VehicleSoundsPhase(int phase); - void SetCoin(POINT coin, BOOL bCenter=FALSE); - POINT GetCoin(); - POINT GetHome(); - void MemoPos(int rank, BOOL bRecord); - - void SetTime(int time); - int GetTime(); - - void SetMusic(int music); - int GetMusic(); - - void SetSkill(int skill); - int GetSkill(); - - void SetRegion(int region); int GetRegion(); - - void SetInfoMode(BOOL bInfo); - BOOL GetInfoMode(); - void SetInfoHeight(int height); - int GetInfoHeight(); - - int GetTargetLevel(); - void GetBlupiInfo(BOOL bHelico, BOOL bJeep, BOOL bSkate, BOOL bNage); - void AdaptDoors(BOOL bPrivate, int mission); - - char* GetButtonExist(); - - void BuildPutBlupi(); - void BuildMoveFloor(int x, int y, POINT pos, int rank); - void BuildMoveObject(int x, int y, POINT pos, int rank); - void BuildGround(RECT clip); - void Build(RECT clip, POINT posMouse); - void NextPhase(int mode); - - int CountFloor(int channel, int icon); - int CelOkForAction(POINT cel, int action, int rank, - int icons[4][4], - POINT &celOutline1, - POINT &celOutline2); - int CelOkForAction(POINT cel, int action, int rank); - int GetHiliRankBlupi(int nb); - void CelHili(POINT pos, int action); - void CelHiliButton(POINT cel, int button); - void CelHiliRepeat(int list); - int GetResHili(POINT posMouse); - void HideTooltips(BOOL bHide); - - void UndoOpen(); - void UndoClose(); - void UndoCopy(); - void UndoBack(); - BOOL IsUndo(); - BOOL GetNetPacked(); - BOOL GetNetMovePredict(); - UINT GetPhase(); - char* GetMissionTitle(); - void GetDims(POINT* ptr); - void SetDims(POINT dims); + void SetRegion(int region); + int GetMusic(); + void SetMusic(int music); + POINT GetDim(); + void SetDim(POINT dim); int GetNbVies(); - void SetNbVies(int lives); + void SetNbVies(int nbVies); BOOL GetPause(); void SetPause(BOOL bPause); - void GetDoors(int doors); - void InitalizeDoors(BYTE* doors); - void SetAllMissions(BOOL CheatDoors); - void CheatAction(int cheat, MoveObject moveObject); - void SetAccessBuild(BOOL build); - void SetNetPacked(BOOL net); - void SetNetMovePredict(BOOL netmove); + void InitializeDoors(BYTE *doors); + void MemorizeDoors(BYTE* doors); + void SetAllMissions(BOOL bAllMissions); + void CheatAction(int cheat); + BOOL GetSuperBlupi(); + void SetSuperBlupi(BOOL bSuperBlupi); + BOOL GetDrawSecret(); + void SetDrawSecret(BOOL bDrawSecret); + void SetBuildOfficialMissions(BOOL bBuildOfficialMissions); + BOOL GetNetPacked(); + void SetNetPacked(BOOL bNetPacked); + BOOL GetNetMovePredict(); + void SetNetMovePredict(BOOL bNetMovePredict); BOOL GetNetDebug(); - void SetMulti(int multi); + void SetNetDebug(BOOL bNetDebug); + void OutputNetDebug(char* text); + void SetMulti(BOOL bMulti); void SetTeam(int team); - void MoveObjectSort(); - BOOL BlupiIsGround(); - RECT BlupiRect(POINT pos); - void BlupiAdjust(); - BOOL BlupiBloque(POINT pos, int dir); - void BlupiDead(int action1, int action2); - POINT GetPosDecor(POINT pos); - void BlupiAddFifo(POINT pos); - void MoveObjectPlouf(POINT pos); - void MoveObjectTiplouf(POINT pos); - int GetBlupiChannelStandard(); - void MoveObjectBlup(POINT pos); + POINT VoyageGetPosVie(int nbVies); + void VoyageInit(POINT start, POINT end, int icon, int channel); + void VoyageStep(); + void VoyageDraw(); + BOOL DrawMap(BOOL bPlay, int team); + + // DecBlock.cpp + BOOL BlitzActif(POINT cel); + int SoundEnviron(int sound, int obstacle); int IsWorld(POINT pos); void ActiveSwitch(BOOL bState, POINT cel); - int GetTypeBarre(POINT pos); + int GetTypeBarre(POINT pos); BOOL IsLave(POINT pos); BOOL IsPiege(POINT pos); BOOL IsGoutte(POINT pos, BOOL bAlways); @@ -660,12 +150,60 @@ public: int IsDoor(POINT pos, POINT celPorte); int IsTeleporte(POINT pos); BOOL SearchTeleporte(POINT pos, POINT newpos); - BOOL IsNormalJump(POINT pos); BOOL IsSurfWater(POINT pos); BOOL IsDeepWater(POINT pos); BOOL IsOutWater(POINT pos); BOOL IsPassIcon(int icon); BOOL IsBlocIcon(int icon); + BOOL IsVentillo(POINT pos); + void ModifDecor(POINT pos, int icon, BOOL _foo); + void ModifDecor(POINT pos, int icon); // hack + BOOL IsRightBorder(POINT cel, POINT offset); + BOOL IsFromage(POINT cel); + BOOL IsGrotte(POINT cel); + void AdaptMidBorder(POINT cel); + void AdaptBorder(POINT cel); + + // DecDesign.cpp + POINT ScreenPosToCelPos(POINT pos); + void SetCelPosFromScreenPos(POINT pos); + void SetFieldCC38AndStuff(int _foo, int _bar); + void DeleteCel(POINT cel); + void PlaceMenuItem(short *pCel, int *pTable, int lastIndex, BYTE flags, int currentIcon, BOOL bRand); + void PlaceItemFromMenu1(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu2(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu3(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu4(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu6(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu8(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu9(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu10(POINT cel, int index, BYTE flags, int currentIcon); + char* GetMissionTitle(); + void SetMissionTitle(char *str); + + // DecBlupi.cpp + void BlupiSearchIcon(); + BOOL BlupiIsGround(); + RECT BlupiRect(POINT pos); + void BlupiAdjust(); + BOOL BlupiBloque(POINT pos, int dir); + void BlupiStep(); + void BlupiDead(int action, int action2); + POINT GetPosDecor(POINT pos); + void BlupiAddFifo(POINT pos); + BOOL DecorDetect(RECT rect, BOOL bCaisse); + BOOL DecorDetect(RECT rect); // hack + void GetBlupiInfo(BOOL *pbHelico, BOOL *pbJeep, BOOL *pbSkate, + BOOL *pbNage); + + // DecMove.cpp + BOOL TestPath(RECT rect, POINT start, POINT end); + void MoveObjectPollution(); + void MoveObjectPlouf(POINT pos); + void MoveObjectTiplouf(POINT pos); + void MoveObjectBlup(POINT pos); void FlushBalleTraj(); void SetBalleTraj(POINT pos); BOOL IsBalleTraj(POINT pos); @@ -673,413 +211,223 @@ public: void SetMoveTraj(POINT pos); BOOL IsMoveTraj(POINT pos); int SearchDistRight(POINT pos, POINT dir, int type); - BOOL IsVentillo(POINT pos); void StartSploutchGlu(POINT pos); - int ObjectStart(POINT pos, int type, int speed); - BOOL ObjectDelete(POINT pos, int type, int something); - void ModifDecor(POINT pos, int icon, BOOL bMulti); + BOOL ObjectStart(POINT pos, int type, int speed); + BOOL ObjectDelete(POINT pos, int type); void MoveObjectStep(); void MoveObjectStepLine(int i); - void MoveObjectStepIcon(int i); + void* MoveObjectStepIcon(int i); + void DynamiteStart(int i, int dx, int dy); + int AscenseurDetect(RECT rect, POINT oldpos, POINT newpos); + void AscenseurVertigo(int i, BOOL *pbVertigoLeft, BOOL *pbVertigoRight); + BOOL AscenseurShift(int i); + void AscenseurSynchro(int i); + void UpdateCaisse(); + BOOL TestPushCaisse(int i, POINT pos, BOOL bPop); + BOOL TestPushOneCaisse(int i, POINT move, int b); + void SearchLinkCaisse(int rank, BOOL bPop); + BOOL AddLinkCaisse(int rank); + int CaisseInFront(); + int CaisseGetMove(int max); + BOOL MockeryDetect(POINT pos); + BOOL BlupiElectro(POINT pos); void MoveObjectFollow(POINT pos); - int MoveObjectDetect(POINT pos, BOOL bNear); + int MoveObjectDetect(POINT pos, BOOL *pbNear); int MoveAscenseurDetect(POINT pos, int height); int MoveChargeDetect(POINT pos); int MovePersoDetect(POINT pos); - int MoveObjectDelete(POINT cel); + int MoveBalleDetect(POINT pos); + int MoveObjectDelete(POINT pos); int MoveObjectFree(); int SortGetType(int type); - int MoveObjectSearch(POINT pos); + void MoveObjectSort(); + void MoveObjectPriority(int i); int MoveObjectSearch(POINT pos, int type); - void VoyageInit(POINT start, POINT end, int icon, int channel); - void VoyageStep(); - BOOL IsFloatingObject(int i); - BOOL IsRightBorder(int x, int y, int dx, int dy); - BOOL IsFromage(int x, int y); - BOOL IsGrotte(int x, int y); - void AdaptMidBorder(int x, int y); - void PosSound(POINT pos); - void AdaptBorder(POINT cel); - void GetMissionPath(char* str, int user, int mission, BOOL bUser); - void DynamiteStart(int i, int dx, int dy); - int AscenseurDetect(RECT rect, POINT oldpos, POINT newpos); - void BlupiSearchIcon(); - void AscenseurVertigo(int i, BOOL bVertigoLeft, BOOL bVertigoRight); - BOOL AscenseurShift(int i); - void AscenseurSynchro(int i); - int CaisseInFront(); - int CaisseGetMove(int max); - int MockeryDetect(POINT pos); - BOOL BlupiElectro(POINT pos); - void BlupiStep(); - POINT ScreenPosToCelPos(POINT* pos, POINT cel); - BOOL DecorDetect(RECT rect); - BOOL DecorDetect(RECT rect, BOOL bCaisse); - BOOL SearchDoor(int n, POINT cel, POINT blupi); - BOOL SearchGold(int n, POINT cel); - BOOL TestPath(RECT rect, POINT start, POINT end); - void PlaySoundB(int sound, POINT pos, int net); + + // DecNet.cpp + void NetStopCloud(int rank); + void NetPlaySound(short channel, POINT pos); + void NetStopSound(short channel); + void NetDataFlush(); + void NetFUN_155e0(BYTE _foo, short _bar); + void TreatNetData(); + void DoNetSmooth(int player); + void NetFUN_15d50(); + void FUN_15da0(int rank, short step); + void NetPlayerCollide(POINT pos, int *out); + void NetMessageIndexFlush(); + BOOL NetMessagePush(NetMessage *message); + BOOL NetMessagePop(NetMessage *message); + void NotifFlush(); + void NotifPop(); + void NotifPush(char *str); + void NotifStep(); + + // DecIO.cpp + void GetMissionPath(char *out, int gamer, int mission, BOOL bUser); + BOOL CurrentWrite(int gamer, int mission, BOOL bUser); + BOOL CurrentRead(int gamer, int mission, BOOL bUser); + BOOL SomethingMissionPath(int gamer, int mission, BOOL bUser); + BOOL MissionStart(int gamer, int mission, BOOL bUser); + BOOL Read(int gamer, int mission, BOOL *pbMission, BOOL *pbPrivate); + BOOL Write(int gamer, int mission, char* param3); + + BOOL SearchWorld(int world, POINT *blupi, int *dir); + BOOL SearchDoor(int n, POINT *cel, POINT *blupi); + void AdaptDoors(BOOL bPrivate, int mission); void OpenDoorsTresor(); void OpenDoor(POINT cel); void OpenDoorsWin(); void OpenGoldsWin(); void DoorsLost(); - void GetMissionsCleared(); - void SetDemoState(BOOL demoState); - BOOL CurrentWrite(int gamer, int mission, BOOL bUser); - BOOL CurrentRead(int gamer, int mission, BOOL bUser); - void SetJoystickEnable(BOOL bJoystick); - BOOL GetShowSecret(); - BOOL MissionStart(int gamer, int rank, BOOL bUser); - void MemorizeDoors(BYTE* doors); - void NotifPush(char* str); - void DeleteCel(int celX, int celY); - void SetGamerName(const char* playerName); - BOOL SomethingMissionPath(int user, int mission, BOOL bUser); - void MoveObjectPriority(int i); - - - - // Network Related Functions - void NetMessageIndexFlush(); - void NotifFlush(); - void NetDataFlush(); - void NetPlaySound(short channel, POINT pos); - void NetStopCloud(int rank); - BOOL NetMessagePush(NetMessage* message); - BOOL DrawMap(BOOL bPlay, int player); - void NetSendData(BYTE bufferSize, UCHAR send); - void NetPlayerCollide(POINT pos, int* out); - void TreatNetData(); - void OutputNetDebug(char* text); - void NotifStep(); - void NotifPop(); - void SetNetDebug(BOOL bNetDebug); - - -protected: - BOOL GetSeeBits(POINT cel, char *pBits, int index); - int GetSeeIcon(char *pBits, int index); + inline void StopVehicleSound(); protected: HWND m_hWnd; CSound* m_pSound; CPixmap* m_pPixmap; - CNetwork* m_pNetwork; - NetMessage m_netMessages[20]; - MoveObject m_moveObject[100][100]; - int m_input; - int m_bJoystick; - int m_previousInput; - int m_blupiTimeShield; - POINT m_blupiPosMagic; - POINT m_blupiLastPos; - int m_balleTraj[1300]; - POINT m_blupiVector; - int m_blupiSec; - BOOL m_bSuperBlupi; - int m_blupiRealRotation; - int m_blupiTransport; - int m_detectIcon = -1; - POINT m_cameraPos; - int m_moveTraj[1300]; - POINT m_dimDecor; + CNetwork* m_pNetwork; + Cellule m_decor[MAXCELX][MAXCELY]; + Cellule m_bigDecor[MAXCELX][MAXCELY]; + byte m_balleTraj[MAXCELX * MAXCELY / 8 + 1]; + byte m_moveTraj[MAXCELX * MAXCELY / 8 + 1]; + MoveObject m_moveObject[MAXMOVEOBJECT]; + int m_keyPress; + int m_lastKeyPress; + POINT m_posDecor; + POINT m_dimDecor; + POINT m_posCelHili; POINT m_dimCelHili; - BOOL m_blupiRestart; - POINT m_worldDims; - POINT m_selectedCelPos; - WMessage m_phase; - int m_voyagePhase; - POINT m_sucettePos; - int m_sucetteType; - double m_blupiLastSpeedY; - int m_blupiTimeOuf; - double m_blupiLastSpeedX; - POINT m_posCelHili; int m_2ndPositionCalculationSlot; - int m_voyageTotal; - POINT m_voyageStart; - POINT m_voyageEnd; - int m_voyageChannel; - int m_targetMission; - char m_missionTitle[100]; - int m_nbCases; - int m_linkCaisse[MAXMOVEOBJECT]; - POINT m_blupiFifoPos[10]; - int m_caseIndexes[200]; - int m_nbSomethings; - int m_blupiOffsetY; - int m_somethingIndexes; - POINT m_pos; - POINT m_safePos; - POINT m_posDecor; - RECT m_drawBounds; - BYTE m_doors[200]; - int m_action; - int m_direction; - int m_actionFrameCount; - POINT m_velocity; - Icon4 m_blupiIcon; - POINT m_blupiStartPos[4]; - int m_blupiStartDir[4]; - int m_blupiAction; - BOOL m_bCheatDoors; - int m_blupiPhase; - /* - undefined - undefined - undefined - undefined - */ - Cellule m_decor[MAXCELX / 2][MAXCELY / 2]; - Cellule m_bigDecor[100][100]; - int m_decorAction; - int m_blupiLevel; - IconChannel m_blupiChannel; - int m_keyPress; - POINT m_activeConveyorVelocity; - int m_decorPhase; + int m_phase; + int m_term; + int m_music; + int m_region; + int m_lastRegion; + int m_iconLift; + int m_time; + char m_missionTitle[100]; + BOOL m_bPause; int m_nbRankCaisse; int m_rankCaisse[MAXMOVEOBJECT]; int m_nbLinkCaisse; - int m_activeLiftIndex; - double m_blupiSpeedX; - double m_blupiSpeedY; + int m_linkCaisse[MAXMOVEOBJECT]; + POINT m_blupiPos; + POINT m_blupiValidPos; + int m_blupiAction; + int m_blupiDir; + int m_blupiPhase; + POINT m_blupiVitesse; + int m_blupiIcon; + int m_blupiSec; + int m_blupiChannel; + POINT m_blupiVector; + int m_blupiTransport; BOOL m_blupiFocus; - BOOL m_blupiAir; - BOOL m_blupiHelico; - BOOL m_blupiOver; - BOOL m_blupiJeep; - BOOL m_bJeepMarch; - BOOL m_bJeepStop; - BOOL m_blupiTank; - BOOL m_blupiSkate; - BOOL m_blupiNage; - BOOL m_blupiSurf; - BOOL m_bInWind; - BOOL m_blupiVent; - BOOL m_blupiSuspend; - BOOL m_blupiJumpAie; - BOOL m_blupiShield; - BOOL m_blupiPower; - BOOL m_blupiCloud; - BOOL m_blupiHide; + BOOL m_blupiAir; + BOOL m_blupiHelico; + BOOL m_blupiOver; + BOOL m_blupiJeep; + BOOL m_blupiTank; + BOOL m_blupiSkate; + BOOL m_blupiNage; + BOOL m_blupiSurf; + BOOL m_blupiVent; + BOOL m_blupiSuspend; + BOOL m_blupiJumpAie; + BOOL m_blupiShield; + BOOL m_blupiPower; + BOOL m_blupiCloud; + BOOL m_blupiHide; BOOL m_blupiInvert; - BOOL m_blupiBalloon; - BOOL m_blupiEcrase; - BOOL m_blupiMotorHigh; - int m_blupiMotorSound; + BOOL m_blupiBalloon; + BOOL m_blupiEcrase; POINT m_blupiPosHelico; - int m_blupiActionOuf; - int m_blupiTimeNoAsc; - int m_blupiTimeMockery; - double m_blupiVitesseX; - double m_blupiVitesseY; - POINT m_blupiValidPos; + POINT m_blupiPosMagic; + BOOL m_blupiRestart; BOOL m_blupiFront; - int m_blupiNoBarre; - int m_blupiFifoNb; - CJauge m_jauges[2]; - BOOL m_bFoundCle; - BOOL m_bPause; - int m_blupiTimeFire; - int m_voyageIcon; int m_blupiBullet; int m_blupiCle; int m_blupiPerso; int m_blupiDynamite; - int m_nbTresor; - int m_totalTresor; - int m_goalPhase; - POINT m_scrollPoint; - POINT m_scrollAdd; - int m_nbVies; - BOOL m_bUseSafePosition; - BOOL m_bIsTerminating; - POINT m_blupiPos; - int m_blupiDir; - int m_lastDecorIcon[200]; - int m_glue; - int m_keys; - int m_personalBombs; - int m_dynamite; - int m_powerEnergy; - int m_queuedActionFrames; - int m_nbSafePositions; - POINT m_safePositions[13]; - int m_bMulti; - int m_team; - int m_netPacketsSent; - int m_netPacketsSent2; - int m_netPacketsRecieved; - int m_netPacketsRecieved2; - POINT m_netPositions[4]; - Icon4 m_netIcons[4]; - int m_netPlayerPacketsRecieved[4]; - int m_netPlayerPacketsRecieved2[4]; - int m_bNetTimeSincePacket[4]; - POINT m_netVitesses[4]; - POINT m_netPacketPosition; - Icon4 m_netPacketIcon; - NamedGUID m_netEvents[20]; - int m_netEventIndex1; - int m_netEventIndex2; - int m_netEventIndex3; + int m_blupiNoBarre; + int m_blupiTimeShield; + int m_blupiTimeFire; + int m_blupiTimeNoAsc; + int m_blupiTimeMockery; + int m_blupiTimeOuf; + int m_blupiActionOuf; + int m_blupiFifoNb; + POINT m_blupiFifoPos[10]; + POINT m_blupiStartPos[4]; + int m_blupiStartDir[4]; + BOOL m_bMulti; + int m_team; + int m_netPacketsSent; + int m_netPacketsSent2; + int m_netPacketsReceived; + int m_netPacketsReceived2; + POINT m_netPos[MAXNETPLAYER]; + int m_netIcons[MAXNETPLAYER]; + int m_netUnk1[MAXNETPLAYER]; + int m_netUnk2[MAXNETPLAYER]; + int m_netUnk3[MAXNETPLAYER]; + int m_netPlayerPacketsReceived[MAXNETPLAYER]; + int m_netPlayerPacketsReceived2[MAXNETPLAYER]; + int m_netTimeSincePacket[MAXNETPLAYER]; + POINT m_netVitesses[MAXNETPLAYER]; + POINT m_netUnk4[MAXNETPLAYER]; + POINT m_netPacketPos; + int m_netPacketIcon; + NetMessage m_netMessages[MAXNETMESSAGE]; int m_netMessageIndex1; int m_netMessageIndex2; int m_netMessageIndex3; - int m_menuType; - char m_messages[4][100]; - int m_air; - int m_energyUnused; - BOOL m_bHelicopterFlying; - BOOL m_bHelicopterStationary; - BOOL m_bCarMoving; - BOOL m_bCarStationary; - BOOL m_bWorldComplete; - BOOL m_bPrivate; - BOOL m_bAllMissions; // opendoors - BOOL m_bInvincible; // megablupi - BOOL m_bShowSecret; // showsecret - BOOL m_bAccessBuild; // xmission/xnjttjpo - BOOL m_bNetPacked; // netpacked - BOOL m_bNetMovePredict; // ynosmooth - BOOL m_bNetDebug; // znetdebug - BOOL m_demoState; - int m_mission; - BYTE m_missionsCleared[180]; - BYTE m_worldsCleared[20]; - int m_lives; - int m_chestsCollected; - int m_chestsTotal; - POINT m_cameraTargetPos; - POINT m_cameraTargetOffset; - int m_flyupIcon; - int m_flyupChannel; - int m_flyupFrameCount; - int m_flyupFrameTotal; - POINT m_flyupStartPos; - POINT m_flyupEndPos; - BOOL m_bScreenShake; - int m_screenShakeIndex; char m_notifText[4][100]; int m_notifTime; - int m_menuSelections[112]; - BYTE m_overloadProtection[100000]; - Cellule* m_pUndoDecor; - short m_rankBlupi[MAXCELX][MAXCELY]; - Blupi m_blupi[MAXBLUPI]; - Move m_move[MAXMOVE]; - POINT m_celCoin; // cellule sup/gauche - POINT m_celHome; // pour touche Home - POINT m_celHili; - POINT m_celOutline1; - POINT m_celOutline2; - POINT m_shiftOffset; - int m_iconHili[4][4]; - int m_rankHili; // rang du blupi vis� - BOOL m_bHiliRect; - POINT m_p1Hili; // coins rectangle de s�lection - POINT m_p2Hili; - int m_shiftHili; - int m_nbBlupiHili; // nb de blupi s�lectionn�s - int m_rankBlupiHili; // rang blupi s�lectionn� - BOOL m_bFog; // TRUE -> brouillard (jeu) - BOOL m_bBuild; // TRUE -> construction - BOOL m_bSuper; // TRUE -> cheat code - short m_colors[100]; - int m_time; // temps relatif global - int m_timeConst; // temps relatif global constant - int m_timeFlipOutline; // temps quand basculer mode outline - int m_totalTime; // temps total pass� sur une partie - POINT m_celArrow; // cellule avec fl�che - BOOL m_bOutline; - BOOL m_bGroundRedraw; - char m_buttonExist[MAXBUTTON]; - int m_statNb; // nb de statistiques - int m_statFirst; // premi�re statistique visible - int m_bStatUp; // fl�che up statistique - int m_bStatDown; // fl�che down statistique - int m_statHili; // statistique survol�e - BOOL m_bStatRecalc; // TRUE -> recalcule les statistiques - BOOL m_bStatRedraw; // TRUE -> redessine les statistiques - int m_nbStatHach; // nb de hachures - int m_nbStatHachBlupi; // hachures occup�es par blupi - int m_nbStatHachPlanche;// hachures occup�es par planches - int m_nbStatHachTomate; // hachures occup�es par tomates - int m_nbStatHachMetal; // hachures occup�es par m�tal - int m_nbStatHachRobot; // hachures occup�es par robot - int m_nbStatHome; // nb de maisons - int m_nbStatHomeBlupi; // maisons occup�es par blupi - int m_nbStatRobots; // nb d'ennemis - int m_term; // conditions pour gagner - int m_winCount; // compteur avant gagn� - int m_winLastHachBlupi; // dernier nombre atteint - int m_winLastHachPlanche;// dernier nombre atteint - int m_winLastHachTomate;// dernier nombre atteint - int m_winLastHachMetal; // dernier nombre atteint - int m_winLastHachRobot; // dernier nombre atteint - int m_winLastHome; // dernier nombre atteint - int m_winLastHomeBlupi; // dernier nombre atteint - int m_winLastRobots; // dernier nombre atteint - int m_music; // num�ro musique - int m_region; // num�ro r�gion (*) - int m_lastRegion; // num�ro derni�re r�gion - int m_blupiHere; - POINT m_lastDrapeau[MAXLASTDRAPEAU]; - BOOL m_bHideTooltips; // TRUE -> menu pr�sent - char m_text[50]; - POINT m_textLastPos; - int m_textCount; - int m_skill; - BOOL m_bInfo; - int m_infoHeight; - POINT m_memoPos[4]; - - BYTE m_cheminWork[MAXCELX*MAXCELY]; - int m_cheminNbPos; - POINT m_cheminPos[MAXBLUPI*2]; - int m_cheminRank[MAXBLUPI*2]; - - BOOL m_bFillFloor; - int m_fillSearchChannel; - int m_fillSearchIcon; - int m_fillPutChannel; - int m_fillPutIcon; - char* m_pFillMap; - - int SetBlupiChannel(); - int GetBlupiChannel(); - int GetBlupiChannelActual(); - int GetIconPerso(); - int GetTargetLevel(int mission); - void SetShowSecret(BOOL secret); - void GetBlupiHitbox(RECT *out, POINT pos); + CJauge m_jauges[2]; + int m_blupiLevel; + int m_blupiEnergyUnused; + BOOL m_bHelicoMarch; + BOOL m_bHelicoStop; + BOOL m_bJeepMarch; + BOOL m_bJeepStop; + BOOL m_bFoundCle; + BOOL m_bPrivate; + BOOL m_bCheatDoors; // opendoors + BOOL m_bSuperBlupi; // megablupi + BOOL m_bDrawSecret; // showsecret + BOOL m_bBuildOfficialMissions; // xmission/xnjttjpo + BOOL m_bNetPacked; // netpacked + BOOL m_bNetMovePredict; // ynosmooth + BOOL m_bNetDebug; // znetdebug + BOOL m_bJoystick; + int m_bD814; + int m_mission; + BYTE m_doors[200]; + int m_nbVies; + int m_nbTresor; + int m_totalTresor; + int m_goalPhase; + int m_detectIcon; + int m_D8F8; + POINT m_scrollPoint; + POINT m_scrollAdd; + int m_voyageIcon; + int m_voyageChannel; + int m_voyagePhase; + int m_voyageTotal; + POINT m_voyageStart; + POINT m_voyageEnd; + int m_decorAction; + int m_decorPhase; + int m_lastDecorIndexes[200]; + int reserve[11]; + BYTE dummy[100000]; }; -// (*) R�gions : -// 0 -> normal -// 1 -> palmier -// 2 -> hiver -// 3 -> sapin - -///////////////////////////////////////////////////////////////////////////// - -POINT GetCel (int x, int y); -POINT GetCel (POINT cel, int x, int y); -BOOL IsValid (POINT cel); -POINT GetVector (int direct); - -extern int table_multi_goal[]; -extern short table_actions[]; - - - - - - - - - - +POINT GetCel(int x, int y); +POINT GetCel(POINT cel, int x, int y); +inline BOOL IsValidCel(POINT cel); +POINT GetVector(int direct); \ No newline at end of file diff --git a/src/dectables.cpp b/src/dectables.cpp deleted file mode 100644 index 395fedc..0000000 --- a/src/dectables.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -extern int table_shield_blupi[] -{ - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273 -}; \ No newline at end of file diff --git a/src/dectables.h b/src/dectables.h index 7cd75c7..d83d9fb 100644 --- a/src/dectables.h +++ b/src/dectables.h @@ -1,8550 +1,996 @@ #pragma once -extern int table_shield_blupi[] -{ - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273 -}; - -extern int table_shieldloop[] -{ - 274, - 275, - 276, - 277, - 278 -}; +#include "obstacle.h" extern int table_blitz[] { - 0, - 7, - 15, - 18, - 25, - 27, - 32, - 39, - 45, - 47, - 50, - 58, - 60, - 62, - 64, - 66, - 68, - 70, - 71, - 72 + 0, 7, 15, 18, 26, 27, 32, 39, 45, 47, + 50, 58, 60, 62, 64, 66, 68, 70, 71, 72, + -1 }; -extern int table_shieldtrack[] +extern int table_vitesse_march[] { - 274, - 275, - 276, - 277, - 278, - 274, - 275, - 276, - 277, - 278, - 279, - 280, - 281, - 282, - 283, - 284, - 285, - 286, - 287, - 288 + 2, 4, 6, 8 }; -extern int table_magicloop[] +extern int table_vitesse_nage[] { - 152, - 153, - 154, - 155, - 156 + 2, 1, 5, 10, 8, 6, 4 }; -extern int table_magictrack[] +extern int table_vitesse_surf[] { - 152, - 153, - 154, - 155, - 156, - 152, - 153, - 154, - 155, - 156, - 157, - 158, - 159, - 160, - 157, - 158, - 159, - 160, - 161, - 162, - 163, - 164, - 165, - 166 -}; -extern int table_chenille[] -{ - 311, - 312, - 313, - 314, - 315, - 316 + 0, 2, 5, 8, 3, 0 }; -extern int table_chenillei[] +extern int table_bulldozer_left[8]{ 66, 66, 67, 67, 66, 66, 65, 65 }; + +extern int table_bulldozer_right[8]{ 58, 58, 57, 57, 58, 58, 59, 59 }; + +extern int table_bulldozer_turn2l[22] { - 316, - 315, - 314, - 313, - 312, - 311 + 58, 59, 59, 59, 60, 60, 60, 61, 61, 62, + 62, 63, 63, 64, 64, 64, 65, 65, 65, 66, + 66, 66 }; -extern int table_follow1[] +extern int table_bulldozer_turn2r[22] { - 256, - 256, - 256, - 257, - 257, - 258, - 259, - 260, - 261, - 262, - 263, - 264, - 264, - 265, - 265, - 265, - 264, - 264, - 263, - 262, - 261, - 260, - 259, - 258, - 257, - 257 + 66, 65, 65, 65, 64, 64, 64, 63, 63, 62, + 62, 61, 61, 60, 60, 60, 59, 59, 59, 58, + 58, 58 }; -extern int table_follow2[] +extern int table_poisson_left[8]{ 82, 82, 81, 81, 82, 82, 83, 83 }; + +extern int table_poisson_right[8]{ 79, 79, 78, 78, 79, 79, 80, 80 }; + +extern int table_poisson_turn2l[48] { - 256, - 258, - 260, - 262, - 264 + 79, 79, 80, 80, 84, 84, 85, 85, 86, 86, + 87, 87, 88, 88, 83, 83, 82, 82, 83, 83, + 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, + 79, 79, 79, 79, 80, 80, 84, 84, 85, 85, + 86, 86, 87, 87, 88, 88, 83, 83 }; -extern int table_dynamitef[] +extern int table_poisson_turn2r[48] { - 253, - 252, - 254, - 252, - 252, - 255, - 252, - 254, - 253, - 252, - 253, - 254, - 255, - 252, - 255, - 253, - 252, - 254, - 252, - 255, - 253, - 254, - 252, - 253, - 255, - 254, - 255, - 252, - 253, - 254, - 255, - 252, - 253, - 254, - 255, - 254, - 254, - 253, - 254, - 255, - 253, - 252, - 255, - 254, - 255, - 253, - 252, - 254, - 253, - 255, - 253, - 254, - 252, - 253, - 255, - 254, - 252, - 255, - 253, - 254, - 255, - 253, - 252, - 254, - 255, - 254, - 252, - 253, - 254, - 255, - 253, - 254, - 255, - 254, - 255, - 253, - 252, - 254, - 253, - 255, - 253, - 254, - 255, - 253, - 255, - 254, - 255, - 252, - 253, - 254, - 255, - 253, - 253, - 254, - 255, - 254, - 252, - 253, - 254, - 255 + 82, 82, 83, 83, 88, 88, 87, 87, 86, 86, + 85, 85, 84, 84, 79, 79, 79, 79, 80, 80, + 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, + 83, 83, 82, 82, 83, 83, 88, 88, 87, 87, + 86, 86, 85, 85, 84, 84, 79, 79 }; -extern int table_cle[] +extern int table_oiseau_left[8]{ 98, 99, 100, 101, 102, 103, 104, 105 }; + +extern int table_oiseau_right[8]{ 90, 91, 92, 93, 94, 95, 96, 97 }; + +extern int table_oiseau_turn2l[10]{ 106, 107, 108, 109, 110, 111, 112, 113, 105, 105 }; + +extern int table_oiseau_turn2r[10]{ 114, 115, 116, 117, 118, 119, 120, 121, 97, 97 }; + +extern int table_guepe_left[6]{ 195, 196, 197, 198, 197, 196 }; + +extern int table_guepe_right[6]{ 199, 200, 201, 202, 201, 200 }; + +extern int table_guepe_turn2l[5]{ 207, 206, 205, 204, 203 }; + +extern int table_guepe_turn2r[5]{ 203, 204, 205, 206, 207 }; + +extern int table_creature_left[8]{ 247, 248, 249, 250, 251, 250, 249, 248 }; + +extern int table_creature_right[8]{ 247, 248, 249, 250, 251, 250, 249, 248 }; + +extern int table_creature_turn2[152] { - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 127, - 126, - 125, - 124, - 123 + 244, 244, 244, 244, 244, 244, 244, 244, 243, 243, + 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, + 244, 244, 245, 245, 246, 246, 246, 246, 246, 246, + 246, 246, 245, 245, 244, 244, 243, 243, 242, 242, + 242, 242, 242, 242, 243, 243, 244, 244, 245, 245, + 246, 246, 246, 246, 246, 246, 245, 245, 244, 244, + 243, 243, 242, 242, 242, 242, 243, 243, 244, 244, + 245, 245, 246, 246, 246, 246, 245, 245, 244, 244, + 243, 243, 242, 242, 243, 243, 244, 244, 245, 245, + 246, 246, 245, 245, 244, 244, 243, 243, 242, 242, + 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, + 246, 246, 245, 245, 244, 244, 243, 243, 242, 242, + 242, 242, 242, 242, 243, 243, 244, 244, 245, 245, + 246, 246, 246, 246, 246, 246, 245, 245, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244 }; -extern int table_cle1[] +extern int table_blupih_left[8]{ 66, 67, 68, 67, 66, 69, 70, 69 }; + +extern int table_blupih_right[8]{ 61, 62, 63, 62, 61, 64, 65, 64 }; + +extern int table_blupih_turn2l[26] { - 209, - 210, - 211, - 212, - 213, - 214, - 215, - 214, - 213, - 212, - 211, - 210 + 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, + 68, 68, 275, 275, 271, 271, 271, 271, 272, 272, + 273, 273, 273, 273, 275, 275 }; -extern int table_cle2[] +extern int table_blupih_turn2r[26] { - 220, - 221, - 222, - 221, - 220, - 219, - 218, - 217, - 216, - 217, - 218, - 219 + 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, + 63, 63, 274, 274, 271, 271, 271, 271, 272, 272, + 273, 273, 273, 273, 274, 274 }; -extern int table_cle3[] +extern int table_blupit_left[8]{ 249, 249, 250, 250, 249, 249, 248, 248 }; + +extern int table_blupit_right[8]{ 238, 238, 237, 237, 238, 238, 239, 239 }; + +extern int table_blupit_turn2l[24] { - 229, - 228, - 227, - 226, - 225, - 224, - 223, - 224, - 225, - 226, - 227, - 228 + 238, 238, 251, 251, 238, 238, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 249, 249, + 252, 252, 249, 249 }; -extern int table_skate[] +extern int table_blupit_turn2r[24] { - 129, - 129, - 129, - 129, - 130, - 130, - 130, - 131, - 131, - 132, - 132, - 133, - 133, - 134, - 134, - 134, - 135, - 135, - 135, - 135, - 134, - 134, - 134, - 133, - 133, - 132, - 132, - 131, - 131, - 131, - 130, - 130, - 130, - 130 + 249, 249, 252, 252, 249, 249, 249, 248, 247, 246, + 245, 244, 243, 242, 241, 240, 239, 238, 238, 238, + 251, 251, 238, 238 }; -extern int table_shield[] +extern int table_explo1[39] { - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273 + 0, 0, 1, 1, 2, 2, 3, 3, 4, 3, + 4, 4, 3, 4, 3, 3, 4, 4, 5, 5, + 4, 5, 6, 5, 6, 6, 5, 5, 6, 7, + 7, 8, 8, 9, 9, 10, 10, 11, 11 }; -extern int table_power[] +extern int table_explo2[20] { - 136, - 137, - 138, - 139, - 140, - 141, - 142, - 143 + 12, -1, 13, 14, -1, 15, 13, -1, 14, 15, + 12, -1, 13, 15, 14, 14, -1, 14, 15, 13 }; -extern int table_invert[] +extern int table_explo3[20] { - 187, - 187, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 187, - 187, - 187, - 194, - 193, - 192, - 191, - 190, - 189, - 188 + 32, 32, 34, 34, 32, 32, 34, 34, 32, 32, + 34, 34, 32, 32, 35, 35, 32, 32, 35, 35 }; -extern int table_charge[] +extern int table_explo4[9]{ 12, 13, 14, 15, 7, 8, 9, 10, 11 }; + +extern int table_explo5[12] { - 238, - 239, - 240, - 241, - 242, - 243 + 54, -1, 55, -1, 56, -1, 57, -1, 58, -1, + 59, -1 }; -extern int table_tresortrack[] +extern int table_explo6[6]{ 54, 55, 56, 57, 58, 59 }; + +extern int table_explo7[128] { - 166, - 165, - 164, - 163, - 162, - 161, - 162, - 163, - 164, - 165, - 166 + 60, 61, -1, 63, 64, 65, 62, 64, 62, 60, + 62, -1, 65, -1, 60, 65, 63, 61, 62, -1, + 64, 65, -1, 62, 64, 61, 62, 63, -1, 65, + 60, -1, 65, -1, 63, 65, -1, 61, 60, 65, + 62, 63, 64, -1, 62, 63, -1, 62, 62, 60, + 62, -1, 65, -1, 60, 65, 64, 61, 62, 63, + -1, 65, 60, -1, 63, 61, 62, -1, 64, 65, + -1, 62, 62, 60, 62, -1, 65, -1, 60, 65, + 60, 61, -1, 63, 64, 65, 62, 64, 63, 61, + 62, -1, 64, 65, -1, 62, 60, 61, -1, 63, + 64, 65, 62, 64, -1, 60, -1, -1, 65, -1, + 60, -1, 63, -1, 62, -1, -1, 65, -1, -1, + -1, 61, -1, -1, -1, 60, -1, -1 }; -extern int table_explo1[] +extern int table_explo8[5]{ 7, 8, 9, 10, 11 }; + +extern int table_sploutch1[10]{ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; + +extern int table_sploutch2[13] { - 0, - 0, - 1, - 1, - 2, - 2, - 3, - 3, - 4, - 3, - 4, - 4, - 3, - 4, - 3, - 3, - 4, - 4, - 5, - 5, - 4, - 5, - 6, - 5, - 6, - 6, - 5, - 5, - 6, - 7, - 7, - 8, - 8, - 9, - 9, - 10, - 10, - 11, - 11 + -1, -1, -1, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99 }; -extern int table_explo2[] +extern int table_sploutch3[18] { - 12, - -1, - 13, - 14, - -1, - 15, - 13, - -1, - 14, - 15, - 12, - -1, - 13, - 15, - 14, - 14, - -1, - 14, - 15, - 13 + -1, -1, -1, -1, -1, -1, -1, -1, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99 }; -extern int table_explo3[] +extern int table_tentacule[45] { - 32, - 32, - 34, - 34, - 32, - 32, - 34, - 34, - 32, - 32, - 34, - 34, - 32, - 32, - 35, - 35, - 32, - 32, - 35, - 35 + 86, 85, 84, 83, 84, 85, 86, -1, 86, 85, + 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, + 74, 73, 72, 71, 70, 70, 70, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, -1 }; -extern int table_explo4[] +extern int table_bridge[157] { - 12, - 13, - 14, - 15, - 7, - 8, - 9, - 10, - 11 + 365, 366, 365, 366, 365, 366, 365, 366, 365, 366, + 365, 366, 365, 366, 365, 366, 367, 367, 368, 368, + 369, 369, 370, 370, 371, 371, 372, 372, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 372, 372, 371, 371, 370, 370, 369, 369, 368, 368, + 367, 367, 366, 366, 365, 365, 364 }; -extern int table_explo5[] +extern int table_pollution[8]{ 179, 180, 181, 182, 183, 184, 185, 186 }; + +extern int table_invertstart[8]{ 179, 180, 181, 182, 183, 184, 185, 186 }; + +extern int table_invertstop[8]{ 186, 185, 184, 183, 182, 181, 180, 179 }; + +extern int table_invertpanel[8]{ 187, 188, 189, 190, 191, 192, 193, 194 }; + +extern int table_plouf[7]{ 99, 100, 101, 102, 101, 100, 99 }; + +extern int table_tiplouf[3]{ 244, 99, 244 }; + +extern int table_blup[20] { - 54, - -1, - 55, - -1, - 56, - -1, - 57, - -1, - 58, - -1, - 59, - -1 + 103, 104, 105, 106, 104, 103, 106, 105, 103, 104, + 103, 105, 106, 103, 105, 106, 103, 104, 106, 105 }; -extern int table_explo6[] +extern int table_follow1[26] { - 54, - 55, - 56, - 57, - 58, - 59 + 256, 256, 256, 257, 257, 258, 259, 260, 261, 262, + 263, 264, 264, 265, 265, 265, 264, 264, 263, 262, + 261, 260, 259, 258, 257, 257 }; -extern int table_explo7[] +extern int table_follow2[5]{ 256, 258, 260, 262, 264 }; + +extern int table_cle[12] { - 60, - 61, - -1, - 63, - 64, - 65, - 62, - 64, - 62, - 60, - 62, - -1, - 65, - -1, - 60, - 65, - 63, - 61, - 62, - -1, - 64, - 65, - -1, - 62, - 64, - 61, - 62, - 63, - -1, - 65, - 60, - -1, - 65, - -1, - 63, - 65, - -1, - 61, - 60, - 65, - 62, - 63, - 64, - -1, - 62, - 63, - -1, - 62, - 62, - 60, - 62, - -1, - 65, - -1, - 60, - 65, - 64, - 61, - 62, - 63, - -1, - 65, - 60, - -1, - 63, - 61, - 62, - -1, - 64, - 65, - -1, - 62, - 62, - 60, - 62, - -1, - 65, - -1, - 60, - 65, - 60, - 61, - -1, - 63, - 64, - 65, - 62, - 64, - 63, - 61, - 62, - -1, - 64, - 65, - -1, - 62, - 60, - 61, - -1, - 63, - 64, - 65, - 62, - 64, - -1, - 60, - -1, - -1, - 65, - -1, - 60, - -1, - 63, - -1, - 62, - -1, - -1, - 65, - -1, - -1, - -1, - 61, - -1, - -1, - -1, - 60, - -1, - -1 + 122, 123, 124, 125, 126, 127, 128, 127, 126, 125, + 124, 123 }; -extern int table_explo8[] +extern int table_cle1[12] { - 7, - 8, - 9, - 10, - 11 + 209, 210, 211, 212, 213, 214, 215, 214, 213, 212, + 211, 210 }; -extern int table_sploutch1[] +extern int table_cle2[12] { - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99 + 220, 221, 222, 221, 220, 219, 218, 217, 216, 217, + 218, 219 }; extern int table_decor_action[] { 1, - 32, - -4, - 4, - 4, - -3, - -4, - 2, - 4, - 5, - -4, - -1, - 4, - 2, - -4, - -4, - 4, - -3, - -3, - 2, - 3, - 2, - -3, - -5, - 3, - 4, - -3, - 5, - 3, - -2, - -3, - 5, - 3, - 4, - -2, - -2, - 2, - 4, - -2, - -2, - 2, - -2, - -2, - -4, - 2, - 2, - -2, - -2, - 2, - -3, - -1, - -3, - 1, - -2, - -1, - -1, - 1, - 2, - -1, - -2, - 1, - -1, - -1, - 1, - 1, - 2, - 2, - 32, - -4, - 0, - 4, - 0, - -4, - 0, - 4, - 0, - -4, - 0, - 4, - 0, - -4, - 0, - 4, - 0, - -3, - 0, - 3, - 0, - -3, - 0, - 3, - 0, - -3, - 0, - 3, - 0, - -3, - 0, - 3, - 0, - -2, - 0, - 2, - 0, - -2, - 0, - 2, - 0, - -2, - 0, - 2, - 0, - -2, - 0, - 2, - 0, - -1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 5, - 192, - 0, - -32, - 0, - 32, - 0, - -16, - 0, - 6, - 0, - -8, - 0, - 8, - 0, - -4, - 0, - 4, - 0, - -2, - 0, - 2, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - -1, - 0, - 0 -}; - -extern int table_marine[] -{ - 203, - 204, - 205, - 206, - 207, - 208, - 207, - 206, - 205, - 204, - 203 -}; - -extern int table_adapt_decor[] -{ - 153, - 147, - 148, - 146, - 40, - 151, - 150, - 144, - 39, - 152, - 149, - 145, - 38, - 36, - 37, - 35, - 153, - 147, - 148, - 146, - 40, - 151, - 150, - 144, - 39, - 152, - 149, - 145, - 38, - 36, - 37, - 156, - 75, - 75, - 155, - 155, - 75, - 75, - 155, - 155, - 74, - 74, - 154, - 154, - 75, - 75, - 155, - 155, - 157, - 157, - 157, - 157, - 109, - 109, - 109, - 109, - 108, - 108, - 108, - 108, - 107, - 107, - 107, - 107, - 202, - 202, - 138, - 138, - 202, - 202, - 138, - 138, - 202, - 202, - 138, - 138, - 202, - 202, - 138, - 138, - 283, - 283, - 283, - 283, - 262, - 262, - 262, - 262, - 263, - 263, - 263, - 263, - 261, - 261, - 261, - 261, - 361, - 359, - 360, - 352, - 357, - 353, - 355, - 349, - 358, - 354, - 356, - 350, - 351, - 347, - 348, - 341, - 387, - 387, - 386, - 386, - 394, - 394, - 392, - 392, - 395, - 395, - 393, - 393, - 397, - 397, - 396, - 396, - 251, - 254, - 254, - 254, - 251, - 258, - 260, - 258, - 251, - 257, - 259, - 257, - 251, - 250, - 256, - 250 -}; - -extern int table_adapt_fromage[] -{ - -1, - 265, - 264, - 268, - 267, - 273, - 271, - 275, - 266, - 272, - 270, - 274, - 269, - 277, - 276, - 278, - -1, - 286, - 285, - 289, - 288, - 294, - 292, - 296, - 287, - 293, - 291, - 295, - 290, - 298, - 297, - 299 -}; - -extern int table_vitesse_march[] -{ + 32, + -4, + 4, + 4, + -3, + -4, 2, 4, - 6, - 8 -}; - -extern int table_decor_quart[] - { - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0 - }; - -extern int table_vitesse_nage[] -{ - 2, - 1, 5, - 10, - 8, + -4, + -1, + 4, + 2, + -4, + -4, + 4, + -3, + -3, + 2, + 3, + 2, + -3, + -5, + 3, + 4, + -3, + 5, + 3, + -2, + -3, + 5, + 3, + 4, + -2, + -2, + 2, + 4, + -2, + -2, + 2, + -2, + -2, + -4, + 2, + 2, + -2, + -2, + 2, + -3, + -1, + -3, + 1, + -2, + -1, + -1, + 1, + 2, + -1, + -2, + 1, + -1, + -1, + 1, + 1, + 2, + 2, + 32, + -4, + 0, + 4, + 0, + -4, + 0, + 4, + 0, + -4, + 0, + 4, + 0, + -4, + 0, + 4, + 0, + -3, + 0, + 3, + 0, + -3, + 0, + 3, + 0, + -3, + 0, + 3, + 0, + -3, + 0, + 3, + 0, + -2, + 0, + 2, + 0, + -2, + 0, + 2, + 0, + -2, + 0, + 2, + 0, + -2, + 0, + 2, + 0, + -1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + -1, + 0, + 1, + 0, + 5, + 192, + 0, + -32, + 0, + 32, + 0, + -16, + 0, 6, - 4 + 0, + -8, + 0, + 8, + 0, + -4, + 0, + 4, + 0, + -2, + 0, + 2, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + 0, + 0, + 2, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 5, + 0, + 4, + 0, + 2, + 0, + 0, + 0, + -2, + 0, + -4, + 0, + -5, + 0, + -6, + 0, + -7, + 0, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + 0, + 0, + 2, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 5, + 0, + 4, + 0, + 2, + 0, + 0, + 0, + -2, + 0, + -4, + 0, + -5, + 0, + -6, + 0, + -7, + 0, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + 0, + 0, + 2, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 5, + 0, + 4, + 0, + 2, + 0, + 0, + 0, + -2, + 0, + -4, + 0, + -5, + 0, + -6, + 0, + -7, + 0, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + 0, + 0, + 2, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 5, + 0, + 4, + 0, + 2, + 0, + 0, + 0, + -2, + 0, + -4, + 0, + -5, + 0, + -6, + 0, + -7, + 0, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + 0, + 0, + 2, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 5, + 0, + 4, + 0, + 2, + 0, + 0, + 0, + -2, + 0, + -4, + 0, + -5, + 0, + -6, + 0, + -7, + 0, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + 0, + 0, + 2, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 5, + 0, + 4, + 0, + 2, + 0, + 0, + 0, + -2, + 0, + -4, + 0, + -5, + 0, + -6, + 0, + -7, + 0, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + 0, + 0, + 2, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 5, + 0, + 4, + 0, + 2, + 0, + 0, + 0, + -2, + 0, + -4, + 0, + -5, + 0, + -6, + 0, + -7, + 0, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + 0, + 0, + 2, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 7, + 0, + 6, + 0, + 5, + 0, + 4, + 0, + 2, + 0, + 0, + 0, + -2, + 0, + -4, + 0, + -5, + 0, + -6, + 0, + -7, + 0, + -7, + 0, + -6, + 0, + -5, + 0, + -4, + 0, + -2, + 0, + -1, + 0, + 0 }; -extern int table_vitesse_surf[] +extern int table_dynamitef[100] +{ + 253, 252, 254, 252, 252, 255, 252, 254, 253, 252, + 253, 254, 255, 252, 255, 253, 252, 254, 252, 255, + 253, 254, 252, 253, 255, 254, 255, 252, 253, 254, + 255, 252, 253, 254, 255, 254, 254, 253, 254, 255, + 253, 252, 255, 254, 255, 253, 252, 254, 253, 255, + 253, 254, 252, 253, 255, 254, 252, 255, 253, 254, + 255, 253, 252, 254, 255, 254, 252, 253, 254, 255, + 253, 254, 255, 254, 255, 253, 252, 254, 253, 255, + 253, 254, 255, 253, 255, 254, 255, 252, 253, 254, + 255, 253, 253, 254, 255, 254, 252, 253, 254, 255 +}; + +extern int table_skate[34] +{ + 129, 129, 129, 129, 130, 130, 130, 131, 131, 132, + 132, 133, 133, 134, 134, 134, 135, 135, 135, 135, + 134, 134, 134, 133, 133, 132, 132, 131, 131, 131, + 130, 130, 130, 130 +}; + +extern int table_glu[25] +{ + 168, 168, 169, 169, 170, 170, 171, 171, 170, 170, + 169, 169, 168, 168, 169, 169, 169, 168, 168, 169, + 169, 170, 170, 169, 168 +}; + +extern int table_clear[70] +{ + 40, 40, 40, 40, 41, 41, 41, 41, 40, 40, + 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, + 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, + 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, + 45, 45, 46, 46, 47, 47, 46, 46, 47, 47, + 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, + 47, 47, 46, 46, 47, 47, 46, 46, 47, 47 +}; + +extern int table_electro[90] +{ + 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, + 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, + 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, + 40, 40, 40, 40, 41, 41, 41, 41, 40, 40, + 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, + 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, + 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, + 45, 45, 46, 46, 47, 47, 46, 46, 47, 47, + 46, 46, 47, 47, 46, 46, 47, 47, 46, 46 +}; + +extern int table_chenille[6]{ 311, 312, 313, 314, 315, 316 }; + +extern int table_chenillei[6]{ 316, 315, 314, 313, 312, 311 }; + +extern int table_adapt_decor[144] +{ + 153, 147, 148, 146, 40, 151, 150, 144, 39, 152, + 149, 145, 38, 36, 37, 35, 153, 147, 148, 146, + 40, 151, 150, 144, 39, 152, 149, 145, 38, 36, + 37, 156, 75, 75, 155, 155, 75, 75, 155, 155, + 74, 74, 154, 154, 75, 75, 155, 155, 157, 157, + 157, 157, 109, 109, 109, 109, 108, 108, 108, 108, + 107, 107, 107, 107, 202, 202, 138, 138, 202, 202, + 138, 138, 202, 202, 138, 138, 202, 202, 138, 138, + 283, 283, 283, 283, 262, 262, 262, 262, 263, 263, + 263, 263, 261, 261, 261, 261, 361, 359, 360, 352, + 357, 353, 355, 349, 358, 354, 356, 350, 351, 347, + 348, 341, 387, 387, 386, 386, 394, 394, 392, 392, + 395, 395, 393, 393, 397, 397, 396, 396, 251, 254, + 254, 254, 251, 258, 260, 258, 251, 257, 259, 257, + 251, 250, 256, 250 +}; + +extern int table_adapt_fromage[32] +{ + -1, 265, 264, 268, 267, 273, 271, 275, 266, 272, + 270, 274, 269, 277, 276, 278, -1, 286, 285, 289, + 288, 294, 292, 296, 287, 293, 291, 295, 290, 298, + 297, 299 +}; + +extern int table_shield[] +{ + 16, + 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, + 268, 269, 270, 271, 272, 273 +}; + +extern int table_shield_blupi[] +{ + 16, + 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, + 268, 269, 270, 271, 272, 273 +}; + +extern int table_power[]{ 8, 136, 137, 138, 139, 140, 141, 142, 143 }; + +extern int table_invert[] +{ + 20, + 187, 187, 187, 188, 189, 190, 191, 192, 193, 194, + 187, 187, 187, 194, 193, 192, 191, 190, 189, 188 +}; + +extern int table_charge[]{ 6, 238, 239, 240, 241, 242, 243 }; + +extern int table_magicloop[]{ 5, 152, 153, 154, 155, 156 }; + +extern int table_magictrack[] +{ + 24, + 152, 153, 154, 155, 156, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166 +}; + +extern int table_shieldloop[]{ 5, 274, 275, 276, 277, 278 }; + +extern int table_shieldtrack[] +{ + 20, + 274, 275, 276, 277, 278, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288 +}; + +extern int table_drinkeffect[]{ 5, 274, 275, 276, 277, 278 }; + +extern int table_drinkoffset[]{ 3, 0, 7, 22 }; + +extern int table_tresortrack[] +{ + 11, + 166, 165, 164, 163, 162, 161, 162, 163, 164, 165, + 166 +}; + +extern int table_decor_lave[]{ 8, 68, 69, 70, 71, 72, 71, 70, 69 }; + +extern int table_decor_piege1[] +{ + 16, + 374, 374, 373, 347, 373, 374, 374, 374, 373, 347, + 347, 373, 374, 374, 374, 374 +}; + +extern int table_decor_piege2[]{ 4, 374, 373, 347, 373 }; + +extern int table_decor_goutte[] +{ + 48, + 410, 409, 410, -1, -1, -1, -1, -1, -1, 410, + 409, 408, 409, 410, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 410, 409, 408, 407, 406, 405, + 404, 405, 406, 407, 408, 409, 410, -1, -1, -1, + -1, 410, 409, 410, -1, -1, -1, -1 +}; + +extern int table_decor_ecraseur[]{ 10, 317, 317, 318, 319, 320, 321, 322, 323, 323, 323 }; + +extern int table_decor_scie[]{ 6, 378, 379, 380, 381, 382, 383 }; + +extern int table_decor_temp[] +{ + 20, + 328, 328, 327, 327, 326, 326, 325, 325, 324, 324, + 325, 325, 326, 326, 327, 329, 328, 328, -1, -1 +}; + +extern int table_decor_eau1[]{ 6, 92, 93, 94, 95, 94, 93 }; + +extern int table_decor_eau2[]{ 6, 91, 96, 97, 98, 97, 96 }; + +extern int table_decor_ventillog[]{ 3, 126, 127, 128 }; + +extern int table_decor_ventillod[]{ 3, 129, 130, 131 }; + +extern int table_decor_ventilloh[]{ 3, 132, 133, 134 }; + +extern int table_decor_ventillob[]{ 3, 135, 136, 137 }; + +extern int table_decor_ventg[]{ 4, 110, 111, 112, 113 }; + +extern int table_decor_ventd[]{ 4, 114, 115, 116, 117 }; + +extern int table_decor_venth[]{ 4, 118, 119, 120, 121 }; + +extern int table_decor_ventb[]{ 4, 122, 123, 124, 125 }; + +extern int table_marine[] { 0, 2, @@ -8554,1167 +1000,7 @@ extern int table_vitesse_surf[] 0 }; -extern int table_sploutch2[] +extern int table_ressort[] // i dont really care to look this up right now so heres some bs { - -1, - -1, - -1, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99 -}; - -extern int table_sploutch3[] -{ - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99 -}; - -extern int table_tentacule[] -{ - 86, - 85, - 84, - 83, - 84, - 85, - 86, - -1, - 86, - 85, - 84, - 83, - 82, - 81, - 80, - 79, - 78, - 77, - 76, - 75, - 74, - 73, - 72, - 71, - 70, - 70, - 70, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - -1 -}; - -extern int table_bridge[] -{ - 365, - 366, - 365, - 366, - 365, - 366, - 365, - 366, - 365, - 366, - 365, - 366, - 365, - 366, - 365, - 366, - 367, - 367, - 368, - 368, - 369, - 369, - 370, - 370, - 371, - 371, - 372, - 372, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - 372, - 372, - 371, - 371, - 370, - 370, - 369, - 369, - 368, - 368, - 367, - 367, - 366, - 366, - 365, - 365, - 364 -}; - -extern int table_pollution[] -{ - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186 -}; - -extern int table_invertstart[] -{ - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186 -}; - -extern int table_invertstop[] -{ - 186, - 185, - 184, - 183, - 182, - 181, - 180, - 179 -}; - -extern int table_plouf[] -{ - 99, - 100, - 101, - 102, - 101, - 100, - 99 -}; - -extern int table_tiplouf[] -{ - 244, - 99, - 244 -}; - -extern int table_blup[] -{ - 103, - 104, - 105, - 106, - 104, - 103, - 106, - 105, - 103, - 104, - 103, - 105, - 106, - 103, - 105, - 106, - 103, - 104, - 106, - 105 -}; - -extern int table_bulldozer_left[] -{ - 66, - 66, - 67, - 67, - 66, - 66, - 65, - 65 -}; - -extern int table_bulldozer_right[] -{ - 58, - 58, - 57, - 57, - 58, - 58, - 59, - 59 -}; - -extern int table_bulldozer_turn2l[] -{ - 58, - 59, - 59, - 59, - 60, - 60, - 60, - 61, - 61, - 62, - 62, - 63, - 63, - 64, - 64, - 64, - 65, - 65, - 65, - 66, - 66, - 66 -}; - -extern int table_bulldozer_turn2r[] -{ - 66, - 65, - 65, - 65, - 64, - 64, - 64, - 63, - 63, - 62, - 62, - 61, - 61, - 60, - 60, - 60, - 59, - 59, - 59, - 58, - 58, - 58 -}; - -extern int table_poisson_left[] -{ - 82, - 82, - 81, - 81, - 82, - 82, - 83, - 83 -}; - -extern int table_poisson_right[] -{ - 79, - 79, - 78, - 78, - 79, - 79, - 80, - 80 -}; - - - -extern int table_poisson_turn2l[] -{ - 79, - 79, - 80, - 80, - 84, - 84, - 85, - 85, - 86, - 86, - 87, - 87, - 88, - 88, - 83, - 83, - 82, - 82, - 83, - 83, - 88, - 88, - 87, - 87, - 86, - 86, - 85, - 85, - 84, - 84, - 79, - 79, - 79, - 79, - 80, - 80, - 84, - 84, - 85, - 85, - 86, - 86, - 87, - 87, - 88, - 88, - 83, - 83 -}; - -extern int table_poisson_turn2r[] -{ - 82, - 82, - 83, - 83, - 88, - 88, - 87, - 87, - 86, - 86, - 85, - 85, - 84, - 84, - 79, - 79, - 79, - 79, - 80, - 80, - 84, - 84, - 85, - 85, - 86, - 86, - 87, - 87, - 88, - 88, - 83, - 83, - 82, - 82, - 83, - 83, - 88, - 88, - 87, - 87, - 86, - 86, - 85, - 85, - 84, - 84, - 79, - 79 -}; - -extern int table_oiseau_left[] -{ - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105 -}; - -extern int table_oiseau_right[] -{ - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97 -}; - -extern int table_oiseau_turn2l[] -{ - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 105, - 105 -}; - -extern int table_oiseau_turn2r[] -{ - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 97, - 97 -}; - -extern int table_guepe_left[] -{ - 195, - 196, - 197, - 198, - 197, - 196 -}; - -extern int table_guepe_right[] -{ - 199, - 200, - 201, - 202, - 201, - 200 -}; - -extern int table_guepe_turn2l[] -{ - 207, - 206, - 205, - 204, - 203 -}; - -extern int table_guepe_turn2r[] -{ - 203, - 204, - 205, - 206, - 207 -}; - -extern int table_creature_left[] -{ - 247, - 248, - 249, - 250, - 251, - 250, - 249, - 248 -}; - -extern int table_creature_right[] -{ - 247, - 248, - 249, - 250, - 251, - 250, - 249, - 248 -}; - -extern int table_creature_turn2[] -{ - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244 -}; - -extern int table_blupih_left[] -{ - 66, - 67, - 68, - 67, - 66, - 69, - 70, - 69 -}; - -extern int table_blupih_right[] -{ - 61, - 62, - 63, - 62, - 61, - 64, - 65, - 64 -}; - -extern int table_blupih_turn2l[] -{ - 71, - 71, - 72, - 72, - 73, - 73, - 74, - 74, - 75, - 75, - 68, - 68, - 275, - 275, - 271, - 271, - 271, - 271, - 272, - 272, - 273, - 273, - 273, - 273, - 275, - 275 -}; - -extern int table_blupih_turn2r[] -{ - 75, - 75, - 74, - 74, - 73, - 73, - 72, - 72, - 71, - 71, - 63, - 63, - 274, - 274, - 271, - 271, - 271, - 271, - 272, - 272, - 273, - 273, - 273, - 273, - 274, - 274 -}; - -extern int table_blupit_left[] -{ - 249, - 249, - 250, - 250, - 249, - 249, - 248, - 248 -}; - -extern int table_blupit_right[] -{ - 238, - 238, - 237, - 237, - 238, - 238, - 239, - 239 -}; - -extern int table_blupit_turn2l[] -{ - 238, - 238, - 251, - 251, - 238, - 238, - 238, - 239, - 240, - 241, - 242, - 243, - 244, - 245, - 246, - 247, - 248, - 249, - 249, - 249, - 252, - 252, - 249, - 249 -}; - -extern int table_blupit_turn2r[] -{ - 249, - 249, - 252, - 252, - 249, - 249, - 249, - 248, - 247, - 246, - 245, - 244, - 243, - 242, - 241, - 240, - 239, - 238, - 238, - 238, - 251, - 251, - 238, - 238 -}; - -extern int table_glu[] -{ - 168, - 168, - 169, - 169, - 170, - 170, - 171, - 171, - 170, - 170, - 169, - 169, - 168, - 168, - 169, - 169, - 169, - 168, - 168, - 169, - 169, - 170, - 170, - 169, - 168 -}; - -extern int table_clear[] -{ - - 40, - 40, - 40, - 40, - 41, - 41, - 41, - 41, - 40, - 40, - 40, - 40, - 40, - 40, - 40, - 41, - 41, - 41, - 40, - 40, - 40, - 40, - 40, - 40, - 40, - 41, - 41, - 41, - 40, - 40, - 42, - 42, - 42, - 43, - 43, - 43, - 44, - 44, - 44, - 45, - 45, - 45, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47 -}; - -extern int table_electro[] -{ - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 266, - 267, - 40, - 40, - 40, - 40, - 41, - 41, - 41, - 41, - 40, - 40, - 40, - 40, - 40, - 40, - 40, - 41, - 41, - 41, - 40, - 40, - 40, - 40, - 40, - 40, - 40, - 41, - 41, - 41, - 40, - 40, - 42, - 42, - 42, - 43, - 43, - 43, - 44, - 44, - 44, - 45, - 45, - 45, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47, - 46, - 46, - 47, - 47, - 46, - 46 + 8,1,2,3,4,5,5,6,7,7 }; \ No newline at end of file diff --git a/src/def.h b/src/def.h index c4117f6..e8b28bc 100644 --- a/src/def.h +++ b/src/def.h @@ -5,37 +5,39 @@ #include +// prevent WinAPI from overriding our functions +#undef PlaySound +#undef DrawText +#undef GetCharWidth + #define _DEMO FALSE // TRUE=demo, FALSE=complet -#define _INTRO FALSE // TRUE si images d'introduction #define _EGAMES FALSE // TRUE version pour eGames #define _SE FALSE // TRUE eGames Special Edition +#define _INTRO !_EGAMES // TRUE si images d'introduction +// additional flags +#define _CD FALSE // whether to require the game CD +#define _BYE !_EGAMES // whether to show exit image (like _INTRO) -#define LXIMAGE 640 // dimensions de la fen�tre de jeu +#define MAXGAMER 8 + +#define LXIMAGE 640 // dimensions de la fenêtre de jeu #define LYIMAGE 480 -#define POSDRAWX 144 // surface de dessin -#define POSDRAWY 15 -#define DIMDRAWX 480 -#define DIMDRAWY 450 +#define POSDRAWX 0 +#define POSDRAWY 0 -#define POSMAPX 8 // surface pour la carte -#define POSMAPY 15 -#define DIMMAPX 128 -#define DIMMAPY 128 +#define MAXCELX 100 // nb max de cellules d'un monde +#define MAXCELY 100 -#define MAXCELX 200 // nb max de cellules d'un monde -#define MAXCELY 200 +#define DIMOBJX 64 // dimensions d'un objet +#define DIMOBJY 64 -#define DIMCELX 60 // dimensions d'une cellule (d�cor) -#define DIMCELY 30 - -#define DIMOBJX 120 // dimensions d'un objet -#define DIMOBJY 120 +#define DIMEXPLOX 128 +#define DIMEXPLOY 128 #define DIMBLUPIX 60 // dimensions de blupi #define DIMBLUPIY 60 -#define SHIFTBLUPIY 5 // petit d�calage vers le haut #define DIMEXPLOX 128 #define DIMEXPLOY 128 @@ -46,179 +48,363 @@ #define DIMJAUGEX 124 // dimensions de la jauge #define DIMJAUGEY 22 -#define POSSTATX 12 // statistiques -#define POSSTATY 220 -#define DIMSTATX 60 -#define DIMSTATY 30 - -#define DIMTEXTX 16 // dimensions max d'un caract�re +#define DIMTEXTX 16 // dimensions max d'un caractère #define DIMTEXTY 16 -#define DIMLITTLEX 16 // dimensions max d'un petit caract�re +#define DIMLITTLEX 16 // dimensions max d'un petit caractère #define DIMLITTLEY 12 -#define CHBACK 0 -#define CHFLOOR 1 -#define CHOBJECT 1 -#define CHBLUPI 2 -#define CHDECOR 3 -#define CHBUTTON 4 -#define CHJAUGE 5 -#define CHTEXT 6 -#define CHMAP 8 -#define CHEXPLO 9 -#define CHELEMENT 10 -#define CHBLUPI1 11 -#define CHBLUPI2 12 -#define CHBLUPI3 13 -#define CHPAD 14 -#define CHSPEEDYBLUPI 15 -#define CHBLUPIYOUPIE 16 -#define CHGEAR 17 -#define CHLITTLE 18 -#define CHBIGNUM 19 +enum { + CHBACK = 0, + CHOBJECT, + CHBLUPI, + CHDECOR, + CHBUTTON, + CHJAUGE, + CHTEXT, + CHLITTLE, + CHMAP, + CHEXPLO, + CHELEMENT, + CHBLUPI1, + CHBLUPI2, + CHBLUPI3, + CHTEMP +}; -#define CHTEMP 14 +enum { + MESS_RESUME = 0, + MESS_PAUSE, + MESS_2, + MESS_3, + MESS_LOBBY, + MESS_5, + MESS_6, + MESS_7, + MESS_LEAVE, + MESS_LOST, + MESS_START, + MESS_11, + MESS_PAUSE2, -#define MAXMOVEOBJECT 200 + MESS_OBJECTSTART = 20, + MESS_OBJECTDELETE, -#define MESS_LOBBY 4 -#define NETEVENTMAX 20 + MESS_MODIFDECOR = 30, -#define PK_PLAYSOUND 40 + MESS_PLAYSOUND = 40, + MESS_STOPSOUND, + MESS_ASCENSEURSTART = 50, + MESS_ASCENSEUREND, + + MESS_STOPCLOUD = 60 +}; + +#define MAXNETMESSAGE 20 // Directions : -#define DIRECT_E (0*16) // est -#define DIRECT_SE (1*16) // sud-est -#define DIRECT_S (2*16) // sud -#define DIRECT_SO (3*16) // sud-ouest -#define DIRECT_O (4*16) // ouest -#define DIRECT_NO (5*16) // nord-ouest -#define DIRECT_N (6*16) // nord -#define DIRECT_NE (7*16) // nord-est - -// NO -// O | N -// \ | / -// \ | / -// \|/ -// SO -------o------- NE -// /|\ -// / | \ -// / | \ -// S | E -// (y) SE (x) - +enum { + DIR_LEFT = 1, + DIR_RIGHT +}; // Actions : -#define ACTION_STOP 1 // arr�t -#define ACTION_MARCH 2 -#define ACTION_TURN 3 -#define ACTION_JUMP 4 -#define ACTION_AIR 5 -#define ACTION_DOWN 6 +#define ACTION_STOP 1 +#define ACTION_MARCH 2 +#define ACTION_TURN 3 +#define ACTION_JUMP 4 +#define ACTION_AIR 5 +#define ACTION_DOWN 6 +#define ACTION_UP 7 +#define ACTION_VERTIGO 8 +#define ACTION_RECEDE 9 +#define ACTION_ADVANCE 10 +#define ACTION_CLEAR1 11 +#define ACTION_SET 12 +#define ACTION_WIN 13 +#define ACTION_PUSH 14 +#define ACTION_STOPHELICO 15 +#define ACTION_MARCHHELICO 16 +#define ACTION_TURNHELICO 17 +#define ACTION_STOPNAGE 18 +#define ACTION_MARCHNAGE 19 +#define ACTION_TURNNAGE 20 +#define ACTION_STOPSURF 21 +#define ACTION_MARCHSURF 22 +#define ACTION_TURNSURF 23 +#define ACTION_DROWN 24 +#define ACTION_STOPJEEP 25 +#define ACTION_MARCHJEEP 26 +#define ACTION_TURNJEEP 27 +#define ACTION_STOPPOP 28 +#define ACTION_POP 29 +#define ACTION_BYE 30 +#define ACTION_STOPSUSPEND 31 +#define ACTION_MARCHSUSPEND 32 +#define ACTION_TURNSUSPEND 33 +#define ACTION_JUMPSUSPEND 34 +#define ACTION_HIDE 35 +#define ACTION_JUMPAIE 36 +#define ACTION_STOPSKATE 37 +#define ACTION_MARCHSKATE 38 +#define ACTION_TURNSKATE 39 +#define ACTION_JUMPSKATE 40 +#define ACTION_AIRSKATE 41 +#define ACTION_TAKESKATE 42 +#define ACTION_DEPOSESKATE 43 +#define ACTION_OUF1a 44 +#define ACTION_OUF1b 45 +#define ACTION_OUF2 46 +#define ACTION_OUF3 47 +#define ACTION_OUF4 48 +#define ACTION_SUCETTE 49 +#define ACTION_STOPTANK 50 +#define ACTION_MARCHTANK 51 +#define ACTION_TURNTANK 52 +#define ACTION_FIRETANK 53 +#define ACTION_GLU 54 +#define ACTION_DRINK 55 +#define ACTION_CHARGE 56 +#define ACTION_ELECTRO 57 +#define ACTION_HELICOGLU 58 +#define ACTION_TURNAIR 59 +#define ACTION_STOPMARCH 60 +#define ACTION_STOPJUMP 61 +#define ACTION_STOPJUMPh 62 +#define ACTION_MOCKERY 63 +#define ACTION_MOCKERYi 64 +#define ACTION_OUF5 65 +#define ACTION_BALLOON 66 +#define ACTION_STOPOVER 67 +#define ACTION_MARCHOVER 68 +#define ACTION_TURNOVER 69 +#define ACTION_RECEDEq 70 +#define ACTION_ADVANCEq 71 +#define ACTION_STOPECRASE 72 +#define ACTION_MARCHECRASE 73 +#define ACTION_TELEPORTE 74 +#define ACTION_CLEAR2 75 +#define ACTION_CLEAR3 76 +#define ACTION_CLEAR4 77 +#define ACTION_CLEAR5 78 +#define ACTION_CLEAR6 79 +#define ACTION_CLEAR7 80 +#define ACTION_CLEAR8 81 +#define ACTION_SWITCH 82 +#define ACTION_MOCKERYp 83 +#define ACTION_NON 84 +#define ACTION_SLOWDOWNSKATE 85 +#define ACTION_TAKEDYNAMITE 86 +#define ACTION_PUTDYNAMITE 87 + +// Sécurités : + +enum { + SEC_SHIELD = 1, + SEC_POWER, + SEC_CLOUD, + SEC_HIDE +}; + +// Types : + +#define TYPE_ASCENSEUR 1 +#define TYPE_BOMBEDOWN 2 +#define TYPE_BOMBEUP 3 +#define TYPE_BULLDOZER 4 +#define TYPE_TRESOR 5 +#define TYPE_EGG 6 +#define TYPE_GOAL 7 +#define TYPE_EXPLO1 8 +#define TYPE_EXPLO2 9 +#define TYPE_EXPLO3 10 +#define TYPE_EXPLO4 11 +#define TYPE_CAISSE 12 +#define TYPE_HELICO 13 +#define TYPE_PLOUF 14 +#define TYPE_BLUP 15 +#define TYPE_BOMBEMOVE 16 +#define TYPE_POISSON 17 +#define TYPE_TOMATES 18 // unused +#define TYPE_JEEP 19 +#define TYPE_OISEAU 20 +#define TYPE_CLE 21 +#define TYPE_DOOR 22 +#define TYPE_BALLE 23 +#define TYPE_SKATE 24 +#define TYPE_SHIELD 25 +#define TYPE_POWER 26 +#define TYPE_MAGICTRACK 27 +#define TYPE_TANK 28 +#define TYPE_BULLET 29 +#define TYPE_DRINK 30 +#define TYPE_CHARGE 31 +#define TYPE_BLUPIHELICO 32 +#define TYPE_BLUPITANK 33 +#define TYPE_GLU 34 +#define TYPE_TIPLOUF 35 +#define TYPE_POLLUTION 36 +#define TYPE_CLEAR 37 +#define TYPE_ELECTRO 38 +#define TYPE_TRESORTRACK 39 +#define TYPE_INVERT 40 +#define TYPE_INVERTSTART 41 +#define TYPE_INVERTSTOP 42 +#define TYPE_GUEPE 44 +#define TYPE_OVER 46 +#define TYPE_ASCENSEURs 47 +#define TYPE_ASCENSEURsi 48 +#define TYPE_CLE1 49 +#define TYPE_CLE2 50 +#define TYPE_CLE3 51 +#define TYPE_BRIDGE 52 +#define TYPE_TENTACULE 53 +#define TYPE_CREATURE 54 +#define TYPE_DYNAMITE 55 +#define TYPE_DYNAMITEf 56 +#define TYPE_SHIELDTRACK 57 +#define TYPE_HIDETRACK 58 +#define TYPE_EXPLO5 90 +#define TYPE_EXPLO6 91 +#define TYPE_EXPLO7 92 +#define TYPE_EXPLO8 93 +#define TYPE_EXPLO9 94 +#define TYPE_EXPLO10 95 +#define TYPE_BOMBEFOLLOW1 96 +#define TYPE_BOMBEFOLLOW2 97 +#define TYPE_SPLOUTCH1 98 +#define TYPE_SPLOUTCH2 99 +#define TYPE_SPLOUTCH3 100 +#define TYPE_BOMBEPERSO1 200 +#define TYPE_BOMBEPERSO2 201 +#define TYPE_BOMBEPERSO3 202 +#define TYPE_BOMBEPERSO4 203 + +// Steps : + +enum { + STEP_STOPSTART = 1, + STEP_ADVANCE, + STEP_STOPEND, + STEP_RECEDE +}; // Sons : -/* -#define SOUND_CLICK 0 -#define SOUND_JUMP1 1 -#define SOUND_JUMP2 2 -#define SOUND_JUMPEND 3 -#define SOUND_JUMPTOC 4 -#define SOUND_TURN 5 -#define SOUND_VERTIGO 6 -#define SOUND_DOWN 7 -#define SOUND_FALL 8 -#define SOUND_NEW 9 -#define SOUND_BOUM 10 -#define SOUND_TRESOR 11 -#define SOUND_EGG 12 -#define SOUND_ENDKO 13 -#define SOUND_ENDOK 14 -#define SOUND_HELICOSTART 15 -#define SOUND_HELICOHIGH 16 -#define SOUND_HELICOSTOP 17 -#define SOUND_HELICOLOW 18 -#define SOUND_LASTTRESOR 19 -#define SOUND_UP 20 -#define SOUND_LOOKUP 21 -#define SOUND_JUMP0 22 -#define SOUND_PLOUF 23 -#define SOUND_BLUP 24 -#define SOUND_SURF 25 -#define SOUND_DROWN 26 -#define SOUND_ERROR 27 -#define SOUND_JEEPSTART 28 -#define SOUND_JEEPHIGH 29 -#define SOUND_JEEPSTOP 30 -#define SOUND_JEEPLOW 31 -#define SOUND_BYE 32 -#define SOUND_DOOR 33 -#define SOUND_SUSPENDTOC 34 -#define SOUND_SUSPENDJUMP 35 -#define SOUND_SINGE 36 -#define SOUND_PATIENT 37 -*/ - +#define SOUND_CLICK 0 +#define SOUND_JUMP1 1 +#define SOUND_JUMP2 2 +#define SOUND_JUMPEND 3 +#define SOUND_JUMPTOC 4 +#define SOUND_TURN 5 +#define SOUND_VERTIGO 6 +#define SOUND_DOWN 7 +#define SOUND_FALL 8 +#define SOUND_NEW 9 +#define SOUND_BOUM 10 +#define SOUND_TRESOR 11 +#define SOUND_EGG 12 +#define SOUND_ENDKO 13 +#define SOUND_ENDOK 14 +#define SOUND_HELICOSTART 15 +#define SOUND_HELICOHIGH 16 +#define SOUND_HELICOSTOP 17 +#define SOUND_HELICOLOW 18 +#define SOUND_LASTTRESOR 19 +#define SOUND_UP 20 +#define SOUND_LOOKUP 21 +#define SOUND_JUMP0 22 +#define SOUND_PLOUF 23 +#define SOUND_BLUP 24 +#define SOUND_SURF 25 +#define SOUND_DROWN 26 +#define SOUND_ERROR 27 +#define SOUND_JEEPSTART 28 +#define SOUND_JEEPHIGH 29 +#define SOUND_JEEPSTOP 30 +#define SOUND_JEEPLOW 31 +#define SOUND_BYE 32 +#define SOUND_DOOR 33 +#define SOUND_SUSPENDTOC 34 +#define SOUND_SUSPENDJUMP 35 +#define SOUND_SINGE 36 +#define SOUND_PATIENT 37 +#define SOUND_PUSH 38 +#define SOUND_POP 39 +#define SOUND_JUMPAIE 40 +#define SOUND_RESSORT 41 +#define SOUND_STARTSHIELD 42 +#define SOUND_STOPSHIELD 43 +#define SOUND_STARTPOWER 44 +#define SOUND_STOPPOWER 45 +#define SOUND_OUF1 46 +#define SOUND_OUF2 47 +#define SOUND_OUF3 48 +#define SOUND_OUF4 49 +#define SOUND_SUCETTE 50 +#define SOUND_GLU 51 +#define SOUND_FIREOK 52 +#define SOUND_FIREKO 53 +#define SOUND_TAKEGLU 54 +#define SOUND_STARTCLOUD 55 +#define SOUND_STOPCLOUD 56 +#define SOUND_DRINK 57 +#define SOUND_CHARGE 58 +#define SOUND_ELECTRO 59 +#define SOUND_PERSOTAKE 60 +#define SOUND_PERSOPOSE 61 +#define SOUND_STARTHIDE 62 +#define SOUND_STOPHIDE 63 +#define SOUND_TIPLOUF 64 +#define SOUND_MOCKERY 65 +#define SOUND_INVERTSTART 66 +#define SOUND_INVERTSTOP 67 +#define SOUND_OVERSTOP 68 +#define SOUND_BLITZ 69 +#define SOUND_ECRASE 70 +#define SOUND_TELEPORTE 71 +#define SOUND_BRIDGE1 72 +#define SOUND_BRIDGE2 73 +#define SOUND_ANGEL 74 +#define SOUND_SCIE 75 +#define SOUND_SWITCHOFF 76 +#define SOUND_SWITCHON 77 +#define SOUND_JUMPENDb 78 +#define SOUND_JUMPTOCb 79 +#define SOUND_JUMPENDm 80 +#define SOUND_JUMPTOCm 81 +#define SOUND_JUMPENDg 82 +#define SOUND_JUMPTOCg 83 +#define SOUND_JUMPENDo 84 +#define SOUND_JUMPTOCo 85 +#define SOUND_JUMPENDk 86 +#define SOUND_JUMPTOCk 87 +#define SOUND_JUMPENDf 88 +#define SOUND_JUMPTOCf 89 +#define SOUND_JUMPENDh 90 +#define SOUND_JUMPTOCh 91 +#define SOUND_FOLLOW 92 #define SOUND_MOVIE 99 +// + +enum { + KEY_NONE = 0, + KEY_LEFT = 1, + KEY_RIGHT = 2, + KEY_UP = 4, + KEY_DOWN = 8, + KEY_JUMP = 16, + KEY_FIRE = 32 +}; + // Boutons (play) : #define MAXBUTTON 40 -#define BUTTON_GO 0 -#define BUTTON_STOP 1 -#define BUTTON_MANGE 2 -#define BUTTON_CARRY 3 -#define BUTTON_DEPOSE 4 -#define BUTTON_ABAT 5 -#define BUTTON_ROC 6 -#define BUTTON_CULTIVE 7 -#define BUTTON_BUILD1 8 -#define BUTTON_BUILD2 9 -#define BUTTON_BUILD3 10 -#define BUTTON_BUILD4 11 -#define BUTTON_BUILD5 12 -#define BUTTON_BUILD6 13 -#define BUTTON_MUR 14 -#define BUTTON_PALIS 15 -#define BUTTON_ABATn 16 -#define BUTTON_ROCn 17 -#define BUTTON_PONT 18 -#define BUTTON_TOUR 19 -#define BUTTON_BOIT 20 -#define BUTTON_LABO 21 -#define BUTTON_FLEUR 22 -#define BUTTON_FLEURn 23 -#define BUTTON_DYNAMITE 24 -#define BUTTON_BATEAU 25 -#define BUTTON_DJEEP 26 -#define BUTTON_DRAPEAU 27 -#define BUTTON_EXTRAIT 28 -#define BUTTON_FABJEEP 29 -#define BUTTON_FABMINE 30 -#define BUTTON_FABDISC 31 -#define BUTTON_REPEAT 32 -#define BUTTON_DARMURE 33 -#define BUTTON_FABARMURE 34 - - -// Erreurs : - -#define ERROR_MISC 1 -#define ERROR_GROUND 2 -#define ERROR_FREE 3 -#define ERROR_PONTOP 4 -#define ERROR_PONTTERM 5 -#define ERROR_TOURISOL 6 -#define ERROR_TOUREAU 7 -#define ERROR_TELE2 8 - - // Lutins pour la souris #define SPRITE_ARROW 1 @@ -237,271 +423,151 @@ #define SPRITE_FILL 14 - -#define MAXMOVEOBJECT = 200; -#define INPUT_LEFT 1 -#define INPUT_RIGHT 2 - - // User define message -#define WM_UPDATE (WM_USER+1) +enum { + WM_UPDATE = WM_USER + 1, -#define WM_DECOR1 (WM_USER+20) -#define WM_DECOR2 (WM_USER+21) -#define WM_DECOR3 (WM_USER+22) -#define WM_DECOR4 (WM_USER+23) -#define WM_DECOR5 (WM_USER+24) + WM_DECOR1 = WM_USER + 20, + WM_DECOR2, + WM_DECOR3, + WM_DECOR4, + WM_DECOR5, + WM_BUTTON0 = WM_USER + 200, + WM_BUTTON1, + WM_BUTTON2, + WM_BUTTON3, + WM_BUTTON4, + WM_BUTTON5, + WM_BUTTON6, + WM_BUTTON7, + WM_BUTTON8, + WM_BUTTON9, + WM_BUTTON10, + WM_BUTTON11, + WM_BUTTON12, + WM_BUTTON13, + WM_BUTTON14, + WM_BUTTON15, + WM_BUTTON16, + WM_BUTTON17, + WM_BUTTON18, + WM_BUTTON19, + WM_BUTTON20, + WM_BUTTON21, + WM_BUTTON22, + WM_BUTTON23, + WM_BUTTON24, + WM_BUTTON25, + WM_BUTTON26, + WM_BUTTON27, + WM_BUTTON28, + WM_BUTTON29, + WM_BUTTON30, + WM_BUTTON31, + WM_BUTTON32, + WM_BUTTON33, + WM_BUTTON34, + WM_BUTTON35, + WM_BUTTON36, + WM_BUTTON37, + WM_BUTTON38, + WM_BUTTON39, -#define WM_ACTION_GO (WM_USER+30) -#define WM_ACTION_ABAT1 (WM_USER+31) -#define WM_ACTION_ABAT2 (WM_USER+32) -#define WM_ACTION_ABAT3 (WM_USER+33) -#define WM_ACTION_ABAT4 (WM_USER+34) -#define WM_ACTION_ABAT5 (WM_USER+35) -#define WM_ACTION_ABAT6 (WM_USER+36) -#define WM_ACTION_BUILD1 (WM_USER+37) -#define WM_ACTION_BUILD2 (WM_USER+38) -#define WM_ACTION_BUILD3 (WM_USER+39) -#define WM_ACTION_BUILD4 (WM_USER+40) -#define WM_ACTION_BUILD5 (WM_USER+41) -#define WM_ACTION_BUILD6 (WM_USER+42) -#define WM_ACTION_STOP (WM_USER+43) -#define WM_ACTION_CARRY (WM_USER+44) -#define WM_ACTION_DEPOSE (WM_USER+45) -#define WM_ACTION_ROC1 (WM_USER+46) -#define WM_ACTION_ROC2 (WM_USER+47) -#define WM_ACTION_ROC3 (WM_USER+48) -#define WM_ACTION_ROC4 (WM_USER+49) -#define WM_ACTION_ROC5 (WM_USER+50) -#define WM_ACTION_ROC6 (WM_USER+51) -#define WM_ACTION_ROC7 (WM_USER+52) -#define WM_ACTION_MUR (WM_USER+53) -#define WM_ACTION_CULTIVE (WM_USER+54) -#define WM_ACTION_CULTIVE2 (WM_USER+55) -#define WM_ACTION_MANGE (WM_USER+56) -#define WM_ACTION_MAKE (WM_USER+57) -#define WM_ACTION_BUILD (WM_USER+58) -#define WM_ACTION_PALIS (WM_USER+59) -#define WM_ACTION_NEWBLUPI (WM_USER+60) -#define WM_ACTION_PONTE (WM_USER+61) -#define WM_ACTION_PONTS (WM_USER+62) -#define WM_ACTION_PONTO (WM_USER+63) -#define WM_ACTION_PONTN (WM_USER+64) -#define WM_ACTION_PONTEL (WM_USER+65) -#define WM_ACTION_PONTSL (WM_USER+66) -#define WM_ACTION_PONTOL (WM_USER+67) -#define WM_ACTION_PONTNL (WM_USER+68) -#define WM_ACTION_TOUR (WM_USER+69) -#define WM_ACTION_CARRY2 (WM_USER+70) -#define WM_ACTION_DEPOSE2 (WM_USER+71) -#define WM_ACTION_MANGE2 (WM_USER+72) -#define WM_ACTION_BOIT (WM_USER+73) -#define WM_ACTION_BOIT2 (WM_USER+74) -#define WM_ACTION_LABO (WM_USER+75) -#define WM_ACTION_FLEUR1 (WM_USER+76) -#define WM_ACTION_FLEUR2 (WM_USER+77) -#define WM_ACTION_DYNAMITE (WM_USER+78) -#define WM_ACTION_DYNAMITE2 (WM_USER+79) -#define WM_ACTION_T_DYNAMITE (WM_USER+80) -#define WM_ACTION_FLEUR3 (WM_USER+81) -#define WM_ACTION_R_BUILD1 (WM_USER+82) -#define WM_ACTION_R_BUILD2 (WM_USER+83) -#define WM_ACTION_R_BUILD3 (WM_USER+84) -#define WM_ACTION_R_BUILD4 (WM_USER+85) -#define WM_ACTION_R_MAKE1 (WM_USER+86) -#define WM_ACTION_R_MAKE2 (WM_USER+87) -#define WM_ACTION_R_MAKE3 (WM_USER+88) -#define WM_ACTION_R_MAKE4 (WM_USER+89) -#define WM_ACTION_R_BUILD5 (WM_USER+90) -#define WM_ACTION_R_MAKE5 (WM_USER+91) -#define WM_ACTION_BATEAUE (WM_USER+92) -#define WM_ACTION_BATEAUS (WM_USER+93) -#define WM_ACTION_BATEAUO (WM_USER+94) -#define WM_ACTION_BATEAUN (WM_USER+95) -#define WM_ACTION_BATEAUDE (WM_USER+96) -#define WM_ACTION_BATEAUDS (WM_USER+97) -#define WM_ACTION_BATEAUDO (WM_USER+98) -#define WM_ACTION_BATEAUDN (WM_USER+99) -#define WM_ACTION_BATEAUAE (WM_USER+100) -#define WM_ACTION_BATEAUAS (WM_USER+101) -#define WM_ACTION_BATEAUAO (WM_USER+102) -#define WM_ACTION_BATEAUAN (WM_USER+103) -#define WM_ACTION_MJEEP (WM_USER+104) -#define WM_ACTION_DJEEP (WM_USER+105) -#define WM_ACTION_DRAPEAU (WM_USER+106) -#define WM_ACTION_DRAPEAU2 (WM_USER+107) -#define WM_ACTION_DRAPEAU3 (WM_USER+108) -#define WM_ACTION_EXTRAIT (WM_USER+109) -#define WM_ACTION_FABJEEP (WM_USER+110) -#define WM_ACTION_FABMINE (WM_USER+111) -#define WM_ACTION_MINE (WM_USER+112) -#define WM_ACTION_MINE2 (WM_USER+113) -#define WM_ACTION_R_BUILD6 (WM_USER+114) -#define WM_ACTION_R_MAKE6 (WM_USER+115) -#define WM_ACTION_E_RAYON (WM_USER+116) -#define WM_ACTION_ELECTRO (WM_USER+117) -#define WM_ACTION_ELECTROm (WM_USER+118) -#define WM_ACTION_GRILLE (WM_USER+119) -#define WM_ACTION_MAISON (WM_USER+120) -#define WM_ACTION_FABDISC (WM_USER+121) -#define WM_ACTION_A_MORT (WM_USER+122) -#define WM_ACTION_REPEAT (WM_USER+123) -#define WM_ACTION_TELEPORTE00 (WM_USER+124) -#define WM_ACTION_TELEPORTE10 (WM_USER+125) -#define WM_ACTION_TELEPORTE01 (WM_USER+126) -#define WM_ACTION_TELEPORTE11 (WM_USER+127) -#define WM_ACTION_FABARMURE (WM_USER+128) -#define WM_ACTION_MARMURE (WM_USER+129) -#define WM_ACTION_DARMURE (WM_USER+130) - -#define WM_BUTTON0 (WM_USER+200) -#define WM_BUTTON1 (WM_USER+201) -#define WM_BUTTON2 (WM_USER+202) -#define WM_BUTTON3 (WM_USER+203) -#define WM_BUTTON4 (WM_USER+204) -#define WM_BUTTON5 (WM_USER+205) -#define WM_BUTTON6 (WM_USER+206) -#define WM_BUTTON7 (WM_USER+207) -#define WM_BUTTON8 (WM_USER+208) -#define WM_BUTTON9 (WM_USER+209) -#define WM_BUTTON10 (WM_USER+210) -#define WM_BUTTON11 (WM_USER+211) -#define WM_BUTTON12 (WM_USER+212) -#define WM_BUTTON13 (WM_USER+213) -#define WM_BUTTON14 (WM_USER+214) -#define WM_BUTTON15 (WM_USER+215) -#define WM_BUTTON16 (WM_USER+216) -#define WM_BUTTON17 (WM_USER+217) -#define WM_BUTTON18 (WM_USER+218) -#define WM_BUTTON19 (WM_USER+219) -#define WM_BUTTON20 (WM_USER+220) -#define WM_BUTTON21 (WM_USER+221) -#define WM_BUTTON22 (WM_USER+222) -#define WM_BUTTON23 (WM_USER+223) -#define WM_BUTTON24 (WM_USER+224) -#define WM_BUTTON25 (WM_USER+225) -#define WM_BUTTON26 (WM_USER+226) -#define WM_BUTTON27 (WM_USER+227) -#define WM_BUTTON28 (WM_USER+228) -#define WM_BUTTON29 (WM_USER+229) -#define WM_BUTTON30 (WM_USER+230) -#define WM_BUTTON31 (WM_USER+231) -#define WM_BUTTON32 (WM_USER+232) -#define WM_BUTTON33 (WM_USER+233) -#define WM_BUTTON34 (WM_USER+234) -#define WM_BUTTON35 (WM_USER+235) -#define WM_BUTTON36 (WM_USER+236) -#define WM_BUTTON37 (WM_USER+237) -#define WM_BUTTON38 (WM_USER+238) -#define WM_BUTTON39 (WM_USER+239) - -#define WM_READ0 (WM_USER+300) -#define WM_READ1 (WM_USER+301) -#define WM_READ2 (WM_USER+302) -#define WM_READ3 (WM_USER+303) -#define WM_READ4 (WM_USER+304) -#define WM_READ5 (WM_USER+305) -#define WM_READ6 (WM_USER+306) -#define WM_READ7 (WM_USER+307) -#define WM_READ8 (WM_USER+308) -#define WM_READ9 (WM_USER+309) - -#define WM_WRITE0 (WM_USER+310) -#define WM_WRITE1 (WM_USER+311) -#define WM_WRITE2 (WM_USER+312) -#define WM_WRITE3 (WM_USER+313) -#define WM_WRITE4 (WM_USER+314) -#define WM_WRITE5 (WM_USER+315) -#define WM_WRITE6 (WM_USER+316) -#define WM_WRITE7 (WM_USER+317) -#define WM_WRITE8 (WM_USER+318) -#define WM_WRITE9 (WM_USER+319) - -#define WM_PHASE_INIT (WM_USER+500) -#define WM_PHASE_PLAY (WM_USER+501) -#define WM_PHASE_BUILD (WM_USER+502) -#define WM_PHASE_READ (WM_USER+503) -#define WM_PHASE_WRITE (WM_USER+504) -#define WM_PHASE_INFO (WM_USER+505) -#define WM_PHASE_BUTTON (WM_USER+506) -#define WM_PHASE_TERM (WM_USER+507) -#define WM_PHASE_WIN (WM_USER+508) -#define WM_PHASE_LOST (WM_USER+509) -#define WM_PHASE_STOP (WM_USER+510) - -#define WM_PHASE_MUSIC (WM_USER+512) -#define WM_PHASE_PLAYMOVIE (WM_USER+513) -#define WM_PHASE_WINMOVIE (WM_USER+514) -#define WM_PHASE_SCHOOL (WM_USER+515) -#define WM_PHASE_MISSION (WM_USER+516) -#define WM_PHASE_LASTWIN (WM_USER+517) -#define WM_PHASE_WRITEp (WM_USER+518) -#define WM_PHASE_SETUPp (WM_USER+519) -#define WM_PHASE_REGION (WM_USER+520) -#define WM_PHASE_INSERT (WM_USER+521) -#define WM_PHASE_HISTORY0 (WM_USER+522) -#define WM_PHASE_HISTORY1 (WM_USER+523) -#define WM_PHASE_HELP (WM_USER+524) -#define WM_PHASE_H0MOVIE (WM_USER+525) -#define WM_PHASE_H1MOVIE (WM_USER+526) -#define WM_PHASE_H2MOVIE (WM_USER+527) -#define WM_PHASE_TESTCD (WM_USER+528) -#define WM_PHASE_MANUEL (WM_USER+529) -#define WM_PHASE_PRIVATE (WM_USER+530) -#define WM_PHASE_UNDO (WM_USER+531) -#define WM_PHASE_BYE (WM_USER+532) -#define WM_PHASE_SKILL1 (WM_USER+533) -#define WM_PHASE_SKILL2 (WM_USER+534) -#define WM_PHASE_DEMO (WM_USER+535) -#define WM_PHASE_INTRO1 (WM_USER+536) -#define WM_PHASE_INTRO2 (WM_USER+537) -#define WM_PHASE_PLAYTEST (WM_USER+538) -#define WM_PHASE_WINMOVIEDESIGN (WM_USER+539) -#define WM_PHASE_WINMOVIEMULTI (WM_USER+540) - -#define WM_PREV (WM_USER+600) -#define WM_NEXT (WM_USER+601) -#define WM_MOVIE (WM_USER+602) -#define WM_PHASE_CREATE 1579 -#define WM_PHASE_608 1544 - -#define WM_PHASE_NAMEg 1527 -#define WM_PHASE_CLEARg 1528 -#define WM_PHASE_SETUP 1534 -#define WM_PHASE_DOPLAY 1539 -#define WM_PHASE_WINd 1546 -#define WM_PHASE_LOSTd 1547 -#define WM_PHASE_WINMOVIEd 1548 -#define WM_PHASE_WINm 1549 -#define WM_PHASE_LOSTm 1550 -#define WM_PHASE_WINMOVIEm 1551 -#define WM_PHASE_PRIVATE 1554 -#define WM_PHASE_NAMEd 1558 -#define WM_PHASE_READd 1560 -#define WM_PHASE_CONFIRM 1562 -#define WM_PHASE_YES 1563 -#define WM_PHASE_SERVICE 1568 -#define WM_PHASE_DPLAY_DO_SERVICE 1569 -#define WM_PHASE_DPLAY_CANCEL_SERVICE 1570 -#define WM_PHASE_SESSION 1571 -#define WM_PHASE_JOINGAME 1572 -#define WM_PHASE_DPLAY_CREATE_LOBBY 1573 -#define WM_PHASE_DPLAY_REFRESH 1574 -#define WM_PHASE_DPLAY_CANCEL_SESSION 1575 -#define WM_PHASE_MULTI 1576 -#define WM_PHASE_DPLAY_CREATE 1580 -#define WM_PHASE_634 1588 -#define WM_PHASE_GWRITE 1584 -#define WM_PHASE_GREADp 1585 -#define WM_PHASE_GREAD 1586 -#define WM_PHASE_DOQUIT 1587 -#define WM_PHASE_GAMER 1545 -#define WM_PHASE_CLEARg 1528 -#define WM_PHASE_CLEARd 1561 + WM_READ0 = WM_USER + 300, + WM_READ1, + WM_READ2, + WM_READ3, + WM_READ4, + WM_READ5, + WM_READ6, + WM_READ7, + WM_READ8, + WM_READ9, + WM_WRITE0, + WM_WRITE1, + WM_WRITE2, + WM_WRITE3, + WM_WRITE4, + WM_WRITE5, + WM_WRITE6, + WM_WRITE7, + WM_WRITE8, + WM_WRITE9, + WM_PHASE_INIT = WM_USER + 500, + WM_PHASE_PLAY, + WM_PHASE_BUILD, + WM_PHASE_NAMEGAMER, + WM_PHASE_CLEARGAMER, + WM_PHASE_INFO, + WM_PHASE_PLAYTEST, + WM_PHASE_1531, + WM_PHASE_WIN, + WM_PHASE_LOST, + WM_PHASE_SETUP, + WM_PHASE_MUSIC, + WM_PHASE_PLAYMOVIE, + WM_PHASE_WINMOVIE, + WM_PHASE_1539, + WM_PHASE_DOPLAY, + WM_PHASE_LASTWIN, // PB vestige + WM_PHASE_SETUPp, + WM_PHASE_REGION, + WM_PHASE_INSERT, + WM_PHASE_1544, + WM_PHASE_GAMER, + WM_PHASE_WINDESIGN, + WM_PHASE_LOSTDESIGN, + WM_PHASE_WINMOVIEDESIGN, + WM_PHASE_WINMULTI, + WM_PHASE_LOSTMULTI, + WM_PHASE_WINMOVIEMULTI, + WM_PHASE_TESTCD, + WM_PHASE_MANUEL, + WM_PHASE_PRIVATE, + WM_PHASE_UNDO, + WM_PHASE_BYE, + WM_PHASE_DEMO, + WM_PHASE_NAMEDESIGN, + WM_PHASE_WRITEDESIGN, + WM_PHASE_READDESIGN, + WM_PHASE_CLEARDESIGN, + WM_PHASE_1562, + WM_PHASE_1563, + WM_PHASE_1564, + WM_PHASE_1565, + WM_PHASE_1566, + WM_PHASE_1567, + WM_PHASE_SERVICE, + WM_PHASE_DPLAY_DO_SERVICE, + WM_PHASE_DPLAY_CANCEL_SERVICE, + WM_PHASE_SESSION, + WM_PHASE_1572, + WM_PHASE_DPLAY_CREATE_LOBBY, + WM_PHASE_DPLAY_REFRESH, + WM_PHASE_DPLAY_CANCEL_SESSION, + WM_PHASE_MULTI, + WM_PHASE_DPLAY_START_GAME_2, + WM_PHASE_DPLAY_CANCEL_MULTI, + WM_PHASE_CREATE, + WM_PHASE_DPLAY_CREATE, + WM_PHASE_DPLAY_CANCEL_CREATE, + WM_PHASE_STOP, + WM_PHASE_HELP, + WM_PHASE_GWRITE, + WM_PHASE_GREADp, + WM_PHASE_GREAD, + WM_PHASE_DOQUIT, + WM_PHASE_1588, + WM_PHASE_INTRO1, // PB vestige + WM_PHASE_INTRO2, // PB vestige + WM_PREV = WM_USER + 600, + WM_NEXT, + WM_MOVIE +}; // Types de gestion de la souris. @@ -509,23 +575,677 @@ #define MOUSETYPEWIN 2 #define MOUSETYPEWINPOS 3 +// Button icons + +enum { + IC_BT_TECH = 0, // Item: Square tech-block + IC_BT_SPECIALTECH, // Item: Special tech-block + IC_BT_TRIANGULARTECH, // Item: Triangular tech-block + IC_BT_9, // Item: Special tech-block (T shape) + IC_BT_10, // Scrolling: Horizontal and vertical (duplicate?) + IC_BT_BLUPI, // Item: Yellow Blupi + IC_BT_CANCEL, // UI: Black X (cancel) + IC_BT_TREASURE, // Item: Treasure chest + IC_BT_BOMB, // Item: Bomb + IC_BT_BOMBUP, // Item: Hanging bomb + IC_BT_EGG, // Item: Egg + IC_BT_GOAL, // Item: Goal + IC_BT_CANCEL2, // UI: Yellow X + IC_BT_HORIZONTAL, // Scrolling: Horizontal only + IC_BT_VERTICAL, // Scrolling: Vertical only + IC_BT_HORIZONTALVERTICAL, // Scrolling: Horizontal and vertical + IC_BT_BULLDOZER, // Item: Bulldozer + IC_BT_CASE, // Item: Wooden case + IC_BT_ACCEPT, // UI: Black checkmark + IC_BT_LIFTFAST, // Item: Fast lift + IC_BT_LIFTNORMAL, // Item: Normal lift + IC_BT_LIFTSLOW, // Item: Slow lift + IC_BT_ROCK, // Item: Square rock + IC_BT_WOODENWALL, // Item: Wooden wall + IC_BT_HELICOPTER, // Item: Helicopter + IC_BT_DREAM, // Item: Dream + IC_BT_LAVA, // Item: Lava + IC_BT_SECRETTECH, // Item: Secret tech-block + IC_BT_LIFTFASTSLOW, // Item: Fast/slow lift + IC_BT_PALMTREE, // Item: Palmtree + IC_BT_SUPPORT, // Item: Support + IC_BT_TREE, // Item: Tree + IC_BT_VEGETATION, // Item: Vegetation + IC_BT_HOUSE, // Item: House + IC_BT_MECH, // Item: Square mechanical + IC_BT_SPECIALMECH, // Item: Special mechanical + IC_BT_DELETE, // UI: Red X (delete) + IC_BT_BIGMECH, // Item: Mechanical background element + IC_BT_WATER, // Item: Water + IC_BT_GRASS, // Item: Grass + IC_BT_STOP, // UI: STOP sign + IC_BT_WIND, // Item: Wind + IC_BT_FAN, // Item: Fan + IC_BT_CREATE, // UI: Create multiplayer lobby + IC_BT_MUSIC, // UI: Music + IC_BT_JOIN, // UI: Join multiplayer lobby + IC_BT_NAME, // UI: Edit name + IC_BT_SETUP, // UI: Setup (analog gauge) + IC_BT_PLAY, // UI: Play (dice) + IC_BT_DESIGN, // UI: Design (wrench and screwdriver) + IC_BT_ARROWLEFT, // UI: Arrow pointing left + IC_BT_ARROWRIGHT, // UI: Arrow pointing right + IC_BT_READ, // UI: Load game + IC_BT_WRITE, // UI: Save game + IC_BT_MOVINGBOMB, // Item: Moving bomb + IC_BT_FISH, // Item: Fish + IC_BT_BAR, // Item: Bar to hang from + IC_BT_JEEP, // Item: Jeep + IC_BT_FURNITURE, // Item: Furniture + IC_BT_TRIANGULARROCK, // Item: Triangular rock + IC_BT_BIRD, // Item: Bird + IC_BT_TINY, // Scrolling: Tiny (No scrolling) + IC_BT_LEVELSTART, // Item: Level start + IC_BT_DOOR, // Item: Door (hub) + IC_BT_KEY, // Item: Key (goal) + IC_BT_FACADE, // Item: Building facade + IC_BT_ROOF, // Item: Roof + IC_BT_SECRETMECH, // Item: Secret mechanical + IC_BT_SECRETROCK, // Item: Secret rock + IC_BT_MARINE, // Item: Marine plant + IC_BT_SPRING, // Item: Spring + IC_BT_SKATEBOARD, // Item: Skateboard + IC_BT_ARROWUP, // UI: Arrow pointing up + IC_BT_ARROWDOWN, // UI: Arrow pointing down + IC_BT_SHIELD, // Item: Shield + IC_BT_LOLLIPOP, // Item: Lollipop + IC_BT_SECRETCASE, // Item: Secret wooden case + IC_BT_CONTINUE, // UI: Continue game + IC_BT_HALT, // UI: Halt (hand) + IC_BT_INVISIBLEBLOCK, // Item: Invisible block + IC_BT_KIDSSTUFF, // Item: Kid's stuff block + IC_BT_SPECIALKIDSSTUFF, // Item: Special kid's stuff + IC_BT_BIGKIDSSTUFF, // Item: Kid's stuff background element + IC_BT_MULTI, // UI: Multiplayer + IC_BT_DEMO, // UI: Demo + IC_BT_TANK, // Item: Tank + IC_BT_HELP, // UI: Help + IC_BT_DYNAMITE, // Item: Dynamite + IC_BT_GLUE, // Item: Glue supply + IC_BT_DRINK, // Item: Invisibility potion + IC_BT_NOTREADY, // UI: Not ready (multiplayer lobby) + IC_BT_READY, // UI: Ready (multiplayer lobby) + IC_BT_PERSO, // Item: Personal bomb + IC_BT_CHARGER, // Item: Recharging device + IC_BT_SEND, // UI: Send message + IC_BT_HELICOENEMY, // Item: Heliported enemy + IC_BT_BLUPI1, // Item: Orange Blupi + IC_BT_BLUPI2, // Item: Blue Blupi + IC_BT_BLUPI3, // Item: Green Blupi + IC_BT_TANKENEMY, // Item: Motorized enemy + IC_BT_CHEESE, // Item: Cheese + IC_BT_INVERTER, // Item: Inverter + IC_BT_PERSO0, // Item: Yellow personal bomb + IC_BT_PERSO1, // Item: Orange personal bomb + IC_BT_PERSO2, // Item: Blue personal bomb + IC_BT_PERSO3, // Item: Green personal bomb + IC_BT_PIPES, // Item: Pipes + IC_BT_HOMINGBOMB, // Item: Homing bomb + IC_BT_TEAM1, // UI: Select team 1 + IC_BT_TEAM2, // UI: Select team 2 + IC_BT_TEAM3, // UI: Select team 3 + IC_BT_TEAM4, // UI: Select team 4 + IC_BT_BRICKS, // Item: Bricks + IC_BT_WASP, // Item: Wasp + IC_BT_TEAMLITTLE1, // Gameplay: Team 1 player indicator + IC_BT_TEAMLITTLE2, // Gameplay: Team 2 player indicator + IC_BT_TEAMLITTLE3, // Gameplay: Team 3 player indicator + IC_BT_TEAMLITTLE4, // Gameplay: Team 4 player indicator + IC_BT_CAVE, // Item: Cave + IC_BT_HOVERCRAFT, // Item: Hovercraft + IC_BT_LIGHTNING, // Item: Lightning + IC_BT_CONVEYOR, // Item: Lift with conveyor + IC_BT_CRUSHER, // Item: Crusher + IC_BT_VANISH, // Item: Vanishing bloc + IC_BT_TELEPORTER, // Item: Teleporter + IC_BT_KEYCOLOR, // Item: Key (color) + IC_BT_DOORCOLOR, // Item: Door (color) + IC_BT_SECRETCAVE, // Item: Secret cave + IC_BT_SECRETCHEESE, // Item: Secret cheese + IC_BT_SLIME, // Item: Slime block + IC_BT_BIGSLIME, // Item: Slime background element + IC_BT_SLIMEFLOOR, // Item: Floor slime trap + IC_BT_SAW, // Item: Saw + IC_BT_LOWCOLORBACK, // UI: 256-color background + IC_BT_TRUECOLORBACK, // UI: 65536-color background + IC_BT_LOWCOLORDECOR, // UI: 256-color foreground + IC_BT_TRUECOLORDECOR, // UI: 65536-color foreground + IC_BT_PALACE, // Item: Palace + IC_BT_PALACEELEMENT, // Item: Element for palace + IC_BT_BIGPALACE, // Item: Palace background element + IC_BT_SLIMECREATURE, // Item: Slime creature + IC_BT_BRIDGE, // Item: Fragile bridge + IC_BT_SPIDERWEB, // Item: Spider's web + IC_BT_SLIMECEILING, // Item: Ceiling slime trap + IC_BT_TREASUREDOOR // Item: Numbered treasure door +}; -// Conditions pour gagner. - -typedef struct -{ - short bHachBlupi; // blupi sur dalle hachur�e - short bHachPlanche; // planches sur dalle hachur�e - short bStopFire; // feu �teint - short nbMinBlupi; // nb de blupi n�cessaires - short nbMaxBlupi; // nb de blupi n�cessaires - short bHomeBlupi; // blupi � la maison - short bKillRobots; // plus d'ennemis - short bHachTomate; // tomates sur dalle hachur�e - short bHachMetal; // m�tal sur dalle hachur�e - short bHachRobot; // robot sur dalle hachur�e - short reserve[14]; +namespace Object { + enum Object { + Empty = -1, + Hili, + TechSquare_1, + TechSquare_2, + TechSquare_3, + TechSquare_4, + TechSquare_5, + TechSquare_6, + TechSquare_7, + TechSquare_8, + TechSquare_9, + TechSquare_10, + TechSquare_11, + TechSquare_12, + TechSquare_13, + TechSquare_14, + TechTriRight_1, + TechTriRight_2, // 16 + TechTriLeft_1, + TechTriLeft_2, + TechSpecial_1, + TechSpecial_2, + TechSpecial_3, + TechSecret_1, + TechSpecial_4, + TechSpecial_5, + TechSpecial_6, + TechSpecial_7, + TechSpecial_8, + TechSpecial_9, + TechSpecial_10, + LiftPoint_1, + LiftPoint_2, + Caisse_1, // 32 + Caisse_2, + Caisse_3, + RockSquare_1, + RockSquare_2, + RockSquare_3, + RockSquare_4, + RockSquare_5, + RockSquare_6, + WoodWall_1, + WoodWall_2, + WoodWall_3, + WoodWall_4, + WoodWall_5, + WoodWall_6, + WoodWall_7, + Dream_1, // 48 + Dream_2, + Dream_3, + Dream_4, + Dream_5, + Dream_6, + Dream_7, + Dream_8, + Dream_9, + Dream_10, + Dream_11, + Dream_12, + Dream_13, + Dream_14, + Dream_15, + Dream_16, + Dream_17, // 64 + Dream_18, + Dream_19, + Dream_20, + Lava_1, + Lava_2, + Lava_3, + Lava_4, + Lava_5, + TechSecret_2, + RockTriLeft_1, + RockTriRight_1, + Support_1, + Support_2, + MechSquare_1, + MechSquare_2, + MechSquare_3, // 80 + MechSquare_4, + MechSquare_5, + MechSquare_6, + MechSquare_7, + MechSecret_1, + MechSecret_2, + MechSpecial_1, + MechSpecial_2, + MechSpecial_3, + MechSpecial_4, + WaterSquare_1, + WaterSurf_1, + WaterSurf_2, + WaterSurf_3, + WaterSurf_4, + WaterSquare_2, // 96 + WaterSquare_3, + WaterSquare_4, + Splash_1, + Splash_2, + Splash_3, + Splash_4, + Bubble_1, + Bubble_2, + Bubble_3, + Bubble_4, + GrassSquare_1, + GrassLeft, + GrassRight, + WindLeft_1, + WindLeft_2, // 112 + WindLeft_3, + WindLeft_4, + WindRight_1, + WindRight_2, + WindRight_3, + WindRight_4, + WindUp_1, + WindUp_2, + WindUp_3, + WindUp_4, + WindDown_1, + WindDown_2, + WindDown_3, + WindDown_4, + FanLeft_1, + FanLeft_2, // 128 + FanLeft_3, + FanRight_1, + FanRight_2, + FanRight_3, + FanUp_1, + FanUp_2, + FanUp_3, + FanDown_1, + FanDown_2, + FanDown_3, + Bar_1, + Bookshelf_1, + Bookshelf_2, + Bookshelf_3, + Bookshelf_4, + Bookshelf_5, + RockSquare_7, // 144 + RockSquare_8, + RockSquare_9, + RockSquare_10, + RockSquare_11, + RockSquare_12, + RockSquare_13, + RockSquare_14, + RockSquare_15, + RockSquare_16, + RockTriLeft_2, + RockTriRight_2, + RockSquare_17, + GrassSquare_2, + Course_1, + Course_2, + Course_3, // 160 + Course_4, + Course_5, + Course_6, + Course_7, + Course_8, + CourseDone_1, + CourseDone_2, + CourseDone_3, + CourseDone_4, + CourseDone_5, + CourseDone_6, + CourseDone_7, + CourseDone_8, + Level_1, + Level_2, + Level_3, // 176 + Level_4, + Level_5, + Level_6, + Level_7, + Level_8, + DoorLevel, + DoorCourse, + CourseBack, + RockSecret, + Facade_1, + Facade_2, + Facade_3, + Facade_4, + Facade_5, + Facade_6, + Facade_7, // 192 + Roof_1, + Roof_2, + Roof_3, + Roof_4, + Roof_5, + Support_3, + Support_4, + Support_5, + Support_6, + Bar_2, + Marine_1, + Marine_2, + Marine_3, + Marine_4, + Marine_5, + Marine_6, // 208 + Spring_1, + Spring_2, + Spring_3, + Spring_4, + Spring_5, + Invisible, + KidsSquare_1, + KidsSquare_2, + KidsSquare_3, + KidsSquare_4, + KidsSquare_5, + KidsSquare_6, + KidsSquare_7, + KidsSquare_8, + KidsSpecial_1, + KidsSpecial_2, // 224 + KidsSpecial_3, + KidsSpecial_4, + KidsSpecial_5, + KidsSpecial_6, + KidsSpecial_7, + KidsSquare_9, + KidsSquare_10, + KidsSpecial_8, + KidsSquare_11, + KidsSquare_12, + Support_7, + Support_8, + DitherMask, + Charger_1, + Charger_2, + Charger_3, // 240 + Charger_4, + Charger_5, + Charger_6, + Splash_5, + Unk_F5, + CheeseSquare_1, + CheeseSquare_2, + CheeseSquare_3, + CheeseSquare_4, + Pipes_1, + Pipes_2, + Pipes_3, + Pipes_4, + Pipes_5, + Pipes_6, + Pipes_7, // 256 + Pipes_8, + Pipes_9, + Pipes_10, + Pipes_11, + Bricks_1, + Bricks_2, + Bricks_3, + CheeseSupport_1, + CheeseSupport_2, + CheeseSupport_3, + CheeseSupport_4, + CheeseSupport_5, + CheeseSupport_6, + CheeseSupport_7, + CheeseSupport_8, + CheeseSupport_9, // 272 + CheeseSupport_10, + CheeseSupport_11, + CheeseSupport_12, + CheeseSupport_13, + CheeseSupport_14, + CheeseSupport_15, + CheeseSupport_16, + CheeseSupport_17, + CheeseSupport_18, + CheeseSupport_19, + Bricks_4, + Cave_1, + CaveSupport_1, + CaveSupport_2, + CaveSupport_3, + CaveSupport_4, // 288 + CaveSupport_5, + CaveSupport_6, + CaveSupport_7, + CaveSupport_8, + CaveSupport_9, + CaveSupport_10, + CaveSupport_11, + CaveSupport_12, + CaveSupport_13, + CaveSupport_14, + CaveSupport_15, + CaveSupport_16, + Cave_2, + CaveSupport_17, + CaveSupport_18, + LightningMachine, // 304 + Lightning_1, + Lightning_2, + Lightning_3, + Lightning_4, + Course_9, + CourseDone_9, + Conveyor_1, + Conveyor_2, + Conveyor_3, + Conveyor_4, + Conveyor_5, + Conveyor_6, + Crusher_1, + Crusher_2, + Crusher_3, + Crusher_4, // 320 + Crusher_5, + Crusher_6, + Crusher_7, + Vanish_1, + Vanish_2, + Vanish_3, + Vanish_4, + Vanish_5, + Vanish_6, + Teleporter_1, + Teleporter_2, + Teleporter_3, + Teleporter_4, + DoorRed, + DoorGreen, + DoorBlue, // 336 + CaveSecret, + Cave_3, + CheeseSecret, + CheeseSquare_5, + Slime_1, + Slime_2, + Slime_3, + Slime_4, + Slime_5, + Slime_6, + Slime_7, + Slime_8, + Slime_9, + Slime_10, + Slime_11, + Slime_12, // 352 + Slime_13, + Slime_14, + Slime_15, + Slime_16, + Slime_17, + Slime_18, + Slime_19, + Slime_20, + Slime_21, + Slime_22, + Slime_23, + FragileBridge_1, + FragileBridge_2, + FragileBridge_3, + FragileBridge_4, + FragileBridge_5, // 368 + FragileBridge_6, + FragileBridge_7, + FragileBridge_8, + FragileBridge_9, + SlimeTrapFloor_1, + SlimeTrapFloor_2, + Support_9, + Support_10, + Support_11, + Saw_1, + Saw_2, + Saw_3, + Saw_4, + Saw_5, + Saw_6, + SawSwitchOn, // 382 + SawSwitchOff, + Palace_1, + Palace_2, + Palace_3, + Palace_4, + Palace_5, + Palace_6, + Palace_7, + Palace_8, + Palace_9, + Palace_10, + Palace_11, + Palace_12, + PalaceElement_1, + PalaceElement_2, + PalaceElement_3, // 398 + SpiderWeb_1, + SpiderWeb_2, + SpiderWeb_3, + SlimeTrapCeiling_1, + SlimeTrapCeiling_2, + SlimeTrapCeiling_3, + SlimeTrapCeiling_4, + SlimeTrapCeiling_5, + SlimeTrapCeiling_6, + SlimeTrapCeiling_7, + Course_10, + Course_11, + Course_12, + Course_13, + Course_14, + CourseDone_10, // 414 + CourseDone_11, + CourseDone_12, + CourseDone_13, + CourseDone_14, + DoorTreasure_1, + DoorTreasure_2, + DoorTreasure_3, + DoorTreasure_4, + DoorTreasure_5, + DoorTreasure_6, + DoorTreasure_7, + DoorTreasure_8, + DoorTreasure_9, + DoorTreasure_10, + DoorTreasure_11, + DoorTreasure_12, // 430 + DoorTreasure_13, + DoorTreasure_14, + DoorTreasure_15, + DoorTreasure_16, + DoorTreasure_17, + DoorTreasure_18, + DoorTreasure_19, + DoorTreasure_20 + }; } -Term; +#define CLE_RED (1 << 0) +#define CLE_GREEN (1 << 1) +#define CLE_BLUE (1 << 2) + +typedef struct { + short x; + short y; +} ShortPOINT; + +typedef struct { + ShortPOINT pos; + ShortPOINT offset; + ShortPOINT size; +} IconPack; + +// helpers for POINT + +POINT operator+(POINT p, const POINT& a) +{ + return { a.x + p.x, a.y + p.y }; +} + +POINT operator-(POINT p, const POINT& a) +{ + return { a.x - p.x, a.y - p.y }; +} + +POINT operator*(POINT p, const POINT& a) +{ + return { a.x * p.x, a.y * p.y }; +} + +POINT operator/(POINT p, const POINT& a) +{ + return { p.x / a.x, p.y / a.y }; +} + +POINT operator*(POINT p, const int& a) +{ + return { p.x * a, p.y * a }; +} + +POINT operator/(POINT p, const int& a) +{ + return { p.x / a, p.y / a }; +} + +POINT operator+=(POINT p, const POINT& a) +{ + return { p.x += a.x, p.y += a.y }; +} + +POINT operator-=(POINT p, const POINT& a) +{ + return { p.x -= a.x, p.y -= a.y }; +} + +POINT operator*=(POINT p, const POINT& a) +{ + return { p.x *= a.x, p.y *= a.y }; +} + +POINT operator/=(POINT p, const POINT& a) +{ + return { p.x /= a.x, p.y /= a.y }; +} + +POINT operator*=(POINT p, const int& a) +{ + return { p.x *= a, p.y *= a }; +} + +POINT operator/=(POINT p, const int& a) +{ + return { p.x /= a, p.y /= a }; +} \ No newline at end of file diff --git a/src/event.cpp b/src/event.cpp index 9a3fe84..9be19c7 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -104,1194 +104,324 @@ static Phase table[] = WM_PHASE_TESTCD, "init.blp", FALSE, - { - { - 0 - }, - }, + FALSE, + { 0 } }, - { WM_PHASE_INIT, "init.blp", FALSE, + FALSE, { + { + WM_PHASE_GAMER, + 0,{ 1, IC_BT_PLAY }, + 0x56, 0x19a, + { 1, TX_BUTTON_PLAYP } + }, { WM_PHASE_DEMO, - 0, {1,48}, - 86, 410, - {1,TX_BUTTON_DEMO}, + 0,{ 1, IC_BT_DEMO }, + 0x80, 0x19a, + { 1, 0xd4 } }, { +#if _BYE WM_PHASE_BYE, -//? WM_CLOSE, - 0, {1,84}, - 128, 410, - {1,TX_BUTTON_QUITTER}, - }, - { - WM_PHASE_SCHOOL, - 0, {1,6}, - 21, 410, - {1,TX_BUTTON_APPRENDRE}, - }, - { - 0 - }, - }, +#else + WM_CLOSE, +#endif //_BYE + 0,{ 1, IC_BT_CANCEL }, + 0x21c, 0x19a, + { 1, TX_BUTTON_QUITTER } + } + } }, - { WM_PHASE_GAMER, "gamer.blp", FALSE, + FALSE, { { WM_BUTTON1, - 0, {0,0}, - 60, 58, - {1,TX_CHOOSEPLAYER}, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 0, + { 1, TX_CHOOSEGAMER } }, { WM_BUTTON2, - 0, {0,0}, - 60, 98, - {1,TX_CHOOSEPLAYER}, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 1, + { 1, TX_CHOOSEGAMER } }, { WM_BUTTON3, - 0, {0,0}, - 60, 138, - {1,TX_CHOOSEPLAYER}, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 2, + { 1, TX_CHOOSEGAMER } }, { WM_BUTTON4, - 0, {0,0}, - 60, 178, - {1,TX_CHOOSEPLAYER}, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 3, + { 1, TX_CHOOSEGAMER } }, { WM_BUTTON5, - 0, {0,0}, - 60, 218, - {1,TX_CHOOSEPLAYER}, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 4, + { 1, TX_CHOOSEGAMER } }, { WM_BUTTON6, - 0, {0,0}, - 60, 258, - {1,TX_CHOOSEPLAYER}, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 5, + { 1, TX_CHOOSEGAMER } + }, { WM_BUTTON7, - 0, {0,0}, - 60, 298, - {1,TX_CHOOSEPLAYER}, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 6, + { 1, TX_CHOOSEGAMER } }, { WM_BUTTON8, - 0, {0,0}, - 60, 338, - {1,TX_CHOOSEPLAYER}, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 7, + { 1, TX_CHOOSEGAMER } + }, + /* // unused gamer slots 9-10 mentioned in promotional texts + { + WM_BUTTON9, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 8, + { 1, TX_CHOOSEGAMER } }, { - WM_PHASE_NAMEg, - 0, {1,46}, - 546, 178, - {1,TX_PLAYERSNAME}, + WM_BUTTON10, + 0,{ 0 }, + 60, 58 + DIMBUTTONX * 9, + { 1, TX_CHOOSEGAMER } + }, + */ + { + WM_PHASE_NAMEGAMER, + 0,{ 1, IC_BT_NAME }, + 0xb2, 0x222, + { 1, TX_PLAYERSNAME } }, { - WM_PHASE_CLEARg, - 0, {1,36}, - 546, 220, - {1, TX_CLEARPLAYER}, + WM_PHASE_CLEARGAMER, + 0,{ 1, IC_BT_DELETE }, + 0xdc, 0x222, + { 1, /* i dont remember lol */ 0 } }, { WM_PHASE_DOPLAY, - 0, {1, 48}, - 65, 414, - {1, TX_SINGLEPLAYER}, + 0,{ 1, IC_BT_PLAY }, + 0x41, 0x19e, + { 1, 0xc3 } }, { WM_PHASE_SERVICE, - 0, {1, 83}, - 107, 414, - {1, TX_MUTLIPLAYER}, + 0,{ 1, IC_BT_MULTI }, + 0x6b, 0x19e, + { 1, 0xc4 } }, { WM_PHASE_PRIVATE, - 0, {1, 49}, - 149, 414, - {1, TX_DESIGN}, + 0,{ 1, IC_BT_DESIGN }, + 0x95, 0x19e, + { 1, 0xbc } }, { WM_PHASE_GREAD, - 0, {1, 52}, - 191, 414, - {1, TX_OPEN}, + 0,{ 1, IC_BT_READ }, + 0xbf, 0x19e, + { 1, 0x108 } }, { WM_PHASE_SETUP, - 0, {1, 47}, - 330, 414, - {1, TX_SETTINGS}, + 0,{ 1, IC_BT_SETUP }, + 0x14a, 0x19e, + { 1, TX_BUTTON_SETUP } }, { WM_PHASE_INIT, - 0, {1, 40}, - 540, 414, - {1, TX_BUTTON_TERM}, - }, - { - 0 - }, - }, + 0,{ 1, IC_BT_STOP }, + 0x21c, 0x19e, + { 1, TX_BUTTON_TERM } + } + } }, - { - WM_PHASE_NAMEg, + WM_PHASE_NAMEGAMER, "name.blp", FALSE, + FALSE, { { - WM_PHASE_CONFIRM, - 0, {1,18}, - 222, 326, - {1, TX_CONFIRM}, + WM_PHASE_1562, + 0,{ 1, IC_BT_ACCEPT }, + 0xde, 0x146, + { 1, 0xae } }, { WM_PHASE_GAMER, - 0, {1,36}, - 378, 326, - {1, TX_CANCEL}, - }, - { - 0 - }, - }, + 0,{ 1, IC_BT_DELETE }, + 0x17a, 0x146, + { 1, 0xaf } + } + } }, - { - WM_PHASE_CLEARg, + WM_PHASE_CLEARGAMER, "clear.blp", FALSE, + FALSE, { { - WM_PHASE_YES, - 0, {1,18}, - 222, 326, - {1,TX_YES}, + WM_PHASE_1563, + 0,{ 1, IC_BT_ACCEPT }, + 0xde, 0x146, + { 1, 0xb0 } }, { WM_PHASE_GAMER, - 0, {1,36}, - 378, 326, - {1,TX_NO}, - }, - { - 0 - }, - }, + 0,{ 1, IC_BT_DELETE }, + 0x17a, 0x146, + { 1, 0xb1 } + } + } }, - + WM_PHASE_SERVICE, + "service.blp", + FALSE, + FALSE, { - WM_PHASE_SERVICE, - "service.blp", - FALSE, { - { - WM_BUTTON1, - 0, {1,51}, - 140, 110, - 0, - }, - { - WM_BUTTON2, - 0, {1,51}, - 140, 150, - 0, - }, - { - WM_BUTTON3, - 0, {1,51}, - 140, 190, - 0, - }, - { - WM_BUTTON4, - 0, {1,51}, - 140, 230, - 0, - }, - { - WM_BUTTON5, - 0, {1,51}, - 140, 270, - 0, - }, - { - WM_BUTTON6, - 0, {1, 51}, - 140, 310, - 0, - }, - { - WM_BUTTON10, - 0, {1, 72}, - 466, 110, - {1, TX_SHOWCONNECTION}, - }, - { - WM_BUTTON11, - 0, {1, 73}, - 466, 310, - {1, TX_SHOWNEXT}, - }, - { - WM_PHASE_DPLAY_DO_SERVICE, - 0, {1, 18}, - 222, 389, - {1, TX_CONFIRM}, - }, - { - WM_PHASE_DPLAY_CANCEL_SERVICE, - 0, {1, 36}, - 380, 389, - {1, TX_CANCEL}, - }, - { - 0 - }, + WM_BUTTON1, + 0,{ 1, IC_BT_ARROWRIGHT }, + 0x8c, 0x6e, + { 0 } }, - }, - - { - WM_PHASE_SESSION, - "session.blp", - FALSE, { - { - WM_BUTTON1, - 0, {1,51}, - 120, 100, - 0, - }, - { - WM_BUTTON2, - 0, {1,51}, - 120, 150, - 0, - }, - { - WM_BUTTON3, - 0, {1,51}, - 120, 190, - 0, - }, - { - WM_BUTTON4, - 0, {1,51}, - 120, 230, - 0, - }, - { - WM_BUTTON5, - 0, {1,51}, - 120, 270, - 0, - }, - { - WM_BUTTON6, - 0, {1,51}, - 120, 310, - 0, - }, - { - WM_BUTTON7, - 0, {1,72}, - 490, 330, - {1,TX_SHOWPREV}, - }, - { - WM_BUTTON8, - 0, {1,73}, - 490, 310, - {1,TX_SHOWNEXT}, - }, - { - WM_PHASE_JOINGAME, - 0, {1,45}, - 120, 389, - {1,TX_GAMEJOIN}, - }, - { - WM_PHASE_DPLAY_CREATE_LOBBY, - 0, {1, 43}, - 162, 389, - {1, TX_CREATE_MULTIGAME}, - }, - { - WM_PHASE_DPLAY_REFRESH, - 0, {1, 72}, - 260, 389, - {1, TX_UPDATELIST}, - }, - { - WM_PHASE_DPLAY_CANCEL_SESSION, - 0, {1, 36}, - 485, 389, - {1, TX_CANCEL}, - }, - { - 0 - }, + WM_BUTTON2, + 0,{ 1, IC_BT_ARROWRIGHT }, + 0x8c, 0x96, + { 0 } }, - }, - - { - WM_PHASE_SETUPp, - "image16\\setup.blp", - FALSE, { - { - WM_BUTTON1, - 0, {1,50}, - 54, 330, - {1,TX_BUTTON_SETUP1}, - }, - { - WM_BUTTON2, - 0, {1,51}, - 54+40, 330, - {1,TX_BUTTON_SETUP2}, - }, - { - WM_BUTTON3, - 0, {1,50}, - 284, 330, - {1,TX_BUTTON_SETUP3}, - }, - { - WM_BUTTON4, - 0, {1,51}, - 284+40, 330, - {1,TX_BUTTON_SETUP4}, - }, - { - WM_BUTTON5, - 0, {1,50}, - 399, 330, - {1,TX_BUTTON_SETUP5}, - }, - { - WM_BUTTON6, - 0, {1,51}, - 399+40, 330, - {1,TX_BUTTON_SETUP6}, - }, -#if !_EGAMES - { - WM_BUTTON7, - 0, {1,50}, - 514, 330, - {1,TX_BUTTON_SETUP7}, - }, - { - WM_BUTTON8, - 0, {1,51}, - 514+40, 330, - {1,TX_BUTTON_SETUP8}, - }, -#endif - { - WM_PHASE_PLAY, - 0, {1,77}, - 11, 424, - {1,TX_BUTTON_CONTP}, - }, - { - 0 - }, + WM_BUTTON3, + 0,{ 1, IC_BT_ARROWRIGHT }, + 0x8c, 0xbe, + { 0 } }, - }, - - { - WM_PHASE_READ, - "image16\\read.blp", - FALSE, { - { - WM_READ0, - 0, {0}, - 420, 30+42*0, - 0, - }, - { - WM_READ1, - 0, {0}, - 420, 30+42*1, - 0, - }, - { - WM_READ2, - 0, {0}, - 420, 30+42*2, - 0, - }, - { - WM_READ3, - 0, {0}, - 420, 30+42*3, - 0, - }, - { - WM_READ4, - 0, {0}, - 420, 30+42*4, - 0, - }, - { - WM_READ5, - 0, {0}, - 420, 30+42*5, - 0, - }, - { - WM_READ6, - 0, {0}, - 420, 30+42*6, - 0, - }, - { - WM_READ7, - 0, {0}, - 420, 30+42*7, - 0, - }, - { - WM_READ8, - 0, {0}, - 420, 30+42*8, - 0, - }, - { - WM_READ9, - 0, {0}, - 420, 30+42*9, - 0, - }, - { - WM_PHASE_STOP, - 0, {1,40}, - 16, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, + WM_BUTTON4, + 0,{ 1, IC_BT_ARROWRIGHT }, + 0x8c, 0xe6, + { 0 } }, - }, - - { - WM_PHASE_WRITE, - "image16\\write.blp", - FALSE, { - { - WM_WRITE0, - 0, {0}, - 420, 30+42*0, - 0, - }, - { - WM_WRITE1, - 0, {0}, - 420, 30+42*1, - 0, - }, - { - WM_WRITE2, - 0, {0}, - 420, 30+42*2, - 0, - }, - { - WM_WRITE3, - 0, {0}, - 420, 30+42*3, - 0, - }, - { - WM_WRITE4, - 0, {0}, - 420, 30+42*4, - 0, - }, - { - WM_WRITE5, - 0, {0}, - 420, 30+42*5, - 0, - }, - { - WM_WRITE6, - 0, {0}, - 420, 30+42*6, - 0, - }, - { - WM_WRITE7, - 0, {0}, - 420, 30+42*7, - 0, - }, - { - WM_WRITE8, - 0, {0}, - 420, 30+42*8, - 0, - }, - { - WM_WRITE9, - 0, {0}, - 420, 30+42*9, - 0, - }, - { - WM_PHASE_STOP, - 0, {1,40}, - 16, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, + WM_BUTTON5, + 0,{ 1, IC_BT_ARROWRIGHT }, + 0x8c, 0x10e, + { 0 } }, - }, - - { - WM_PHASE_WRITEp, - "image16\\write.blp", - FALSE, { - { - WM_WRITE0, - 0, {0}, - 420, 30+42*0, - 0, - }, - { - WM_WRITE1, - 0, {0}, - 420, 30+42*1, - 0, - }, - { - WM_WRITE2, - 0, {0}, - 420, 30+42*2, - 0, - }, - { - WM_WRITE3, - 0, {0}, - 420, 30+42*3, - 0, - }, - { - WM_WRITE4, - 0, {0}, - 420, 30+42*4, - 0, - }, - { - WM_WRITE5, - 0, {0}, - 420, 30+42*5, - 0, - }, - { - WM_WRITE6, - 0, {0}, - 420, 30+42*6, - 0, - }, - { - WM_WRITE7, - 0, {0}, - 420, 30+42*7, - 0, - }, - { - WM_WRITE8, - 0, {0}, - 420, 30+42*8, - 0, - }, - { - WM_WRITE9, - 0, {0}, - 420, 30+42*9, - 0, - }, - { - WM_PHASE_PLAY, - 0, {1,77}, - 16, 424, - {1,TX_BUTTON_CONTP}, - }, - { - 0 - }, + WM_BUTTON6, + 0,{ 1, IC_BT_ARROWRIGHT }, + 0x8c, 0x136, + { 0 } }, - }, - - { - WM_PHASE_LOST, - "image16\\lost.blp", - TRUE, { - { - WM_PHASE_INFO, - 0, {1,50}, - 9, 431, - {1,TX_BUTTON_REPEAT}, - }, - { - 0 - }, + WM_BUTTON10, + 0,{ 1, IC_BT_ARROWUP }, + 0x1d2, 0x6e, + { 1, 0xf2 } }, - }, - - { - WM_PHASE_WIN, - "image16\\win.blp", - TRUE, { - { - WM_NEXT, - 0, {1,51}, - 9, 431, - {1,TX_BUTTON_NEXTP}, - }, - { - 0 - }, + WM_BUTTON11, + 0,{ 1, IC_BT_ARROWDOWN }, + 0x1d2, 0x136, + { 1, 0xf1 } }, - }, - - { - WM_PHASE_LASTWIN, - "image\\last%.3d.blp", - TRUE, { - { - WM_PHASE_INIT, - 0, {1,51}, - 9, 431, - {1,TX_BUTTON_NEXTP}, - }, - { - 0 - }, + WM_PHASE_DPLAY_DO_SERVICE, + 0,{ 1, IC_BT_ACCEPT }, + 0xde, 0x185, + { 1, 0xae } }, - }, - - { - WM_PHASE_BUILD, - "image\\build.blp", - TRUE, { - { - WM_DECOR1, // pose des sols - 0, {6, 0,1,2,3,4,25}, - 11+42*2, 190+42*0, - {6,TX_OBJ_HERBE,TX_OBJ_MOUSSE,TX_OBJ_TERRE, - TX_OBJ_EAU,TX_OBJ_DALLESPEC,TX_OBJ_COUVTELE}, - }, - { - WM_DECOR2, // pose des plantes - 0, {4, 6,7,8,11}, - 11+42*2, 190+42*1, - {4,TX_OBJ_DELOBJ,TX_OBJ_PLANTE, - TX_OBJ_ARBRE,TX_OBJ_FLEUR1}, - }, - { - WM_DECOR3, // pose des batiments - 0, {11, 18,81,33,61,82,93,20,21,22,57,58}, - 11+42*2, 190+42*2, - {11,TX_OBJ_DELOBJ,TX_OBJ_BATIMENT,TX_OBJ_TOUR, - TX_OBJ_MINEFER,TX_OBJ_BATENNEMIS,TX_OBJ_BARENNEMIS, - TX_OBJ_MURPAL,TX_OBJ_ROC,TX_OBJ_OBJET, - TX_OBJ_ARME,TX_OBJ_VEHICULE}, - }, - { - WM_DECOR4, // pose des blupi - 0, {10, 12,13,14,85,15,16,17,38,75,56}, - 11+42*2, 190+42*3, - {10,TX_OBJ_DELPERSO,TX_OBJ_BLUPIf,TX_OBJ_BLUPI, - TX_OBJ_DISCIPLE,TX_OBJ_ARAIGNEE,TX_OBJ_VIRUS, - TX_OBJ_TRACKS,TX_OBJ_BOMBE,TX_OBJ_ELECTRO, - TX_OBJ_ROBOT}, - }, - { - WM_DECOR5, // pose les catastrophes - 0, {2, 36,37}, - 11+42*2, 190+42*4, - {2,TX_OBJ_DELFEU,TX_OBJ_STARTFEU}, - }, - { - WM_PHASE_REGION, - 0, {1,5}, - 11+42*0, 190+42*1, - {1,TX_BUTTON_REGION}, - }, - { - WM_PHASE_INFO, - 0, {1,40}, - 11+42*0, 424, - {1,TX_BUTTON_TERMC}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_BUTTON, - "image16\\button00.blp", - TRUE, - { - { - WM_BUTTON1, // stop - 0, {1,40}, - 170+42*0, 30+52*0, - {1,TX_ACTION_STOP}, - }, - { - WM_BUTTON0, // go - 0, {1,24}, - 170+42*1, 30+52*0, - {1,TX_ACTION_GO}, - }, - { - WM_BUTTON3, // carry - 0, {1,30}, - 170+42*3, 30+52*0, - {1,TX_ACTION_CARRY}, - }, - { - WM_BUTTON4, // depose - 0, {1,31}, - 170+42*4, 30+52*0, - {1,TX_ACTION_DEPOSE}, - }, - { - WM_BUTTON32, // r�p�te - 0, {1,100}, - 170+42*6, 30+52*0, - {1,TX_ACTION_REPEAT}, - }, - - { - WM_BUTTON5, // abat - 0, {1,22}, - 170+42*0, 30+52*1, - {1,TX_ACTION_ABAT}, - }, - { - WM_BUTTON16, // abat n - 0, {1,42}, - 170+42*1, 30+52*1, - {1,TX_ACTION_ABATn}, - }, - { - WM_BUTTON6, // roc - 0, {1,27}, - 170+42*3, 30+52*1, - {1,TX_ACTION_ROC}, - }, - { - WM_BUTTON17, // roc n - 0, {1,43}, - 170+42*4, 30+52*1, - {1,TX_ACTION_ROCn}, - }, - { - WM_BUTTON22, // fleurs - 0, {1,54}, - 170+42*6, 30+52*1, - {1,TX_ACTION_FLEUR}, - }, - { - WM_BUTTON23, // fleurs n - 0, {1,55}, - 170+42*7, 30+52*1, - {1,TX_ACTION_FLEURn}, - }, - - { - WM_BUTTON9, // build2 (couveuse) - 0, {1,25}, - 170+42*0, 30+52*2, - {1,TX_ACTION_BUILD2}, - }, - { - WM_BUTTON15, // palis - 0, {1,26}, - 170+42*1, 30+52*2, - {1,TX_ACTION_PALIS}, - }, - { - WM_BUTTON18, // pont - 0, {1,23}, - 170+42*2, 30+52*2, - {1,TX_ACTION_PONT}, - }, - { - WM_BUTTON25, // bateau - 0, {1,58}, - 170+42*3, 30+52*2, - {1,TX_ACTION_BATEAU}, - }, - { - WM_BUTTON13, // build6 (t�l�porteur) - 0, {1,101}, - 170+42*4, 30+52*2, - {1,TX_ACTION_BUILD6}, - }, - { - WM_BUTTON14, // mur - 0, {1,20}, - 170+42*6, 30+52*2, - {1,TX_ACTION_MUR}, - }, - { - WM_BUTTON19, // tour - 0, {1,33}, - 170+42*7, 30+52*2, - {1,TX_ACTION_TOUR}, - }, - - { - WM_BUTTON8, // build1 (cabane) - 0, {1,19}, - 170+42*0, 30+52*3, - {1,TX_ACTION_BUILD1}, - }, - { - WM_BUTTON7, // cultive - 0, {1,28}, - 170+42*1, 30+52*3, - {1,TX_ACTION_CULTIVE}, - }, - { - WM_BUTTON2, // mange - 0, {1,32}, - 170+42*2, 30+52*3, - {1,TX_ACTION_MANGE}, - }, - - { - WM_BUTTON10, // build3 (laboratoire) - 0, {1,35}, - 170+42*0, 30+52*4, - {1,TX_ACTION_BUILD3}, - }, - { - WM_BUTTON21, // laboratoire - 0, {1,39}, - 170+42*1, 30+52*4, - {1,TX_ACTION_LABO}, - }, - { - WM_BUTTON20, // boit - 0, {1,34}, - 170+42*2, 30+52*4, - {1,TX_ACTION_BOIT}, - }, - { - WM_BUTTON24, // dynamite - 0, {1,41}, - 170+42*3, 30+52*4, - {1,TX_ACTION_DYNAMITE}, - }, - - { - WM_BUTTON27, // drapeau - 0, {1,64}, - 170+42*0, 30+52*5, - {1,TX_ACTION_DRAPEAU}, - }, - { - WM_BUTTON11, // build4 (mine) - 0, {1,61}, - 170+42*1, 30+52*5, - {1,TX_ACTION_BUILD4}, - }, - { - WM_BUTTON28, // extrait - 0, {1,62}, - 170+42*2, 30+52*5, - {1,TX_ACTION_EXTRAIT}, - }, - { - WM_BUTTON12, // build5 (usine) - 0, {1,59}, - 170+42*4, 30+52*5, - {1,TX_ACTION_BUILD5}, - }, - { - WM_BUTTON29, // fabrique jeep - 0, {1,65}, - 170+42*5, 30+52*5, - {1,TX_ACTION_FABJEEP}, - }, - { - WM_BUTTON30, // fabrique mine - 0, {1,63}, - 170+42*6, 30+52*5, - {1,TX_ACTION_FABMINE}, - }, - { - WM_BUTTON34, // fabrique armure - 0, {1,106}, - 170+42*7, 30+52*5, - {1,TX_ACTION_FABARMURE}, - }, - { - WM_BUTTON31, // fabrique disciple - 0, {1,83}, - 170+42*8, 30+52*5, - {1,TX_ACTION_FABDISC}, - }, - -// { -// WM_BUTTON13, // build6 -// 0, {0}, -// 170+42*2, 30+52*5, -// {1,TX_ACTION_BUILD6}, -// }, - { - WM_PHASE_BUILD, - 0, {1,50}, - 11, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_TERM, - "image\\term.blp", - TRUE, - { - { - WM_PHASE_BUILD, - 0, {1,50}, - 11, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_MUSIC, - "image16\\music.blp", - TRUE, - { - - { - WM_PHASE_BUILD, - 0, {1,50}, - 11, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_REGION, - "image16\\region.blp", - TRUE, - { - - { - WM_PHASE_BUILD, - 0, {1,50}, - 11, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_PLAYMOVIE, - "image\\movie.blp", - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_WINMOVIE, - "image\\movie.blp", - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_H0MOVIE, - "image\\movie.blp", - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_H1MOVIE, - "image\\movie.blp", - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_H2MOVIE, - "image\\movie.blp", - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_BYE, - "image16\\bye.blp", - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_INSERT, - "image\\insert.blp", - FALSE, - { -//? { -//? WM_PHASE_INFO, -//? 0, {1,48}, -//? 16, 424-42, -//? {1,TX_BUTTON_PLAYP}, -//? }, - { - WM_PHASE_INIT, - 0, {1,40}, - 16, 424, - {1,TX_BUTTON_QUITTER}, - }, - { - 0 - }, - }, - }, - - { - 0 + WM_PHASE_DPLAY_CANCEL_SERVICE, + 0,{ 1, IC_BT_DELETE }, + 0x17c, 0x185, + { 1, 0xaf } + } } + // more... }; // Constructor CEvent::CEvent() { - int i; - int* menuIndex; + int i; - CMenu(m_menu); - m_somethingJoystick = 0; - m_bFullScreen = TRUE; - m_mouseType = MOUSETYPEGRA; - m_saveIndex = -1; - m_index = -1; - m_exercice = 0; - m_mission = 1; - m_private = 1; - m_maxMission = 0; - m_phase = 0; - m_bSchool = FALSE; - m_bPrivate = FALSE; - m_bAccessBuild = FALSE; - m_bRunMovie = FALSE; - m_bBuildModify = FALSE; - m_bMousePress = FALSE; - m_bMouseDown = FALSE; + m_bFullScreen = TRUE; + m_mouseType = MOUSETYPEGRA; + m_index = -1; + m_exercice = 0; + m_mission = 1; + m_private = 1; + m_maxMission = 0; + m_phase = 0; + m_bSchool = FALSE; + m_bPrivate = FALSE; + m_bBuildOfficialMissions = FALSE; + m_bRunMovie = FALSE; + m_bBuildModify = FALSE; + m_bMousePress = FALSE; + m_bMouseDown = FALSE; m_oldMousePos.x = 0; m_oldMousePos.y = 0; - m_mouseSprite = 0; - m_bFillMouse = FALSE; - m_bWaitMouse = FALSE; - m_bHideMouse = FALSE; - m_bShowMouse = FALSE; - m_tryPhase = 0; - m_rankCheat = -1; - m_posCheat = 0; - m_speed = 1; - m_bMovie = TRUE; - m_bAllMissions = FALSE; + m_mouseSprite = 0; + m_bFillMouse = FALSE; + m_bWaitMouse = FALSE; + m_bHideMouse = FALSE; + m_bShowMouse = FALSE; + m_tryPhase = 0; + m_rankCheat = -1; + m_posCheat = 0; + m_speed = 1; + m_bMovie = TRUE; + m_bAllMissions = FALSE; m_bHiliInfoButton = TRUE; - m_bSpeed = FALSE; - m_bHelp = FALSE; - m_bChangeCheat = FALSE; - m_scrollSpeed = 1; - m_bPause = FALSE; - m_bShift = FALSE; - m_shiftPhase = 0; + m_bSpeed = FALSE; + m_bHelp = FALSE; + m_bChangeCheat = FALSE; + m_scrollSpeed = 1; + m_bPause = FALSE; + m_bShift = FALSE; + m_shiftPhase = 0; m_movieToStart[0] = 0; - m_bInfoHelp = FALSE; - m_bDemoRec = FALSE; - m_bDemoPlay = FALSE; - m_pDemoBuffer = NULL; - m_demoTime = 0; - m_bCtrlDown = FALSE; - m_input = 0; + m_bInfoHelp = FALSE; + m_bDemoRec = FALSE; + m_bDemoPlay = FALSE; + m_pDemoBuffer = NULL; + m_demoTime = 0; + m_bCtrlDown = FALSE; + m_input = 0; - for (i = 0; i < MAXINDEX; i++) + for (i != 0; i = 20; i++) { m_menuIndex = 0; + m_menuIndex++; } m_menuDecor[10] = 1; @@ -1312,7 +442,7 @@ CEvent::~CEvent() } void CEvent::Create(HINSTANCE hInstance, HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, - CSound *pSound, CMovie *pMovie, CNetwork *pNetwork) + CSound *pSound, CNetwork *pNetwork, CMovie *pMovie ) { POINT pos; @@ -1407,7 +537,7 @@ BOOL CEvent::GetEnable(int button) return FALSE; } -void CEvent::SetEnable(WMessage button, int bEnable) +void CEvent::SetEnable(int button, int bEnable) { int index; @@ -1518,7 +648,7 @@ BOOL CEvent::CreateButtons() bMinimizeRedraw, m_pDecor->GetRegion(), message); iconMenu = table[m_index].buttons[i].iconMenu + (m_phase * sizeof(Phase)); - if (((m_bAccessBuild == FALSE) && (m_phase == WM_PHASE_BUILD)) && (message == 1054)) + if (((m_bBuildOfficialMissions == FALSE) && (m_phase == WM_PHASE_BUILD)) && (message == 1054)) { iconMenu++; } @@ -1556,7 +686,7 @@ void CEvent::ReadInput() } else { - m_pDecor->GetBlupiInfo(bHelicopter, bCar, bSkateboard, bWater); + m_pDecor->GetBlupiInfo(&bHelicopter, &bCar, &bSkateboard, &bWater); something = TRUE; if (((bHelicopter != FALSE) || (bCar != FALSE)) || (bSkateboard != FALSE)) @@ -1594,17 +724,17 @@ void CEvent::ReadInput() } if (((BYTE)joy.dwButtons & JOY_BUTTON1) != 0) { - m_input = m_input & ~(INPUT_DOWN | INPUT_UP) | KEY_JUMP; + m_input = m_input & ~(KEY_DOWN | KEY_UP) | KEY_JUMP; } if (((BYTE)joy.dwButtons & JOY_BUTTON2) != 0) { if (bSkateboard == FALSE) { - keyInput = m_input & ~INPUT_DOWN | KEY_UP | KEY_JUMP; + keyInput = m_input & ~KEY_DOWN | KEY_UP | KEY_JUMP; } else { - keyInput = m_input & ~(INPUT_DOWN | INPUT_UP) | KEY_JUMP; + keyInput = m_input & ~(KEY_DOWN | KEY_UP) | KEY_JUMP; } m_input = keyInput; } @@ -1618,7 +748,7 @@ void CEvent::ReadInput() } else { - keyInput = m_input & ~(INPUT_DOWN | INPUT_UP) | KEY_JUMP; + keyInput = m_input & ~(KEY_DOWN | KEY_UP) | KEY_JUMP; } } else @@ -1626,11 +756,11 @@ void CEvent::ReadInput() keyInput = m_input | KEY_DOWN; } m_input = keyInput; - m_input = keyInput & ~INPUT_UP; + m_input = keyInput & ~KEY_UP; } if (((BYTE)joy.dwButtons & JOY_BUTTON4) != 0) { - m_input = m_input & ~(INPUT_DOWN | INPUT_UP) | KEY_FIRE; + m_input = m_input & ~(KEY_DOWN | KEY_UP) | KEY_FIRE; } m_pDecor->SetInput(m_input); m_pDecor->SetJoystickEnable(TRUE); @@ -1741,7 +871,7 @@ void CEvent::NetStartPlay() OutputNetDebug(str); } -void CEvent::NetSend(NetMessageType message, USHORT data) +void CEvent::NetSend(int message, USHORT data) { UCHAR packet[4]; @@ -1796,7 +926,7 @@ void CEvent::ChatSend() pos[133].x = 0; m_textHiliEnd = i - 1; m_textCursorIndex = 0; - SetEnable((WMessage)WM_BUTTON20, 0); + SetEnable(WM_BUTTON20, 0); } return; } @@ -1922,7 +1052,7 @@ BOOL CEvent::DrawButtons() m_bChangeCheat = FALSE; text[0] = 0; - if (m_bAccessBuild != 0) + if (m_bBuildOfficialMissions != 0) { AddCheatCode(text, cheat_code[0]); } @@ -1930,11 +1060,11 @@ BOOL CEvent::DrawButtons() { AddCheatCode(text, cheat_code[1]); } - if ( m_pDecor->GetInvincible() ) + if ( m_pDecor->GetSuperBlupi() ) { AddCheatCode(text, cheat_code[3]); } - if ( m_pDecor->GetShowSecret() ) + if ( m_pDecor->GetDrawSecret() ) { AddCheatCode(text, cheat_code[11]); } @@ -1965,7 +1095,7 @@ BOOL CEvent::DrawButtons() if (m_phase == WM_PHASE_INIT) { - DrawTextB(m_pPixmap, pos, (char*)"Version 2.0", FONTLITTLE); + DrawText(m_pPixmap, pos, "Version 2.2", FONTLITTLE); } if (m_phase == WM_PHASE_GAMER) @@ -1982,12 +1112,12 @@ BOOL CEvent::DrawButtons() { pos.y = 69; pos.x = 110; - DrawTextB(m_pPixmap, pos, pText, 0); + DrawText(m_pPixmap, pos, pText, 0); nice = 69 + 40; *(char*)pText += 100; lg++; } while (lg != 0); - SetEnable((WMessage)WM_PHASE_CLEARg, (int)(m_filenameBuffer + -1) + m_gamer * 4 + 212); + SetEnable(WM_PHASE_CLEARGAMER, (int)(m_filenameBuffer + -1) + m_gamer * 4 + 212); } if (m_phase == WM_PHASE_PLAY && m_phase == WM_PHASE_PLAYTEST && m_phase == WM_PHASE_BUILD) @@ -2065,17 +1195,17 @@ BOOL CEvent::DrawButtons() pos.y = 26; DrawTextLeft(m_pPixmap, pos, res, FONTRED); } - if (m_phase == WM_PHASE_LOST || m_phase == WM_PHASE_LOSTd || m_phase == WM_PHASE_WINm) + if (m_phase == WM_PHASE_LOST || m_phase == WM_PHASE_LOSTDESIGN || m_phase == WM_PHASE_WINMULTI) { LoadString(TX_LOST1 + GetWorld() % 5, res, 50); DrawTextLeft(m_pPixmap, pos, res, FONTWHITE); } - if (m_phase == WM_PHASE_WIN || m_phase == WM_PHASE_WINd || m_phase == WM_PHASE_LOSTm) + if (m_phase == WM_PHASE_WIN || m_phase == WM_PHASE_WINDESIGN || m_phase == WM_PHASE_LOSTMULTI) { LoadString(TX_WIN1 + GetWorld() % 5, res, 50); DrawTextLeft(m_pPixmap, pos, res, FONTWHITE); } - if (m_phase == WM_PHASE_READd) + if (m_phase == WM_PHASE_READDESIGN) { } @@ -2121,7 +1251,7 @@ BOOL CEvent::DrawButtons() { DrawTextLeft(m_pPixmap, m_posToolTips, m_textToolTips, FONTWHITE); } - if (m_phase == WM_PHASE_CLEARg) + if (m_phase == WM_PHASE_CLEARGAMER) { LoadString(TX_CHOOSEGAMER, res, 100); lg = GetTextWidth((char*)res, 0); @@ -2135,7 +1265,7 @@ BOOL CEvent::DrawButtons() lg = GetTextWidth(text, 0); DrawTextLeft(m_pPixmap, pos, res, 0); } - if (m_phase == WM_PHASE_CLEARd) + if (m_phase == WM_PHASE_CLEARDESIGN) { LoadString(TX_DESIGNMISSION, res, 100); lg = GetTextWidth(res, 0); @@ -2337,13 +1467,13 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam) { pos.x = 320; pos.y = LYIMAGE / 2; - m_pSound->PlayImage(SOUND_3_JUMPEND, pos, -1); + m_pSound->PlayImage(SOUND_JUMPEND, pos, -1); } else { pos.x = 320; pos.y = LYIMAGE / 2; - m_pSound->PlayImage(SOUND_41_RESSORT, pos, -1); + m_pSound->PlayImage(SOUND_RESSORT, pos, -1); } m_rankCheat = -1; m_posCheat = 1; @@ -2377,16 +1507,16 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam) { if (m_phase != WM_PHASE_SETUP) { - if (m_phase != WM_PHASE_NAMEg) + if (m_phase != WM_PHASE_NAMEGAMER) { - if (m_phase == WM_PHASE_NAMEd) + if (m_phase == WM_PHASE_NAMEDESIGN) { - m_pDecor->SetGamerName(m_textInput); + m_pDecor->SetMissionTitle(m_textInput); ChangePhase(WM_PHASE_INFO); return TRUE; } - if ((m_phase == WM_PHASE_INIT) || (m_phase == WM_PHASE_WINm)) ChangePhase(WM_PHASE_GAMER); return TRUE; - if ((m_phase == WM_PHASE_BUILD) || ((m_phase == WM_PHASE_LOSTd || m_phase == WM_PHASE_LOST))) ChangePhase(WM_PHASE_INFO); return TRUE; + if ((m_phase == WM_PHASE_INIT) || (m_phase == WM_PHASE_WINMULTI)) ChangePhase(WM_PHASE_GAMER); return TRUE; + if ((m_phase == WM_PHASE_BUILD) || ((m_phase == WM_PHASE_LOSTDESIGN || m_phase == WM_PHASE_LOST))) ChangePhase(WM_PHASE_INFO); return TRUE; if (((m_phase != WM_PHASE_INFO) && (m_phase != WM_PHASE_STOP)) && (m_phase != WM_PHASE_HELP)) { if (m_phase == WM_PHASE_SERVICE) @@ -2702,11 +1832,6 @@ void CEvent::SetMission(int index) return; } -UINT CDecor::GetPhase() -{ - return m_phase; -} - void CEvent::TryInsert() { if ( m_tryInsertCount == 0 ) @@ -2791,23 +1916,22 @@ BOOL CEvent::ChangePhase(UINT phase) char filename[MAX_PATH]; char* pButtonExist; BOOL bEnable, bHide; - Term* pTerm; char* playerName; sprintf(filename, "CEvent::ChangePhase [Begin] --- % ", phase); OutputNetDebug(filename); - if (phase == WM_PHASE_634) + if (phase == WM_PHASE_1588) { PostMessageA(m_hWnd, 16, 0, 0); return TRUE; } - m_pDecor->SetSpeedY(m_bDemoPlay); + //m_pDecor->SetSpeedY(m_bDemoPlay); if (m_mouseType == MOUSETYPEGRA && m_bFullScreen != 0) { ShowCursor(FALSE); m_bShowMouse = FALSE; } - if (phase == WM_PHASE_608) + if (phase == WM_PHASE_1544) { //m_pDecor->CurrentRead(999, 1, m_gamer); phase = WM_PHASE_BUILD; @@ -2866,7 +1990,7 @@ BOOL CEvent::ChangePhase(UINT phase) mission = (mission / 10) * 10; } SetMission(m_mission); - m_phase = (WMessage)WM_PHASE_PLAY; + m_phase = WM_PHASE_PLAY; return ChangePhase(WM_PHASE_PLAY); } @@ -2896,11 +2020,6 @@ BOOL CEvent::ChangePhase(UINT phase) } -UINT CEvent::GetPhase() -{ - return m_phase; -} - // Implement LoadLevel void CEvent::MovieToStart() @@ -2922,36 +2041,6 @@ void CEvent::MovieToStart() } } -BOOL CEvent::BuildDown(POINT pos, int fwKeys, BOOL bMix) -{ - POINT cel; - int menu, channel, icon; - - if (pos.x < POSDRAWX || pos.x > POSDRAWX + DIMDRAWX || - pos.y < POSDRAWY || pos.y > POSDRAWY + DIMDRAWY) return FALSE; - - if (GetState(WM_DECOR1) == 1) - { - //cel = m_pDecor->ConvPosToCel2(pos); - //m_pDecor->BlupiDelete(pos); - } - if (GetState(WM_DECOR2) == 2) - { - //cel = m_pDecor->ConvPosToCel2(pos); - menu = GetMenu(WM_DECOR2); - } -} - -BOOL CEvent::BuildMove(POINT pos, int fwKeys) -{ - if (fwKeys & MK_LBUTTON) - { - BuildDown(pos, fwKeys, FALSE); - } - //m_pDecor->ConvPosToCel2(pos); - return TRUE; -} - void CEvent::MouseRelease() { m_bMouseRelease = TRUE; @@ -3351,9 +2440,9 @@ BOOL CEvent::WriteInfo(int gamer, char* playername) info.speed = m_speed; info.bMovie = m_bMovie; info.bHiliInfoButton = m_bHiliInfoButton; - info.bAccessBuild = m_bAccessBuild; + info.bAccessBuild = m_bBuildOfficialMissions; - m_pDecor->InitalizeDoors(door); + m_pDecor->InitializeDoors(door); info.audioVolume = m_pSound->GetAudioVolume(); info.midiVolume = m_pSound->GetMidiVolume(); @@ -3412,9 +2501,9 @@ BOOL CEvent::ReadInfo(int gamer) info.speed = m_speed; info.bMovie = m_bMovie; info.bHiliInfoButton = m_bHiliInfoButton; - info.bAccessBuild = m_bAccessBuild; + info.bAccessBuild = m_bBuildOfficialMissions; - m_pDecor->SetAccessBuild(info.skill); + m_pDecor->SetBuildOfficialMissions(info.skill); m_pSound->SetAudioVolume(info.audioVolume); m_pSound->SetMidiVolume(info.midiVolume); diff --git a/src/event.h b/src/event.h index d6cb8ca..385c2ae 100644 --- a/src/event.h +++ b/src/event.h @@ -6,8 +6,6 @@ #pragma once -using namespace std; - #include "movie.h" #include "menu.h" #include "button.h" @@ -28,21 +26,11 @@ typedef struct UINT phase; char backName[36]; BOOL bCDrom; + BOOL bUnk; Button buttons[MAXBUTTON]; } Phase; -typedef struct -{ - int HeaderLength[10]; - int DoorsLength[200]; - int GamerLength[10 + 200]; - int MaxGamer[3]; - int TotalLength[10 + (10 + 200) + 3]; - BYTE data; -} -GameData; - typedef struct { short majRev; @@ -65,40 +53,6 @@ typedef struct } DemoEvent; -typedef enum -{ - cheat_cleanall = 2, - cheat_funskate = 6, - cheat_givecopter = 7, - cheat_jeepdrive = 8, - cheat_alltreasure = 9, - cheat_endgoal = 10, - cheat_roundshield = 12, - cheat_quicklollipop = 13, - cheat_tenbombs = 14, - cheat_birdlime = 15, - cheat_drivetank = 16, - cheat_powercharge = 17, - cheat_hidedrink = 18, - cheat_iovercraft = 22, - cheat_udynamite = 23, - cheat_wellkeys = 24 -} -cheat; - -typedef enum -{ - KEY_NONE, - KEY_LEFT, - KEY_RIGHT, - KEY_UP, - KEY_DOWN, - KEY_JUMP, - INPUT_DOWN, - INPUT_UP, - KEY_FIRE -}; - class CEvent { public: @@ -108,7 +62,7 @@ public: void OutputNetDebug(const char* str); POINT GetMousePos(); - void Create(HINSTANCE hInstance, HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, CSound *pSound, CMovie *pMovie, CNetwork *pNetwork); + void Create(HINSTANCE hInstance, HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, CSound *pSound, CNetwork *pNetwork, CMovie *pMovie ); void SetFullScreen(BOOL bFullScreen); void SetMouseType(int mouseType); int GetWorld(); @@ -133,13 +87,14 @@ public: int GetState(int button); void SetState(int button, int state); BOOL GetEnable(int button); - void SetEnable(WMessage button, int bEnable); + void SetEnable(int button, int bEnable); void SetSomething(int button, int bSomething); BOOL GetHide(int button); void SetHide(int button, BOOL bHide); int GetMenu(int button); void SetMenu(int button, int menu); void SomethingDecor(); + BOOL IsMouseRelease(); void NetSetPause(BOOL bPause, int players); void NetSendLobby(); @@ -230,7 +185,7 @@ protected: BOOL NetEnumSessions(); int NetSearchPlayer(DPID dpid); void NetStartPlay(); - void NetSend(NetMessageType message, USHORT data); + void NetSend(int message, USHORT data); void NetDraw(); void ChatSend(); void HandleChatBuffer(); @@ -260,7 +215,7 @@ protected: BOOL m_bSchool; BOOL m_bPrivate; BOOL m_bMulti; - BOOL m_bAccessBuild; + BOOL m_bBuildOfficialMissions; BOOL m_bFullScreen; int m_mouseType; HWND m_hWnd; @@ -270,7 +225,7 @@ protected: CMovie* m_pMovie; CNetwork* m_pNetwork; char m_movieToStart[MAX_PATH]; - WMessage m_phaseAfterMovie; + int m_phaseAfterMovie; CButton m_buttons[MAXBUTTON]; int m_lastFloor[MAXBUTTON]; int m_lastObject[MAXBUTTON]; diff --git a/src/fifo.h b/src/fifo.h deleted file mode 100644 index b89b924..0000000 --- a/src/fifo.h +++ /dev/null @@ -1,33 +0,0 @@ - -#pragma once - - - - - - -typedef struct -{ - long pos; - long dist; -} -Element; - - - - -class CPileTriee -{ -private: - long m_taille; - long m_max; - long m_out; - Element* m_data; - -public: - CPileTriee(long taille); - ~CPileTriee(); - - void put(long pos, long dist); - long get(); -}; \ No newline at end of file diff --git a/src/jauge.cpp b/src/jauge.cpp index a06509f..9b0c305 100644 --- a/src/jauge.cpp +++ b/src/jauge.cpp @@ -8,7 +8,7 @@ using namespace std; #include #include #include -#include +// #include #include #include "def.h" #include "pixmap.h" @@ -75,7 +75,7 @@ void CJauge::Draw() } int num = m_level * 114 / 100; - *(char*)num2 = (124) << 64; + *(char*)num2 = (124) / 64; rect.bottom = 22; rect.left = LOWORD(num2); rect.top = HIWORD(num2); diff --git a/src/jauge.h b/src/jauge.h index b8cbb18..38fe673 100644 --- a/src/jauge.h +++ b/src/jauge.h @@ -1,19 +1,11 @@ // Jauge.h - -using namespace std; +#pragma once ////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include - -#include "decor.h" - -#pragma once -#define WIN32_LEAN_AND_MEAN +// #include +#include "pixmap.h" +#include "sound.h" class CJauge { diff --git a/src/menu.h b/src/menu.h index 10612db..fc9c7d7 100644 --- a/src/menu.h +++ b/src/menu.h @@ -2,10 +2,7 @@ #pragma once -using namespace std; - -#include -#include +// #include #include "decor.h" #include "pixmap.h" diff --git a/src/misc.h b/src/misc.h index 319f0f8..ab0977e 100644 --- a/src/misc.h +++ b/src/misc.h @@ -1,9 +1,8 @@ // misc.h // #pragma once -#include -#include -using namespace std; + +// #include extern void InitHInstance(HINSTANCE hInstance); extern void OutputDebug(const char *pMessage); @@ -14,9 +13,9 @@ extern POINT ConvLongToPos(LPARAM lParam); extern void InitRandom(); extern int Random(int min, int max); +extern BOOL IntersectRect(RECT dst, RECT src1, RECT src2); extern BOOL IsRectEmpty(RECT rect); -extern int Speed(double speed, int max); extern void GetCurrentDir(char *pName, int lg); extern void AddCDPath(char *pFilename); extern void AddUserPath(char *pFilename); diff --git a/src/movie.cpp b/src/movie.cpp index b1a4120..bf46536 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -14,7 +14,7 @@ using namespace std; #include #include #include -#include +// #include #include "def.h" #include "movie.h" #include "misc.h" @@ -39,7 +39,7 @@ BOOL CMovie::initAVI() // set up the open parameters mciOpen.dwCallback = 0L; mciOpen.wDeviceID = 0; - mciOpen.lpstrDeviceType = (LPWSTR)AVI_VIDEO; + mciOpen.lpstrDeviceType = AVI_VIDEO; mciOpen.lpstrElementName = NULL; mciOpen.lpstrAlias = NULL; mciOpen.dwStyle = 0; @@ -126,7 +126,7 @@ BOOL CMovie::fileOpenMovie(HWND hWnd, RECT rect, char *pFilename) mciOpen.dwCallback = 0L; mciOpen.wDeviceID = 0; mciOpen.lpstrDeviceType = NULL; - mciOpen.lpstrElementName = (LPWSTR)string; + mciOpen.lpstrElementName = string; mciOpen.lpstrAlias = NULL; mciOpen.dwStyle = WS_CHILD; mciOpen.hWndParent = hWnd; @@ -144,7 +144,7 @@ BOOL CMovie::fileOpenMovie(HWND hWnd, RECT rect, char *pFilename) mciWindow.dwCallback = 0L; mciWindow.hWnd = NULL; mciWindow.nCmdShow = SW_SHOW; - mciWindow.lpstrText = (LPWSTR)NULL; + mciWindow.lpstrText = NULL; // mciSendCommand(m_wMCIDeviceID, MCI_WINDOW, // MCI_DGV_WINDOW_STATE, // (DWORD)(LPMCI_DGV_WINDOW_PARMS)&mciWindow); diff --git a/src/movie.h b/src/movie.h index ab3b0ec..3dbbf4f 100644 --- a/src/movie.h +++ b/src/movie.h @@ -1,11 +1,9 @@ // movie.h // - #pragma once -using namespace std; -#include +// #include class CMovie { diff --git a/src/network.cpp b/src/network.cpp index 34338cf..f2e7dd2 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -57,7 +57,7 @@ BOOL CNetwork::EnumProviders() if (!m_providers.list) return FALSE; - if (DirectPlayEnumerate((LPDPENUMDPCALLBACK)EnumProvidersCallback, &m_providers) != DP_OK) + if (DirectPlayEnumerate((LPDPENUMDPCALLBACKA)EnumProvidersCallback, &m_providers) != DP_OK) { FreeProviderList(); return FALSE; diff --git a/src/network.h b/src/network.h index c17889e..3dadfb3 100644 --- a/src/network.h +++ b/src/network.h @@ -9,8 +9,6 @@ #define MAXSESSION 100 #define MAXPLAYERS 4 #define _CRT_SECURE_NO_WARNINGS_GLOBALS -#define WIN32_LEAN_AND_MEAN - typedef struct { @@ -38,26 +36,6 @@ typedef struct } NamedGUIDList; -typedef struct -{ - BYTE messageType; - BYTE data1; - short x; - short y; - short channel; -} -NetMessage; - -typedef enum -{ - MESS_RESUME, - MESS_PAUSE, - MESS_START, - MESS_LEAVE, - MESS_LOST, -} -NetMessageType; - class CNetwork { public: diff --git a/src/obstacle.h b/src/obstacle.h new file mode 100644 index 0000000..87ac4ac --- /dev/null +++ b/src/obstacle.h @@ -0,0 +1,589 @@ +#pragma once +#define Q_EMPTY \ + 0,0,0,0, \ + 0,0,0,0, \ + 0,0,0,0, \ + 0,0,0,0 +#define Q_FULL \ + 1,1,1,1, \ + 1,1,1,1, \ + 1,1,1,1, \ + 1,1,1,1 +#define Q_TRIANGLE_RIGHT \ + 1,1,1,1, \ + 0,1,1,1, \ + 0,0,0,1, \ + 0,0,0,0 +#define Q_TRIANGLE_LEFT \ + 1,1,1,1, \ + 1,1,1,0, \ + 1,0,0,0, \ + 0,0,0,0 +#define Q_TOP_HALF \ + 1,1,1,1, \ + 1,1,1,1, \ + 0,0,0,0, \ + 0,0,0,0 +#define Q_TOP_QUARTER \ + 1,1,1,1, \ + 0,0,0,0, \ + 0,0,0,0, \ + 0,0,0,0 +#define Q_TOP_3_QUARTERS \ + 1,1,1,1, \ + 1,1,1,1, \ + 1,1,1,1, \ + 0,0,0,0 +#define Q_PILLAR \ + 0,1,1,0, \ + 0,1,1,0, \ + 0,1,1,0, \ + 0,1,1,0 + +extern short table_decor_quart[] +{ + Q_FULL, // 0 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TRIANGLE_RIGHT, + + Q_TRIANGLE_RIGHT, // 16 + Q_TRIANGLE_LEFT, + Q_TRIANGLE_LEFT, + + 1,1,1,1, + 1,1,1,1, + 0,0,1,1, + 0,0,0,0, + + 1,1,1,1, + 1,1,1,1, + 1,1,0,0, + 1,1,0,0, + + 1,1,1,1, + 1,1,1,1, + 1,1,0,0, + 0,0,0,0, + + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TOP_HALF, + Q_TOP_QUARTER, + Q_FULL, + Q_FULL, + + Q_FULL, // 32 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TOP_3_QUARTERS, + Q_TOP_HALF, + Q_TOP_QUARTER, + + Q_FULL, // 48 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 64 + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_TRIANGLE_LEFT, + Q_TRIANGLE_RIGHT, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + + Q_FULL, // 80 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + + 1,1,1,1, + 1,1,1,1, + 1,1,1,1, + 1,1,0,0, + + 1,1,1,1, + 1,1,1,1, + 1,1,0,0, + 1,1,0,0, + + 1,1,1,1, + 1,1,1,1, + 1,1,1,1, + 0,1,1,1, + + 1,1,1,1, + 1,1,1,1, + 0,0,1,1, + 0,0,1,1, + + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_FULL, // 96 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + 1,1,1,1, + 1,1,1,1, + 1,1,1,0, + 1,1,1,0, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,1, + 0,1,1,1, + + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 112 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + 0,0,0,1, + 0,0,0,1, + 0,0,0,1, + 0,0,0,1, + + Q_EMPTY, + + Q_EMPTY, // 128 + + 1,0,0,0, + 1,0,0,0, + 1,0,0,0, + 1,0,0,0, + + Q_EMPTY, + Q_EMPTY, + + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + 1,1,1,1, + + Q_EMPTY, + Q_EMPTY, + Q_TOP_QUARTER, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 144 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TRIANGLE_LEFT, + Q_TRIANGLE_RIGHT, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 160 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 176 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_PILLAR, + Q_PILLAR, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 192 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 208 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 224 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 240 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TOP_3_QUARTERS, + Q_TOP_3_QUARTERS, + + 1,1,1,1, + 1,1,1,1, + 1,1,1,0, + 0,0,0,0, + + Q_FULL, + Q_FULL, + + Q_TOP_3_QUARTERS, // 256 + Q_FULL, + Q_FULL, + Q_TOP_3_QUARTERS, + Q_TOP_3_QUARTERS, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 272 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 288 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + + Q_FULL, // 304 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_TOP_HALF, + Q_TOP_HALF, + Q_TOP_HALF, + Q_TOP_HALF, + Q_TOP_HALF, + Q_TOP_HALF, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 320 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_TOP_QUARTER, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,0, + 0,1,1,0, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,0, + 0,1,1,0, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,0, + 0,1,1,0, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,0, + 0,1,1,0, + + Q_PILLAR, + Q_PILLAR, + + Q_PILLAR, // 336 + Q_EMPTY, + Q_FULL, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 352 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TOP_QUARTER, + Q_TOP_QUARTER, + Q_TOP_QUARTER, + Q_EMPTY, + + Q_EMPTY, // 368 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 384 + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 400 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 416 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + + Q_PILLAR, // 432 + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR +}; \ No newline at end of file diff --git a/src/pixmap.cpp b/src/pixmap.cpp index 9c518dd..ecc46a1 100644 --- a/src/pixmap.cpp +++ b/src/pixmap.cpp @@ -311,85 +311,68 @@ BOOL CPixmap::Restore() void CPixmap::QuickIcon(int channel, int rank, POINT pos) { int num; - tagRECT rect; + RECT rect; if (channel == CHOBJECT) { - if (g_objectMax <= rank) - { - return; - } - num = rank * 12; - rect.left = (LONG)g_object[rank * 6]; - rect.top = (LONG)g_object[rank * 6 + 1]; - rect.right = g_object[rank * 6 + 4] + rect.left; - rect.bottom = g_object[rank * 6 + 2]; - pos.x = pos.x + g_object[rank * 6 + 2]; - num = (int)g_object[rank * 6 + 3]; + if (g_nbIconPackObject <= rank) return; + rect.left = g_iconPackObject[rank].pos.x; + rect.top = g_iconPackObject[rank].pos.y; + rect.right = rect.left + g_iconPackObject[rank].size.x; + rect.bottom = rect.top + g_iconPackObject[rank].size.y; + pos.x += g_iconPackObject[rank].offset.x; + pos.y += g_iconPackObject[rank].offset.y; } else if (channel == CHELEMENT) { - if (g_elementMax <= rank) - { - return; - } - num = rank * 12; - rect.left = (LONG)g_element[rank * 6]; - rect.top = (LONG)g_element[rank * 6 + 1]; - rect.right = g_element[rank * 6 + 4] + rect.left; - rect.bottom = g_element[rank * 6 + 5] + rect.top; - pos.x = pos.x + g_element[rank * 6 + 2]; - num = (int)g_element[rank * 6 + 3]; + if (g_nbIconPackElement <= rank) return; + rect.left = g_iconPackElement[rank].pos.x; + rect.top = g_iconPackElement[rank].pos.y; + rect.right = rect.left + g_iconPackElement[rank].size.x; + rect.bottom = rect.top + g_iconPackElement[rank].size.y; + pos.x += g_iconPackElement[rank].offset.x; + pos.y += g_iconPackElement[rank].offset.y; } - else if ((((channel == CHBLUPI) || (channel == CHBLUPI1)) || (channel == CHBLUPI2)) || (channel == CHBLUPI3)) + else if (IsBlupiChannel(channel)) { - if (g_blupiMax <= rank) - { - return; - } - num = rank * 12; - rect.left = (LONG)g_blupiCh[rank * 6]; - rect.top = (LONG)g_blupiCh[rank * 6 + 1]; - rect.right = g_blupiCh[rank * 6 + 4] + rect.left; - rect.bottom = g_blupiCh[rank * 6 + 5] + rect.top; - pos.x = pos.x + g_blupiCh[rank * 6 + 2]; - num = (int)g_blupiCh[rank * 6 + 3]; + if (g_nbIconPackBlupi <= rank) return; + rect.left = g_iconPackBlupi[rank].pos.x; + rect.top = g_iconPackBlupi[rank].pos.y; + rect.right = rect.left + g_iconPackBlupi[rank].size.x; + rect.bottom = rect.top + g_iconPackBlupi[rank].size.y; + pos.x += g_iconPackBlupi[rank].offset.x; + pos.y += g_iconPackBlupi[rank].offset.y; + } + else if (channel == CHEXPLO) + { + + if (g_nbIconPackExplo <= rank) return; + rect.left = g_iconPackExplo[rank].pos.x; + rect.top = g_iconPackExplo[rank].pos.y; + rect.right = rect.left + g_iconPackExplo[rank].size.x; + rect.bottom = rect.top + g_iconPackExplo[rank].size.y; + pos.x += g_iconPackExplo[rank].offset.x; + pos.y += g_iconPackExplo[rank].offset.y; } else { - if (channel != CHEXPLO) - { - rect.right = m_iconDim[channel].x; - num = m_totalDim[channel].x / rect.right; - rect.bottom = m_iconDim[channel].y; - if (rank < 0) - { - return; - } - if ((m_totalDim[channel].y / rect.bottom) * num <= rank) - { - return; - } - rect.left = (rank % num) * rect.right; - rect.right = rect.left + rect.right; - rect.top = (rank / num) * rect.bottom; - rect.bottom = rect.top + rect.bottom; - goto LABEL_1; - } - if (g_exploMax <= rank) + rect.right = m_iconDim[channel].x; + num = m_totalDim[channel].x / rect.right; + rect.bottom = m_iconDim[channel].y; + if (rank < 0) { return; } - rect.left = (LONG)g_explo[rank * 6]; - rect.top = (LONG)g_explo[rank * 6 + 1]; - rect.right = g_explo[rank * 6 + 4] + rect.left; - rect.bottom = g_explo[rank * 6 + 5] + rect.top; - pos.x = pos.x + g_explo[rank * 6 + 2]; - num = (int)g_explo[rank * 6 + 3]; + if ((m_totalDim[channel].y / rect.bottom) * num <= rank) + { + return; + } + rect.left = (rank % num) * rect.right; + rect.right = rect.left + rect.right; + rect.top = (rank / num) * rect.bottom; + rect.bottom = rect.top + rect.bottom; } - pos.y = pos.y + num; -LABEL_1: num = m_clipRect.left; if (pos.x < num) { @@ -1139,12 +1122,12 @@ BOOL CPixmap::CacheAll(BOOL cache, HWND hWnd, BOOL bFullScreen, BOOL bTrueColor, int CPixmap::Benchmark() { - struct _timeb tstruct; + timeb tstruct; int i, j, t1, t2, time; RECT rect; POINT dest; - _ftime(&tstruct); + ftime(&tstruct); t1 = tstruct.millitm; for (j = 0; j < 10; j++) @@ -1165,7 +1148,7 @@ int CPixmap::Benchmark() } } - _ftime(&tstruct); + ftime(&tstruct); t2 = tstruct.millitm; if (t1 > t2) t2 += 1000; @@ -1231,7 +1214,7 @@ void CPixmap::SetClipping(RECT clip) // Retourne la r�gion de clipping. -RECT CPixmap::GetClipping(RECT* rect) +RECT CPixmap::GetClipping() { return m_clipRect; } @@ -1256,7 +1239,7 @@ BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, if (channel == CHOBJECT) { - if (g_objectMax <= rank) + if (g_nbIconPackObject <= rank) { return FALSE; } @@ -1264,16 +1247,13 @@ BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, } else if (channel == CHELEMENT) { - if (g_elementMax <= rank) { + if (g_nbIconPackElement <= rank) { return FALSE; } } - else if (channel == CHBLUPI || - channel == CHBLUPI1 || - channel == CHBLUPI2 || - channel == CHBLUPI3) + else if (IsBlupiChannel(channel)) { - if (g_blupiMax <= rank) + if (g_nbIconPackBlupi <= rank) { return FALSE; } @@ -1292,7 +1272,7 @@ BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, if (rank < 0 || rank >= nbx * nby) return FALSE; } } - if (g_exploMax <= rank) return FALSE; + if (g_nbIconPackExplo <= rank) return FALSE; if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; if ( m_lpDDSurface[channel] == NULL ) return FALSE; @@ -1958,3 +1938,7 @@ void CPixmap::MouseHotSpot() } +static inline BOOL IsBlupiChannel(int channel) +{ + return channel == CHBLUPI || channel == CHBLUPI1 || channel == CHBLUPI2 || channel == CHBLUPI3; +} \ No newline at end of file diff --git a/src/pixmap.h b/src/pixmap.h index a2fdcde..b39f92b 100644 --- a/src/pixmap.h +++ b/src/pixmap.h @@ -1,7 +1,5 @@ // CPixmap.h -using namespace std; - #pragma once #include @@ -9,7 +7,7 @@ using namespace std; ///////////////////////////////////////////////////////////// #define MAXIMAGE 100 -#define DIRECTDRAW_VERSION 0x0500 +#define DIRECTDRAW_VERSION 0x0500 // ???????????? class CPixmap { @@ -39,7 +37,7 @@ public: void SetTransparent(int channel, COLORREF color); void SetTransparent2(int channel, COLORREF color1, COLORREF color2); void SetClipping(RECT clip); - RECT GetClipping(RECT* rect); + RECT GetClipping(); void HudIcon(int channel, int rank, POINT pos); void QuickIcon(int channel, int rank, POINT pos); @@ -125,4 +123,6 @@ protected: POINT m_totalDim[MAXIMAGE]; POINT m_iconDim[MAXIMAGE]; DDBLTFX m_DDbltfx; -}; \ No newline at end of file +}; + +static inline BOOL IsBlupiChannel(int channel); \ No newline at end of file diff --git a/src/resource.h b/src/resource.h index 6bac520..1582716 100644 --- a/src/resource.h +++ b/src/resource.h @@ -103,7 +103,7 @@ #define TX_DEMOPLAY 214 #define TX_SHOWNEXT 241 #define TX_SHOWCONNECTION 242 -#define TX_SHOWNEXT 245 +//#define TX_SHOWNEXT 245 #define TX_SHOWPREV 246 #define TX_GAMEJOIN 247 #define TX_CREATE_MULTIGAME 248 diff --git a/src/sound.cpp b/src/sound.cpp index ce151e1..927b65f 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -3,7 +3,7 @@ #include #include -#include +//#include #include "sound.h" #include "misc.h" #include "def.h" @@ -25,19 +25,19 @@ using namespace std; struct WaveHeader { - BYTE RIFF[4]; // "RIFF" - DWORD dwSize; // Size of data to follow - BYTE WAVE[4]; // "WAVE" - BYTE fmt_[4]; // "fmt " - DWORD dw16; // 16 - WORD wOne_0; // 1 - WORD wChnls; // Number of Channels - DWORD dwSRate; // Sample Rate - DWORD BytesPerSec; // Sample Rate - WORD wBlkAlign; // 1 - WORD BitsPerSample; // Sample size - BYTE DATA[4]; // "DATA" - DWORD dwDSize; // Number of Samples + BYTE RIFF[4]; // "RIFF" + DWORD dwSize; // Size of data to follow + BYTE WAVE[4]; // "WAVE" + BYTE fmt_[4]; // "fmt " + DWORD dw16; // 16 + WORD wOne_0; // 1 + WORD wChnls; // Number of Channels + DWORD dwSRate; // Sample Rate + DWORD BytesPerSec; // Sample Rate + WORD wBlkAlign; // 1 + WORD BitsPerSample; // Sample size + BYTE DATA[4]; // "DATA" + DWORD dwDSize; // Number of Samples }; @@ -47,189 +47,189 @@ struct WaveHeader BOOL CSound::CreateSoundBuffer(int dwBuf, DWORD dwBufSize, DWORD dwFreq, DWORD dwBitsPerSample, DWORD dwBlkAlign, BOOL bStereo) { - PCMWAVEFORMAT pcmwf; - DSBUFFERDESC dsbdesc; - - // Set up wave format structure. - memset( &pcmwf, 0, sizeof(PCMWAVEFORMAT) ); - pcmwf.wf.wFormatTag = WAVE_FORMAT_PCM; - pcmwf.wf.nChannels = bStereo ? 2 : 1; - pcmwf.wf.nSamplesPerSec = dwFreq; - pcmwf.wf.nBlockAlign = (WORD)dwBlkAlign; - pcmwf.wf.nAvgBytesPerSec = pcmwf.wf.nSamplesPerSec * pcmwf.wf.nBlockAlign; - pcmwf.wBitsPerSample = (WORD)dwBitsPerSample; + PCMWAVEFORMAT pcmwf; + DSBUFFERDESC dsbdesc; - // Set up DSBUFFERDESC structure. - memset(&dsbdesc, 0, sizeof(DSBUFFERDESC)); // Zero it out. - dsbdesc.dwSize = sizeof(DSBUFFERDESC); - dsbdesc.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME; - dsbdesc.dwBufferBytes = dwBufSize; - dsbdesc.lpwfxFormat = (LPWAVEFORMATEX)&pcmwf; + // Set up wave format structure. + memset(&pcmwf, 0, sizeof(PCMWAVEFORMAT)); + pcmwf.wf.wFormatTag = WAVE_FORMAT_PCM; + pcmwf.wf.nChannels = bStereo ? 2 : 1; + pcmwf.wf.nSamplesPerSec = dwFreq; + pcmwf.wf.nBlockAlign = (WORD)dwBlkAlign; + pcmwf.wf.nAvgBytesPerSec = pcmwf.wf.nSamplesPerSec * pcmwf.wf.nBlockAlign; + pcmwf.wBitsPerSample = (WORD)dwBitsPerSample; - TRY_DS(m_lpDS->CreateSoundBuffer(&dsbdesc, &m_lpDSB[dwBuf], NULL), 63) - return TRUE; + // Set up DSBUFFERDESC structure. + memset(&dsbdesc, 0, sizeof(DSBUFFERDESC)); // Zero it out. + dsbdesc.dwSize = sizeof(DSBUFFERDESC); + dsbdesc.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME; + dsbdesc.dwBufferBytes = dwBufSize; + dsbdesc.lpwfxFormat = (LPWAVEFORMATEX)&pcmwf; + + TRY_DS(m_lpDS->CreateSoundBuffer(&dsbdesc, &m_lpDSB[dwBuf], NULL), 63) + return TRUE; } // I dunno what the fuck this does. /* BOOL CSound::ErrorSomething() { - if (m_lpDS || - m_lpDSB != 0) - { - m_lpDS, m_lpDSB->TraceErrorDS; - return FALSE; - } - return TRUE; +if (m_lpDS || +m_lpDSB != 0) +{ +m_lpDS, m_lpDSB->TraceErrorDS; +return FALSE; +} +return TRUE; } */ // Reads in data from a wave file. -BOOL CSound::ReadData(LPDIRECTSOUNDBUFFER lpDSB, FILE* pFile, DWORD dwSize, DWORD dwPos) +BOOL CSound::ReadData(LPDIRECTSOUNDBUFFER lpDSB, FILE* pFile, DWORD dwSize, DWORD dwPos) { - // Seek to correct position in file (if necessary) - if ( dwPos != 0xffffffff ) - { - if ( fseek(pFile, dwPos, SEEK_SET) != 0 ) - { - return FALSE; - } - } + // Seek to correct position in file (if necessary) + if (dwPos != 0xffffffff) + { + if (fseek(pFile, dwPos, SEEK_SET) != 0) + { + return FALSE; + } + } - // Lock data in buffer for writing - LPVOID pData1; - DWORD dwData1Size; - LPVOID pData2; - DWORD dwData2Size; - HRESULT rval; + // Lock data in buffer for writing + LPVOID pData1; + DWORD dwData1Size; + LPVOID pData2; + DWORD dwData2Size; + HRESULT rval; - rval = lpDSB->Lock(0, dwSize, &pData1, &dwData1Size, &pData2, &dwData2Size, DSBLOCK_FROMWRITECURSOR); - if ( rval != DS_OK ) - { - return FALSE; - } + rval = lpDSB->Lock(0, dwSize, &pData1, &dwData1Size, &pData2, &dwData2Size, DSBLOCK_FROMWRITECURSOR); + if (rval != DS_OK) + { + return FALSE; + } - // Read in first chunk of data - if ( dwData1Size > 0 ) - { - if ( fread(pData1, dwData1Size, 1, pFile) != 1 ) - { - char holder[256]; - wsprintfA(holder,"Data1 : %d, dwdata: %d, pFile: %d",pData1,dwData1Size,pFile); - OutputDebug(holder); - return FALSE; - } - } + // Read in first chunk of data + if (dwData1Size > 0) + { + if (fread(pData1, dwData1Size, 1, pFile) != 1) + { + char holder[256]; + wsprintfA(holder, "Data1 : %d, dwdata: %d, pFile: %d", pData1, dwData1Size, pFile); + OutputDebug(holder); + return FALSE; + } + } - // read in second chunk if necessary - if ( dwData2Size > 0 ) - { - if ( fread(pData2, dwData2Size, 1, pFile) != 1 ) - { - return FALSE; - } - } + // read in second chunk if necessary + if (dwData2Size > 0) + { + if (fread(pData2, dwData2Size, 1, pFile) != 1) + { + return FALSE; + } + } - // Unlock data in buffer - rval = lpDSB->Unlock(pData1, dwData1Size, pData2, dwData2Size); - if ( rval != DS_OK ) - { - return FALSE; - } + // Unlock data in buffer + rval = lpDSB->Unlock(pData1, dwData1Size, pData2, dwData2Size); + if (rval != DS_OK) + { + return FALSE; + } - return TRUE; + return TRUE; } // Creates a DirectSound buffer from a wave file. BOOL CSound::CreateBufferFromWaveFile(int dwBuf, char *pFileName) { - // Open the wave file - FILE* pFile = fopen(pFileName, "rb"); - if ( pFile == NULL ) return FALSE; + // Open the wave file + FILE* pFile = fopen(pFileName, "rb"); + if (pFile == NULL) return FALSE; - // Read in the wave header - WaveHeader wavHdr; - if ( fread(&wavHdr, sizeof(wavHdr), 1, pFile) != 1 ) - { - fclose(pFile); - return NULL; - } + // Read in the wave header + WaveHeader wavHdr; + if (fread(&wavHdr, sizeof(wavHdr), 1, pFile) != 1) + { + fclose(pFile); + return NULL; + } - // Figure out the size of the data region - DWORD dwSize = wavHdr.dwDSize; + // Figure out the size of the data region + DWORD dwSize = wavHdr.dwDSize; - // Is this a stereo or mono file? - BOOL bStereo = wavHdr.wChnls > 1 ? TRUE : FALSE; + // Is this a stereo or mono file? + BOOL bStereo = wavHdr.wChnls > 1 ? TRUE : FALSE; - // Create the sound buffer for the wave file - if ( !CreateSoundBuffer(dwBuf, dwSize, wavHdr.dwSRate, - wavHdr.BitsPerSample, wavHdr.wBlkAlign, bStereo) ) - { - // Close the file - fclose(pFile); - - return FALSE; - } + // Create the sound buffer for the wave file + if (!CreateSoundBuffer(dwBuf, dwSize, wavHdr.dwSRate, + wavHdr.BitsPerSample, wavHdr.wBlkAlign, bStereo)) + { + // Close the file + fclose(pFile); - // Read the data for the wave file into the sound buffer - if ( !ReadData(m_lpDSB[dwBuf], pFile, dwSize, sizeof(wavHdr)) ) - { - fclose(pFile); - return FALSE; - } + return FALSE; + } - // Close out the wave file - fclose(pFile); + // Read the data for the wave file into the sound buffer + if (!ReadData(m_lpDSB[dwBuf], pFile, dwSize, sizeof(wavHdr))) + { + fclose(pFile); + return FALSE; + } - return TRUE; + // Close out the wave file + fclose(pFile); + + return TRUE; } // Stops all sounds. BOOL CSound::StopAllSounds() { - // Make sure we have a valid sound buffer - for (int i = 0; i < MAXSOUND; i ++) - { - if ( m_lpDSB[i] ) - { - DWORD dwStatus; - TRY_DS(m_lpDSB[i]->GetStatus(&dwStatus)); + // Make sure we have a valid sound buffer + for (int i = 0; i < MAXSOUND; i++) + { + if (m_lpDSB[i]) + { + DWORD dwStatus; + TRY_DS(m_lpDSB[i]->GetStatus(&dwStatus)); - if ( (dwStatus & DSBSTATUS_PLAYING) == DSBSTATUS_PLAYING ) - { - TRY_DS(m_lpDSB[i]->Stop()) - } - } - } + if ((dwStatus & DSBSTATUS_PLAYING) == DSBSTATUS_PLAYING) + { + TRY_DS(m_lpDSB[i]->Stop()) + } + } + } - return TRUE; + return TRUE; } // Plays a sound using direct sound. BOOL CSound::PlaySoundDS(DWORD dwSound, DWORD dwFlags) { - // Make sure the sound is valid - if ( dwSound >= MAXSOUND ) return FALSE; + // Make sure the sound is valid + if (dwSound >= MAXSOUND) return FALSE; - // Make sure we have a valid sound buffer - if ( m_lpDSB[dwSound] ) - { - DWORD dwStatus; - TRY_DS(m_lpDSB[dwSound]->GetStatus(&dwStatus)); + // Make sure we have a valid sound buffer + if (m_lpDSB[dwSound]) + { + DWORD dwStatus; + TRY_DS(m_lpDSB[dwSound]->GetStatus(&dwStatus)); - if ( (dwStatus & DSBSTATUS_PLAYING) != DSBSTATUS_PLAYING ) - { - // Play the sound - TRY_DS(m_lpDSB[dwSound]->Play(0, 0, dwFlags)); - } - } + if ((dwStatus & DSBSTATUS_PLAYING) != DSBSTATUS_PLAYING) + { + // Play the sound + TRY_DS(m_lpDSB[dwSound]->Play(0, 0, dwFlags)); + } + } - return TRUE; + return TRUE; } @@ -271,20 +271,20 @@ void InitMidiVolume(int volume) 0xFFFFFFFF, }; - if ( volume < 0 ) volume = 0; - if ( volume > MAXVOLUME ) volume = MAXVOLUME; + if (volume < 0) volume = 0; + if (volume > MAXVOLUME) volume = MAXVOLUME; nb = midiOutGetNumDevs(); - for ( i=0 ; iRelease(); - m_lpDSB[i]= NULL; + //? m_lpDSB[i]->Release(); + m_lpDSB[i] = NULL; } } - if ( m_lpDS != NULL ) + if (m_lpDS != NULL) { m_lpDS->Release(); m_lpDS = NULL; @@ -357,7 +357,7 @@ CSound::~CSound() BOOL CSound::Create(HWND hWnd) { - if ( !DirectSoundCreate(NULL, &m_lpDS, NULL) == DS_OK ) + if (!DirectSoundCreate(NULL, &m_lpDS, NULL) == DS_OK) { OutputDebug("Fatal error: DirectSoundCreate\n"); m_bEnable = FALSE; @@ -366,7 +366,7 @@ BOOL CSound::Create(HWND hWnd) m_lpDS->SetCooperativeLevel(hWnd, DSSCL_NORMAL); m_bEnable = TRUE; - m_hWnd = hWnd; + m_hWnd = hWnd; return TRUE; } @@ -396,7 +396,7 @@ void CSound::SetAudioVolume(int volume) int CSound::GetAudioVolume() { - if ( !m_bEnable ) return 0; + if (!m_bEnable) return 0; return m_audioVolume; } @@ -407,7 +407,7 @@ void CSound::SetMidiVolume(int volume) int CSound::GetMidiVolume() { - if ( !m_bEnable ) return 0; + if (!m_bEnable) return 0; return m_midiVolume; } @@ -419,27 +419,27 @@ void CSound::CacheAll() int i; char name[50]; - if ( !m_bEnable ) return; + if (!m_bEnable) return; - for ( i=0 ; i= MAXSOUND ) return FALSE; + if (!m_bEnable) return FALSE; + if (channel < 0 || channel >= MAXSOUND) return FALSE; - if ( m_lpDSB[channel] != NULL ) + if (m_lpDSB[channel] != NULL) { Flush(channel); } - + return CreateBufferFromWaveFile(channel, pFilename); } @@ -447,13 +447,13 @@ BOOL CSound::Cache(int channel, char *pFilename) void CSound::Flush(int channel) { - if ( !m_bEnable ) return; - if ( channel < 0 || channel >= MAXSOUND ) return; + if (!m_bEnable) return; + if (channel < 0 || channel >= MAXSOUND) return; - if ( m_lpDSB[channel] != NULL ) + if (m_lpDSB[channel] != NULL) { m_lpDSB[channel]->Release(); - m_lpDSB[channel]= NULL; + m_lpDSB[channel] = NULL; } } @@ -464,16 +464,16 @@ void CSound::Flush(int channel) BOOL CSound::Play(int channel, int volume, int pan) { - if ( !m_bEnable ) return TRUE; - if ( !m_bState || m_audioVolume == 0 ) return TRUE; + if (!m_bEnable) return TRUE; + if (!m_bState || m_audioVolume == 0) return TRUE; - volume -= (MAXVOLUME-m_audioVolume)*((10000/4)/MAXVOLUME); + volume -= (MAXVOLUME - m_audioVolume)*((10000 / 4) / MAXVOLUME); -//? if ( volume == -10000 ) return TRUE; - if ( volume <= -10000/4 ) return TRUE; + //? if ( volume == -10000 ) return TRUE; + if (volume <= -10000 / 4) return TRUE; - if ( channel < 0 || channel >= MAXSOUND ) return FALSE; - if ( m_lpDSB[channel] == NULL ) return FALSE; + if (channel < 0 || channel >= MAXSOUND) return FALSE; + if (m_lpDSB[channel] == NULL) return FALSE; m_lpDSB[channel]->SetVolume(volume); m_lpDSB[channel]->SetPan(pan); @@ -482,7 +482,7 @@ BOOL CSound::Play(int channel, int volume, int pan) return TRUE; } -BOOL CSound::StopSound(Sound channel) +BOOL CSound::StopSound(int channel) { if (m_bEnable) return FALSE; if (m_bState || m_audioVolume == 0) return FALSE; @@ -506,10 +506,10 @@ BOOL CSound::PlayImage(int channel, POINT pos, int rank) { int stopCh, volumex, volumey, volume, pan; - if ( rank >= 0 && rank < MAXBLUPI ) + if (rank >= 0 && rank < MAXBLUPI) { stopCh = m_channelBlupi[rank]; - if ( stopCh >= 0 && m_lpDSB[stopCh] != NULL ) + if (stopCh >= 0 && m_lpDSB[stopCh] != NULL) { m_lpDSB[stopCh]->Stop(); // stoppe le son pr�c�dent m_lpDSB[stopCh]->SetCurrentPosition(0); @@ -518,35 +518,35 @@ BOOL CSound::PlayImage(int channel, POINT pos, int rank) m_channelBlupi[rank] = channel; } -//? pan = (int)(((long)pos.x*20000L)/LXIMAGE)-10000L; -//? pan = (int)(((long)pos.x*10000L)/LXIMAGE)-5000L; - pan = (int)(((long)pos.x*5000L)/LXIMAGE)-2500L; + //? pan = (int)(((long)pos.x*20000L)/LXIMAGE)-10000L; + //? pan = (int)(((long)pos.x*10000L)/LXIMAGE)-5000L; + pan = (int)(((long)pos.x * 5000L) / LXIMAGE) - 2500L; volumex = 0; // volume maximum - if ( pos.x < 0 ) + if (pos.x < 0) { - volumex = (pos.x*2500)/LXIMAGE; + volumex = (pos.x * 2500) / LXIMAGE; } - if ( pos.x > LXIMAGE ) + if (pos.x > LXIMAGE) { pos.x -= LXIMAGE; - volumex = (-pos.x*2500)/LXIMAGE; + volumex = (-pos.x * 2500) / LXIMAGE; } - if ( volumex < -10000 ) volumex = -10000; + if (volumex < -10000) volumex = -10000; volumey = 0; // volume maximum - if ( pos.y < 0 ) + if (pos.y < 0) { - volumey = (pos.y*2500)/LYIMAGE; + volumey = (pos.y * 2500) / LYIMAGE; } - if ( pos.y > LYIMAGE ) + if (pos.y > LYIMAGE) { pos.y -= LYIMAGE; - volumey = (-pos.y*2500)/LYIMAGE; + volumey = (-pos.y * 2500) / LYIMAGE; } - if ( volumey < -10000 ) volumey = -10000; + if (volumey < -10000) volumey = -10000; - if ( volumex < volumey ) volume = volumex; + if (volumex < volumey) volume = volumex; else volume = volumey; return Play(channel, volume, pan); @@ -563,30 +563,30 @@ BOOL CSound::PlayMusic(HWND hWnd, LPSTR lpszMIDIFilename) DWORD dwReturn; char string[MAX_PATH]; - if ( !m_bEnable ) return TRUE; - if ( m_midiVolume == 0 ) return TRUE; + if (!m_bEnable) return TRUE; + if (m_midiVolume == 0) return TRUE; InitMidiVolume(m_midiVolume); m_lastMidiVolume = m_midiVolume; - if ( lpszMIDIFilename[1] == ':' ) // nom complet "D:\REP..." ? + if (lpszMIDIFilename[1] == ':') // nom complet "D:\REP..." ? { strcpy(string, lpszMIDIFilename); } else { - GetCurrentDir(string, MAX_PATH-30); + GetCurrentDir(string, MAX_PATH - 30); strcat(string, lpszMIDIFilename); } // Open the device by specifying the device and filename. // MCI will attempt to choose the MIDI mapper as the output port. - mciOpenParms.lpstrDeviceType = (LPCWSTR)"sequencer"; - mciOpenParms.lpstrElementName = (LPCWSTR)string; + mciOpenParms.lpstrDeviceType = "sequencer"; + mciOpenParms.lpstrElementName = string; dwReturn = mciSendCommand(NULL, - MCI_OPEN, - MCI_OPEN_TYPE|MCI_OPEN_ELEMENT, - (DWORD)(LPVOID)&mciOpenParms); - if ( dwReturn != 0 ) + MCI_OPEN, + MCI_OPEN_TYPE | MCI_OPEN_ELEMENT, + (DWORD)(LPVOID)&mciOpenParms); + if (dwReturn != 0) { OutputDebug("PlayMusic-1\n"); mciGetErrorStringA(dwReturn, string, 128); @@ -601,10 +601,10 @@ BOOL CSound::PlayMusic(HWND hWnd, LPSTR lpszMIDIFilename) // Begin playback. mciPlayParms.dwCallback = (DWORD)hWnd; dwReturn = mciSendCommand(m_MidiDeviceID, - MCI_PLAY, - MCI_NOTIFY, - (DWORD)(LPVOID)&mciPlayParms); - if ( dwReturn != 0 ) + MCI_PLAY, + MCI_NOTIFY, + (DWORD)(LPVOID)&mciPlayParms); + if (dwReturn != 0) { OutputDebug("PlayMusic-2\n"); mciGetErrorStringA(dwReturn, string, 128); @@ -623,9 +623,9 @@ BOOL CSound::PlayMusic(HWND hWnd, LPSTR lpszMIDIFilename) BOOL CSound::RestartMusic() { OutputDebug("RestartMusic\n"); - if ( !m_bEnable ) return TRUE; - if ( m_midiVolume == 0 ) return TRUE; - if ( m_MIDIFilename[0] == 0 ) return FALSE; + if (!m_bEnable) return TRUE; + if (m_midiVolume == 0) return TRUE; + if (m_MIDIFilename[0] == 0) return FALSE; return PlayMusic(m_hWnd, m_MIDIFilename); } @@ -634,15 +634,15 @@ BOOL CSound::RestartMusic() void CSound::SuspendMusic() { - if ( !m_bEnable ) return; + if (!m_bEnable) return; - if ( m_nbSuspendSkip != 0 ) + if (m_nbSuspendSkip != 0) { - m_nbSuspendSkip --; + m_nbSuspendSkip--; return; } - if ( m_MidiDeviceID && m_midiVolume != 0 ) + if (m_MidiDeviceID && m_midiVolume != 0) { mciSendCommand(m_MidiDeviceID, MCI_CLOSE, 0, NULL); } @@ -668,7 +668,7 @@ BOOL CSound::IsPlayingMusic() void CSound::AdaptVolumeMusic() { - if ( m_midiVolume != m_lastMidiVolume ) + if (m_midiVolume != m_lastMidiVolume) { InitMidiVolume(m_midiVolume); m_lastMidiVolume = m_midiVolume; diff --git a/src/sound.h b/src/sound.h index 9289cde..63d4aeb 100644 --- a/src/sound.h +++ b/src/sound.h @@ -6,41 +6,10 @@ using namespace std; #pragma once #include -#include +// #include "dsound.h" #include -typedef enum -{ - SOUND_3_JUMPEND, - SOUND_10_BOUM, - SOUND_11_TRESOR, - SOUND_13_ENDKO, - SOUND_14_ENDOK, - SOUND_16_HELICOHIGH, - SOUND_18_HELICOLOW, - SOUND_23_PLOUF, - SOUND_24_BLUP, - SOUND_29_JEEPHIGH, - SOUND_31_JEEPLOW, - SOUND_33_DOOR, - SOUND_41_RESSORT, - SOUND_42_STARTSHIELD, - SOUND_50_SUCETTE, - SOUND_51_GLU, - SOUND_57_DRINK, - SOUND_58_CHARGE, - SOUND_59_ELECTRO, - SOUND_60_PERSOTAKE, - SOUND_64_TIPLOUF, - SOUND_69_BLITZ, - SOUND_74_ANGEL, - SOUND_75_SCIE, - SOUND_76_SWITCHOFF, - SOUND_92_FOLLOW -} -Sound; - /////////////////////////////////////////////////////////////////////////// #define MAXSOUND 100 @@ -51,52 +20,54 @@ Sound; class CSound { public: - CSound(); - ~CSound(); + CSound(); + ~CSound(); - BOOL Create(HWND hWnd); - void SetState(BOOL bState); - BOOL GetEnable(); + BOOL ErrorSomething(); + BOOL Create(HWND hWnd); + void SetState(BOOL bState); + BOOL GetEnable(); - void SetAudioVolume(int volume); - int GetAudioVolume(); - void SetMidiVolume(int volume); - int GetMidiVolume(); + void SetAudioVolume(int volume); + int GetAudioVolume(); + void SetMidiVolume(int volume); + int GetMidiVolume(); + void SetCDAudio(BOOL bCDAudio); - void CacheAll(); - BOOL Cache(int channel, char *pFilename); - void Flush(int channel); + void CacheAll(); + BOOL Cache(int channel, char *pFilename); + void Flush(int channel); - BOOL Play (int channel, int volume=0, int pan=0); - BOOL StopSound(Sound channel); - BOOL PlayImage(int channel, POINT pos, int rank=-1); - BOOL PlayMusic(HWND hWnd, LPSTR lpszMIDIFilename); - BOOL RestartMusic(); - void SuspendMusic(); - void StopMusic(); - BOOL IsPlayingMusic(); - void AdaptVolumeMusic(); - void SetSuspendSkip(int nb); + BOOL Play(int channel, int volume = 0, int pan = 0); + BOOL StopSound(int channel); + BOOL PlayImage(int channel, POINT pos, int rank = -1); + BOOL PlayMusic(HWND hWnd, LPSTR lpszMIDIFilename); + BOOL RestartMusic(); + void SuspendMusic(); + void StopMusic(); + BOOL IsPlayingMusic(); + void AdaptVolumeMusic(); + void SetSuspendSkip(int nb); protected: - BOOL CreateSoundBuffer(int dwBuf, DWORD dwBufSize, DWORD dwFreq, DWORD dwBitsPerSample, DWORD dwBlkAlign, BOOL bStereo); - BOOL ReadData(LPDIRECTSOUNDBUFFER lpDSB, FILE* pFile, DWORD dwSize, DWORD dwPos); - BOOL CreateBufferFromWaveFile(int dwBuf, char *pFileName); - BOOL StopAllSounds(); - BOOL PlaySoundDS(DWORD dwSound, DWORD dwFlags); + BOOL CreateSoundBuffer(int dwBuf, DWORD dwBufSize, DWORD dwFreq, DWORD dwBitsPerSample, DWORD dwBlkAlign, BOOL bStereo); + BOOL ReadData(LPDIRECTSOUNDBUFFER lpDSB, FILE* pFile, DWORD dwSize, DWORD dwPos); + BOOL CreateBufferFromWaveFile(int dwBuf, char *pFileName); + BOOL StopAllSounds(); + BOOL PlaySoundDS(DWORD dwSound, DWORD dwFlags); protected: - HWND m_hWnd; - BOOL m_bEnable; - BOOL m_bState; - BOOL m_bCDAudio; - LPDIRECTSOUND m_lpDS; - LPDIRECTSOUNDBUFFER m_lpDSB[MAXSOUND]; - short m_channelBlupi[MAXBLUPI]; - UINT m_MidiDeviceID; - char m_MIDIFilename[50]; - int m_audioVolume; - int m_midiVolume; - int m_lastMidiVolume; - int m_nbSuspendSkip; + HWND m_hWnd; + BOOL m_bEnable; + BOOL m_bState; + BOOL m_bCDAudio; + LPDIRECTSOUND m_lpDS; + LPDIRECTSOUNDBUFFER m_lpDSB[MAXSOUND]; + short m_channelBlupi[MAXBLUPI]; + UINT m_MidiDeviceID; + char m_MIDIFilename[50]; + int m_audioVolume; + int m_midiVolume; + int m_lastMidiVolume; + int m_nbSuspendSkip; }; \ No newline at end of file diff --git a/src/text.cpp b/src/text.cpp index a08f9ab..bf10589 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -78,7 +78,7 @@ int GetCharWidth(char c, int font) // Affiche un texte. -void DrawTextB(CPixmap *pPixmap, POINT pos, char *pText, int font) +void DrawText(CPixmap *pPixmap, POINT pos, char *pText, int font) { int rank; @@ -107,7 +107,7 @@ void DrawTextB(CPixmap *pPixmap, POINT pos, char *pText, int font) void DrawTextLeft(CPixmap* pPixmap, POINT pos, char *text, int font) { - DrawTextB(pPixmap, pos, text, font); + DrawText(pPixmap, pos, text, font); return; } @@ -196,7 +196,7 @@ void DrawTextRect(CPixmap *pPixmap, POINT pos, char *pText, if ( pente == 0 ) { - DrawTextB(pPixmap, pos, pDest, font); + DrawText(pPixmap, pos, pDest, font); } else { @@ -241,7 +241,7 @@ void DrawTextCenter(CPixmap *pPixmap, POINT pos, char *pText, int font) pDest = text; start.x = pos.x - GetTextWidth(pDest)/2; start.y = pos.y; - DrawTextB(pPixmap, start, pDest, font); + DrawText(pPixmap, start, pDest, font); if ( pDest[0] == 0 ) // ligne vide ? { @@ -315,64 +315,3 @@ int GetTextWidth(char *pText, int font) return width; } - -// Retourne la longueur d'un grand chiffre. - -void GetBignumInfo(int num, int &start, int &lg) -{ - static int table[11] = - { - 0,53,87,133,164,217,253,297,340,382,426 - }; - - start = table[num]; - lg = table[num+1]-table[num]; -} - -// Affiche un grand nombre. - -void DrawBignum(CPixmap *pPixmap, POINT pos, int num) -{ - char string[10]; - int i = 0; - int start, lg; - RECT rect; - - sprintf(string, "%d", num); - - rect.top = 0; - rect.bottom = 52; - while ( string[i] != 0 ) - { - GetBignumInfo(string[i]-'0', start, lg); - - rect.left = start; - rect.right = start+lg; - pPixmap->DrawPart(-1, CHBIGNUM, pos, rect); - pos.x += lg+4; - - i ++; - } -} - -// Retourne la longueur d'un grand nombre. - -int GetBignumWidth(int num) -{ - char string[10]; - int i = 0; - int start, lg; - int width = -4; - - sprintf(string, "%d", num); - - while ( string[i] != 0 ) - { - GetBignumInfo(string[i]-'0', start, lg); - width += lg+4; - i ++; - } - - return width; -} - diff --git a/src/text.h b/src/text.h index d7d329d..97ede20 100644 --- a/src/text.h +++ b/src/text.h @@ -19,7 +19,7 @@ typedef struct CharOffset; extern -void DrawTextB(CPixmap *pPixmap, POINT pos, char *pText, int font); +void DrawText(CPixmap *pPixmap, POINT pos, char *pText, int font); extern void DrawTextLeft(CPixmap* pPixmap, POINT pos, char *text, int font);