1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Convert to UTF-8

This commit is contained in:
Mathieu Schroeter 2017-02-12 00:44:46 +01:00
parent 0af18aa9eb
commit 0e338b45db
30 changed files with 1029 additions and 1029 deletions

View File

@ -1365,7 +1365,7 @@ static DescAction action_table[] =
{0}, {0},
}, },
{ {
ACTION_MISC1, // hausse les épaules ACTION_MISC1, // hausse les épaules
CHBLUPI, CHBLUPI,
{ {
{1, 140}, // e {1, 140}, // e
@ -1465,7 +1465,7 @@ static DescAction action_table[] =
{0}, {0},
}, },
{ {
ACTION_MISC5, // ohé ACTION_MISC5, // ohé
CHBLUPI, CHBLUPI,
{ {
{8, 110,110,111,111,110,110,112,112}, {8, 110,110,111,111,110,110,112,112},
@ -1844,7 +1844,7 @@ static DescAction action_table[] =
{0}, {0},
}, },
// Araignée : // Araignée :
{ {
ACTION_A_STOP, ACTION_A_STOP,
@ -2443,7 +2443,7 @@ static DescAction action_table[] =
-1,-1,SOUND_B_SAUT,-1,-1,-1,-1,-1,-1,-1}, -1,-1,SOUND_B_SAUT,-1,-1,-1,-1,-1,-1,-1},
}, },
// Détonnateur de mine. // Détonnateur de mine.
{ {
ACTION_D_DELAY, ACTION_D_DELAY,
@ -2568,7 +2568,7 @@ static DescAction action_table[] =
// Calcule l'action suivante. // Calcule l'action suivante.
// Retourne false lorsque l'action est terminée. // Retourne false lorsque l'action est terminée.
bool Action(short action, short direct, bool Action(short action, short direct,
short &phase, short &step, short &phase, short &step,
@ -2656,7 +2656,7 @@ static short rotate_table[] =
-1 -1
}; };
// Tourne une icône dans une direction donnée. // Tourne une icône dans une direction donnée.
bool Rotate(short &icon, short direct) bool Rotate(short &icon, short direct)
{ {
@ -2717,7 +2717,7 @@ bool Rotate(short &icon, short direct)
return false; return false;
} }
// Retourne la direction d'une icône. // Retourne la direction d'une icône.
int GetIconDirect(short icon) int GetIconDirect(short icon)
{ {

View File

@ -5,7 +5,7 @@
#include "misc.h" #include "misc.h"
// Cette table indique les quarts de cases contenant de // Cette table indique les quarts de cases contenant de
// l'eau lorsque la valeur est à un. // l'eau lorsque la valeur est à un.
// 0 1 // 0 1
// 2 3 // 2 3
static char tableSee[14*4] = static char tableSee[14*4] =
@ -27,7 +27,7 @@ static char tableSee[14*4] =
}; };
// Cette table indique les quarts de cases contenant de // Cette table indique les quarts de cases contenant de
// la mousse ou de la terre lorsque la valeur est à un. // la mousse ou de la terre lorsque la valeur est à un.
// 0 1 // 0 1
// 2 3 // 2 3
static char tableDark[13*4] = static char tableDark[13*4] =
@ -76,7 +76,7 @@ bool CDecor::GetSeeBits(POINT cel, char *pBits, int index)
if ( index == 1 ) // mousse ? if ( index == 1 ) // mousse ?
{ {
if ( icon >= 2 && icon <= 14 ) return false; // eau ? if ( icon >= 2 && icon <= 14 ) return false; // eau ?
if ( icon == 66 || icon == 79 ) // mousse spéciale ? if ( icon == 66 || icon == 79 ) // mousse spéciale ?
{ {
pBits[0] = 1; pBits[0] = 1;
pBits[1] = 1; pBits[1] = 1;
@ -95,8 +95,8 @@ bool CDecor::GetSeeBits(POINT cel, char *pBits, int index)
if ( index == 2 ) // terre ? if ( index == 2 ) // terre ?
{ {
if ( icon >= 2 && icon <= 14 ) return false; // eau ? if ( icon >= 2 && icon <= 14 ) return false; // eau ?
if ( (icon >= 46 && icon <= 48) || // terre spéciale ? if ( (icon >= 46 && icon <= 48) || // terre spéciale ?
icon == 71 ) // terre à fer ? icon == 71 ) // terre à fer ?
{ {
pBits[0] = 1; pBits[0] = 1;
pBits[1] = 1; pBits[1] = 1;
@ -132,7 +132,7 @@ bool ChangeBits(char *pDst, char *pSrc)
return false; return false;
} }
// Retourne l'icône correspondant aux bits d'eaux. // Retourne l'icône correspondant aux bits d'eaux.
int CDecor::GetSeeIcon(char *pBits, int index) int CDecor::GetSeeIcon(char *pBits, int index)
{ {
@ -179,7 +179,7 @@ int CDecor::GetSeeIcon(char *pBits, int index)
return -1; return -1;
} }
// Arrange le sol après une modification. // Arrange le sol après une modification.
void CDecor::ArrangeFloor(POINT cel) void CDecor::ArrangeFloor(POINT cel)
{ {
@ -193,7 +193,7 @@ void CDecor::ArrangeFloor(POINT cel)
if ( icon >= 59 && icon <= 64 ) return; // pont ? if ( icon >= 59 && icon <= 64 ) return; // pont ?
max = 3; max = 3;
if ( icon >= 15 && icon <= 18 ) // dalle spéciale ? if ( icon >= 15 && icon <= 18 ) // dalle spéciale ?
{ {
max = 1; // s'occupe que de l'eau ! max = 1; // s'occupe que de l'eau !
} }
@ -202,7 +202,7 @@ void CDecor::ArrangeFloor(POINT cel)
{ {
if ( !GetSeeBits(cel, here, index) ) continue; if ( !GetSeeBits(cel, here, index) ) continue;
test.x = cel.x -2; // en bas à gauche test.x = cel.x -2; // en bas à gauche
test.y = cel.y +2; test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -216,7 +216,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
} }
test.x = cel.x -2; // en haut à gauche test.x = cel.x -2; // en haut à gauche
test.y = cel.y -2; test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -230,7 +230,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
} }
test.x = cel.x +2; // en haut à droite test.x = cel.x +2; // en haut à droite
test.y = cel.y -2; test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -244,7 +244,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
} }
test.x = cel.x +2; // en bas à droite test.x = cel.x +2; // en bas à droite
test.y = cel.y +2; test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -265,7 +265,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
test.x = cel.x -2; // à gauche test.x = cel.x -2; // à gauche
test.y = cel.y; test.y = cel.y;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -279,7 +279,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
} }
test.x = cel.x -2; // en haut à gauche test.x = cel.x -2; // en haut à gauche
test.y = cel.y -2; test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -306,7 +306,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
} }
test.x = cel.x +2; // en haut à droite test.x = cel.x +2; // en haut à droite
test.y = cel.y -2; test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -319,7 +319,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
} }
test.x = cel.x +2; // à droite test.x = cel.x +2; // à droite
test.y = cel.y; test.y = cel.y;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -333,7 +333,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
} }
test.x = cel.x +2; // en bas à droite test.x = cel.x +2; // en bas à droite
test.y = cel.y +2; test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -360,7 +360,7 @@ void CDecor::ArrangeFloor(POINT cel)
} }
} }
test.x = cel.x -2; // en bas à gauche test.x = cel.x -2; // en bas à gauche
test.y = cel.y +2; test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) ) if ( GetSeeBits(test, bits, index) )
{ {
@ -412,7 +412,7 @@ static short tableMurDir[4*2] =
// les directions. // les directions.
// index=0 si mur (20..26) // index=0 si mur (20..26)
// index=1 si palissade (65..71) // index=1 si palissade (65..71)
// index=2 si barrière (106..112) // index=2 si barrière (106..112)
void CDecor::ArrangeMur(POINT cel, int &icon, int index) void CDecor::ArrangeMur(POINT cel, int &icon, int index)
{ {
@ -521,7 +521,7 @@ void CDecor::ArrangeBuild(POINT cel, int &channel, int &icon)
matiere = 36; // planches matiere = 36; // planches
} }
// Rien à faire si pas mur. // Rien à faire si pas mur.
if ( channel != CHOBJECT || icon != last ) continue; if ( channel != CHOBJECT || icon != last ) continue;
oldChannel = m_decor[cel.x/2][cel.y/2].objectChannel; oldChannel = m_decor[cel.x/2][cel.y/2].objectChannel;
@ -567,7 +567,7 @@ void CDecor::ArrangeBuild(POINT cel, int &channel, int &icon)
} }
} }
// Arrange les objets après une modification. // Arrange les objets après une modification.
void CDecor::ArrangeObject(POINT cel) void CDecor::ArrangeObject(POINT cel)
{ {
@ -591,7 +591,7 @@ void CDecor::ArrangeObject(POINT cel)
} }
if ( index == 2 ) if ( index == 2 )
{ {
first = 106; // barrière first = 106; // barrière
last = 112; last = 112;
} }
@ -687,7 +687,7 @@ void CDecor::ArrangeObject(POINT cel)
if ( MoveCreate(test, -1, false, CHOBJECT,-1, if ( MoveCreate(test, -1, false, CHOBJECT,-1,
-1,-1, 9999,1,0, true) ) -1,-1, 9999,1,0, true) )
{ {
MoveAddIcons(test, 5-i%2, true); // éclairs MoveAddIcons(test, 5-i%2, true); // éclairs
} }
pos = ConvCelToPos(test); pos = ConvCelToPos(test);
@ -803,7 +803,7 @@ bool CDecor::ArrangeFillTest(POINT pos)
return false; return false;
} }
// Modifie le décor lors d'un remplissage. // Modifie le décor lors d'un remplissage.
void CDecor::ArrangeFillPut(POINT pos, int channel, int icon) void CDecor::ArrangeFillPut(POINT pos, int channel, int icon)
{ {
@ -831,7 +831,7 @@ void CDecor::ArrangeFillPut(POINT pos, int channel, int icon)
} }
} }
// Rempli un sol à partir d'une position donnée. // Rempli un sol à partir d'une position donnée.
void CDecor::ArrangeFillSearch(POINT pos) void CDecor::ArrangeFillSearch(POINT pos)
{ {
@ -854,7 +854,7 @@ void CDecor::ArrangeFillSearch(POINT pos)
} }
endX = pos.x-2; endX = pos.x-2;
// Rempli toute la ligne trouvée. // Rempli toute la ligne trouvée.
pos.x = startX; pos.x = startX;
while ( pos.x <= endX ) while ( pos.x <= endX )
{ {
@ -877,7 +877,7 @@ void CDecor::ArrangeFillSearch(POINT pos)
if ( ArrangeFillTest(pos) ) if ( ArrangeFillTest(pos) )
{ {
ArrangeFillSearch(pos); // appel récursif ArrangeFillSearch(pos); // appel récursif
} }
while ( pos.x <= endX && ArrangeFillTest(pos) ) while ( pos.x <= endX && ArrangeFillTest(pos) )
@ -903,7 +903,7 @@ void CDecor::ArrangeFillSearch(POINT pos)
if ( ArrangeFillTest(pos) ) if ( ArrangeFillTest(pos) )
{ {
ArrangeFillSearch(pos); // appel récursif ArrangeFillSearch(pos); // appel récursif
} }
while ( pos.x <= endX && ArrangeFillTest(pos) ) while ( pos.x <= endX && ArrangeFillTest(pos) )
@ -914,7 +914,7 @@ void CDecor::ArrangeFillSearch(POINT pos)
} }
} }
// Rempli un sol à partir d'une position donnée. // Rempli un sol à partir d'une position donnée.
void CDecor::ArrangeFill(POINT pos, int channel, int icon, bool bFloor) void CDecor::ArrangeFill(POINT pos, int channel, int icon, bool bFloor)
{ {
@ -956,7 +956,7 @@ void CDecor::ArrangeFill(POINT pos, int channel, int icon, bool bFloor)
} }
// Supprime tous les personnages bloqués dans des murs // Supprime tous les personnages bloqués dans des murs
// ou debout sur l'eau. // ou debout sur l'eau.
void CDecor::ArrangeBlupi() void CDecor::ArrangeBlupi()

View File

@ -17,7 +17,7 @@
#include "misc.h" #include "misc.h"
// D<EFBFBD>finitions globales // D�finitions globales
#define NAME "Blupi" #define NAME "Blupi"
#define TITLE "Blupi" #define TITLE "Blupi"
@ -44,7 +44,7 @@ unsigned int g_lastPhase = 999;
// Lit un num<EFBFBD>ro d<>cimal. // Lit un num�ro d�cimal.
int GetNum(char *p) int GetNum(char *p)
{ {
@ -111,7 +111,7 @@ bool ReadConfig(int argc, char *argv[])
} }
// Mise <EFBFBD> jour principale. // Mise � jour principale.
void UpdateFrame(void) void UpdateFrame(void)
{ {
@ -149,7 +149,7 @@ void UpdateFrame(void)
if ( g_pEvent->IsShift() ) // shift en cours ? if ( g_pEvent->IsShift() ) // shift en cours ?
{ {
g_pEvent->DecorAutoShift(posMouse); g_pEvent->DecorAutoShift(posMouse);
g_pDecor->Build(clip, posMouse); // construit juste le d<EFBFBD>cor g_pDecor->Build(clip, posMouse); // construit juste le d�cor
} }
else else
{ {
@ -159,13 +159,13 @@ void UpdateFrame(void)
for ( i=0 ; i<speed ; i++ ) for ( i=0 ; i<speed ; i++ )
{ {
g_pDecor->BlupiStep(i==0); // avance tous les blupi g_pDecor->BlupiStep(i==0); // avance tous les blupi
g_pDecor->MoveStep(i==0); // avance tous les d<EFBFBD>cors g_pDecor->MoveStep(i==0); // avance tous les d�cors
g_pEvent->DemoStep(); // avance enregistrement/reproduction g_pEvent->DemoStep(); // avance enregistrement/reproduction
} }
} }
g_pEvent->DecorAutoShift(posMouse); g_pEvent->DecorAutoShift(posMouse);
g_pDecor->Build(clip, posMouse); // construit le d<EFBFBD>cor g_pDecor->Build(clip, posMouse); // construit le d�cor
g_pDecor->NextPhase(1); // refait la carte de temps en temps g_pDecor->NextPhase(1); // refait la carte de temps en temps
} }
} }
@ -177,13 +177,13 @@ void UpdateFrame(void)
clip.right = POSDRAWX+DIMDRAWX; clip.right = POSDRAWX+DIMDRAWX;
clip.bottom = POSDRAWY+DIMDRAWY; clip.bottom = POSDRAWY+DIMDRAWY;
g_pEvent->DecorAutoShift(posMouse); g_pEvent->DecorAutoShift(posMouse);
g_pDecor->Build(clip, posMouse); // construit le d<EFBFBD>cor g_pDecor->Build(clip, posMouse); // construit le d�cor
g_pDecor->NextPhase(-1); // refait la carte chaque fois g_pDecor->NextPhase(-1); // refait la carte chaque fois
} }
if ( phase == WM_PHASE_INIT ) if ( phase == WM_PHASE_INIT )
{ {
g_pEvent->DemoStep(); // d<EFBFBD>marre <20>v. d<>mo automatique g_pEvent->DemoStep(); // d�marre �v. d�mo automatique
} }
g_pEvent->DrawButtons(); g_pEvent->DrawButtons();
@ -196,7 +196,7 @@ void UpdateFrame(void)
phase == WM_PHASE_PLAYMOVIE || phase == WM_PHASE_PLAYMOVIE ||
phase == WM_PHASE_WINMOVIE ) phase == WM_PHASE_WINMOVIE )
{ {
g_pEvent->MovieToStart(); // fait d<EFBFBD>marrer un film si n<>cessaire g_pEvent->MovieToStart(); // fait d�marrer un film si n�cessaire
} }
if ( phase == WM_PHASE_INSERT ) if ( phase == WM_PHASE_INSERT )
@ -208,7 +208,7 @@ void UpdateFrame(void)
{ {
term = g_pDecor->IsTerminated(); term = g_pDecor->IsTerminated();
if ( term == 1 ) g_pEvent->ChangePhase(WM_PHASE_LOST); // perdu if ( term == 1 ) g_pEvent->ChangePhase(WM_PHASE_LOST); // perdu
if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagn<EFBFBD> if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagn�
} }
} }
@ -232,7 +232,7 @@ void Benchmark()
} }
// Restitue le jeu apr<EFBFBD>s une activation en mode fullScreen. // Restitue le jeu apr�s une activation en mode fullScreen.
bool RestoreGame() bool RestoreGame()
{ {
@ -242,7 +242,7 @@ bool RestoreGame()
return true; return true;
} }
// Lib<EFBFBD>re le jeu avant une d<>sactivation en mode fullScreen. // Lib�re le jeu avant une d�sactivation en mode fullScreen.
bool FlushGame() bool FlushGame()
{ {
@ -449,7 +449,7 @@ static bool DoInit(int argc, char *argv[])
return InitFail("Game not correctly installed", false); return InitFail("Game not correctly installed", false);
} }
// Cr<EFBFBD>e le pixmap principal. // Cr�e le pixmap principal.
g_pPixmap = new CPixmap; g_pPixmap = new CPixmap;
if ( g_pPixmap == nullptr ) return InitFail("New pixmap", true); if ( g_pPixmap == nullptr ) return InitFail("New pixmap", true);
@ -569,7 +569,7 @@ static bool DoInit(int argc, char *argv[])
g_pPixmap->LoadCursors (); g_pPixmap->LoadCursors ();
g_pPixmap->ChangeSprite (SPRITE_WAIT); // met le sablier maison g_pPixmap->ChangeSprite (SPRITE_WAIT); // met le sablier maison
// Cr<EFBFBD>e le gestionnaire de son. // Cr�e le gestionnaire de son.
g_pSound = new CSound; g_pSound = new CSound;
if ( g_pSound == nullptr ) return InitFail("New sound", true); if ( g_pSound == nullptr ) return InitFail("New sound", true);
@ -577,20 +577,20 @@ static bool DoInit(int argc, char *argv[])
g_pSound->CacheAll(); g_pSound->CacheAll();
g_pSound->SetState(true); g_pSound->SetState(true);
// Cr<EFBFBD>e le gestionnaire de films. // Cr�e le gestionnaire de films.
g_pMovie = new CMovie; g_pMovie = new CMovie;
if ( g_pMovie == nullptr ) return InitFail("New movie", false); if ( g_pMovie == nullptr ) return InitFail("New movie", false);
g_pMovie->Create(); g_pMovie->Create();
// Cr<EFBFBD>e le gestionnaire de d<>cors. // Cr�e le gestionnaire de d�cors.
g_pDecor = new CDecor; g_pDecor = new CDecor;
if ( g_pDecor == nullptr ) return InitFail("New decor", false); if ( g_pDecor == nullptr ) return InitFail("New decor", false);
g_pDecor->Create(g_pSound, g_pPixmap); g_pDecor->Create(g_pSound, g_pPixmap);
g_pDecor->MapInitColors(); g_pDecor->MapInitColors();
// Cr<EFBFBD>e le gestionnaire d'<27>v<EFBFBD>nements. // Cr�e le gestionnaire d'�v�nements.
g_pEvent = new CEvent; g_pEvent = new CEvent;
if ( g_pEvent == nullptr ) return InitFail("New event", false); if ( g_pEvent == nullptr ) return InitFail("New event", false);
@ -603,7 +603,7 @@ static bool DoInit(int argc, char *argv[])
g_pEvent->ChangePhase(WM_PHASE_TESTCD); g_pEvent->ChangePhase(WM_PHASE_TESTCD);
#endif #endif
g_bTermInit = true; // initialisation termin<EFBFBD>e g_bTermInit = true; // initialisation termin�e
return true; return true;
} }

View File

@ -40,7 +40,7 @@ CButton::~CButton()
} }
// Crée un nouveau bouton. // Crée un nouveau bouton.
bool CButton::Create(CPixmap *pPixmap, CSound *pSound, bool CButton::Create(CPixmap *pPixmap, CSound *pSound,
POINT pos, int type, bool bMinimizeRedraw, POINT pos, int type, bool bMinimizeRedraw,
@ -118,7 +118,7 @@ bool CButton::Create(CPixmap *pPixmap, CSound *pSound,
return true; return true;
} }
// Dessine un bouton dans son état. // Dessine un bouton dans son état.
void CButton::Draw() void CButton::Draw()
{ {
@ -129,7 +129,7 @@ void CButton::Draw()
if ( m_bMinimizeRedraw && !m_bRedraw ) return; if ( m_bMinimizeRedraw && !m_bRedraw ) return;
m_bRedraw = false; m_bRedraw = false;
if ( m_bHide ) // bouton caché ? if ( m_bHide ) // bouton caché ?
{ {
rect.left = m_pos.x; rect.left = m_pos.x;
rect.right = m_pos.x+m_dim.x; rect.right = m_pos.x+m_dim.x;
@ -239,7 +239,7 @@ void CButton::SetHide(bool bHide)
} }
// Traitement d'un événement. // Traitement d'un événement.
bool CButton::TreatEvent(const SDL_Event &event) bool CButton::TreatEvent(const SDL_Event &event)
{ {
@ -281,7 +281,7 @@ bool CButton::TreatEvent(const SDL_Event &event)
return false; return false;
} }
// (*) Tous les boutons doivent recevoir l'événement BUTTONUP ! // (*) Tous les boutons doivent recevoir l'événement BUTTONUP !
// Indique si la souris est sur ce bouton. // Indique si la souris est sur ce bouton.
@ -303,7 +303,7 @@ const char *CButton::GetToolTips(POINT pos)
if (m_bHide || !m_bEnable) if (m_bHide || !m_bEnable)
return nullptr; return nullptr;
if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ? if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ?
{ {
width += 2+(m_dim.x-1)*m_nbMenu; width += 2+(m_dim.x-1)*m_nbMenu;
} }
@ -335,7 +335,7 @@ const char *CButton::GetToolTips(POINT pos)
} }
// Détecte si la souris est dans le bouton. // Détecte si la souris est dans le bouton.
bool CButton::Detect(POINT pos) bool CButton::Detect(POINT pos)
{ {
@ -343,7 +343,7 @@ bool CButton::Detect(POINT pos)
if ( m_bHide || !m_bEnable ) return false; if ( m_bHide || !m_bEnable ) return false;
if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ? if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ?
{ {
width += 2+(m_dim.x-1)*m_nbMenu; width += 2+(m_dim.x-1)*m_nbMenu;
} }
@ -356,7 +356,7 @@ bool CButton::Detect(POINT pos)
return true; return true;
} }
// Bouton de la souris pressé. // Bouton de la souris pressé.
bool CButton::MouseDown(POINT pos) bool CButton::MouseDown(POINT pos)
{ {
@ -371,7 +371,7 @@ bool CButton::MouseDown(POINT pos)
return true; return true;
} }
// Souris déplacés. // Souris déplacés.
bool CButton::MouseMove(POINT pos) bool CButton::MouseMove(POINT pos)
{ {
@ -385,12 +385,12 @@ bool CButton::MouseMove(POINT pos)
if ( m_bMouseDown ) if ( m_bMouseDown )
{ {
if ( bDetect ) m_mouseState = 1; // pressé if ( bDetect ) m_mouseState = 1; // pressé
else m_mouseState = m_state; else m_mouseState = m_state;
} }
else else
{ {
if ( bDetect ) m_mouseState = m_state+2; // survollé if ( bDetect ) m_mouseState = m_state+2; // survollé
else m_mouseState = m_state; else m_mouseState = m_state;
} }
@ -415,7 +415,7 @@ bool CButton::MouseMove(POINT pos)
return m_bMouseDown; return m_bMouseDown;
} }
// Bouton de la souris relâché. // Bouton de la souris relâché.
bool CButton::MouseUp(POINT pos) bool CButton::MouseUp(POINT pos)
{ {

View File

@ -49,20 +49,20 @@ protected:
CSound* m_pSound; CSound* m_pSound;
int m_type; // type de bouton int m_type; // type de bouton
bool m_bEnable; // true si bouton actif bool m_bEnable; // true si bouton actif
bool m_bHide; // true si bouton caché bool m_bHide; // true si bouton caché
unsigned int m_message; // message envoyé si bouton actionné unsigned int m_message; // message envoyé si bouton actionné
POINT m_pos; // coin sup/gauche POINT m_pos; // coin sup/gauche
POINT m_dim; // dimensions POINT m_dim; // dimensions
int m_state; // 0=relâché, 1=pressé, +2=survollé int m_state; // 0=relâché, 1=pressé, +2=survollé
int m_mouseState; // 0=relâché, 1=pressé, +2=survollé int m_mouseState; // 0=relâché, 1=pressé, +2=survollé
int m_iconMenu[20]; // icônes du sous-menu int m_iconMenu[20]; // icônes du sous-menu
const char **m_toolTips; // info-bulles const char **m_toolTips; // info-bulles
int m_nbMenu; // nb de case du sous-menu int m_nbMenu; // nb de case du sous-menu
int m_nbToolTips; // nb d'info-bulles int m_nbToolTips; // nb d'info-bulles
int m_selMenu; // sous-menu sélectionné int m_selMenu; // sous-menu sélectionné
bool m_bMouseDown; // true -> bouton souris pressé bool m_bMouseDown; // true -> bouton souris pressé
bool m_bMinimizeRedraw; bool m_bMinimizeRedraw;
bool m_bRedraw; // true -> doit être redessiné bool m_bRedraw; // true -> doit être redessiné
}; };
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View File

@ -6,7 +6,7 @@
#include "fifo.h" #include "fifo.h"
#include "action.h" #include "action.h"
// Mémorise toutes les positions des blupi. // Mémorise toutes les positions des blupi.
void CDecor::CheminMemPos(int exRank) void CDecor::CheminMemPos(int exRank)
{ {
@ -17,7 +17,7 @@ void CDecor::CheminMemPos(int exRank)
for ( rank=0 ; rank<MAXBLUPI ; rank++ ) for ( rank=0 ; rank<MAXBLUPI ; rank++ )
{ {
if ( m_blupi[rank].bExist && if ( m_blupi[rank].bExist &&
m_blupi[rank].perso != 6 && // pas le détonnateur de mine m_blupi[rank].perso != 6 && // pas le détonnateur de mine
rank != exRank ) rank != exRank )
{ {
m_cheminPos[index] = m_blupi[rank].cel; m_cheminPos[index] = m_blupi[rank].cel;
@ -37,7 +37,7 @@ void CDecor::CheminMemPos(int exRank)
} }
} }
// Teste si une positiion est occupée par un blupi. // Teste si une positiion est occupée par un blupi.
bool CDecor::CheminTestPos(POINT pos, int &rank) bool CDecor::CheminTestPos(POINT pos, int &rank)
{ {
@ -57,10 +57,10 @@ bool CDecor::CheminTestPos(POINT pos, int &rank)
} }
// une fois le but trouvé, reprend en arrière // une fois le but trouvé, reprend en arrière
// à la recherche du chemin le plus court // à la recherche du chemin le plus court
// retourne la direction à prendre // retourne la direction à prendre
int CDecor::CheminARebours(int rank) int CDecor::CheminARebours(int rank)
{ {
int pos, rebours, last, dir, set; int pos, rebours, last, dir, set;
@ -99,9 +99,9 @@ int CDecor::CheminARebours(int rank)
} }
// troisième méthode de recherche // troisième méthode de recherche
// semblable à la précédente, // semblable à la précédente,
// mais les points à explorer sont classés selon leur distance à la cible // mais les points à explorer sont classés selon leur distance à la cible
void CDecor::CheminFillTerrain(int rank) void CDecor::CheminFillTerrain(int rank)
{ {
@ -118,10 +118,10 @@ void CDecor::CheminFillTerrain(int rank)
CPileTriee fifo(2*MAXCELX+2*MAXCELY); // les variantes possibles CPileTriee fifo(2*MAXCELX+2*MAXCELY); // les variantes possibles
fifo.put(pos, 0); // position de départ fifo.put(pos, 0); // position de départ
m_cheminWork[pos] = 1; // première position m_cheminWork[pos] = 1; // première position
// répète jusqu'à trouvé ou plus de possibilités // répète jusqu'à trouvé ou plus de possibilités
max = 500; max = 500;
while ( max-- > 0 ) while ( max-- > 0 )
{ {
@ -131,11 +131,11 @@ void CDecor::CheminFillTerrain(int rank)
step = m_cheminWork[pos]; step = m_cheminWork[pos];
// on est arrivé au but ? // on est arrivé au but ?
//? if ( pos == dest ) return; //? if ( pos == dest ) return;
if ( pos == dest ) if ( pos == dest )
{ {
but = step; // hélas trop lent ! but = step; // hélas trop lent !
max = 50; max = 50;
} }
@ -153,7 +153,7 @@ void CDecor::CheminFillTerrain(int rank)
if ( m_cheminWork[last] == 0 || if ( m_cheminWork[last] == 0 ||
m_cheminWork[last] > step+cout ) m_cheminWork[last] > step+cout )
{ {
// marque les cases sautées // marque les cases sautées
for (int i=1; i<ampli;i++) for (int i=1; i<ampli;i++)
{ {
m_cheminWork[pos+i*next] = step+cout-ampli+i; m_cheminWork[pos+i*next] = step+cout-ampli+i;
@ -175,10 +175,10 @@ void CDecor::CheminFillTerrain(int rank)
} }
// routine déterninant si une direction est possible // routine déterninant si une direction est possible
// retourne l'incrément pour passer à la nouvelle case // retourne l'incrément pour passer à la nouvelle case
// et le "prix à payer" pour aller dans cette direction // et le "prix à payer" pour aller dans cette direction
// coût doit être déterminé en sortie // coût doit être déterminé en sortie
bool CDecor::CheminTestDirection(int rank, int pos, int dir, bool CDecor::CheminTestDirection(int rank, int pos, int dir,
int &next, int &ampli, int &next, int &ampli,
@ -196,25 +196,25 @@ bool CDecor::CheminTestDirection(int rank, int pos, int dir,
// Peut-on glisser dans cette direction ? // Peut-on glisser dans cette direction ?
bFree = IsFreeGlisse(cel, tryDirect, rank, action); bFree = IsFreeGlisse(cel, tryDirect, rank, action);
cout = 5; // coût élevé cout = 5; // coût élevé
if ( !bFree ) if ( !bFree )
{ {
// Peut-on marcher normalement ? // Peut-on marcher normalement ?
bFree = IsFreeDirect(cel, tryDirect, rank); bFree = IsFreeDirect(cel, tryDirect, rank);
action = ACTION_MARCHE; action = ACTION_MARCHE;
cout = 1; // coût minimal cout = 1; // coût minimal
} }
if ( !bFree ) if ( !bFree )
{ {
// Peut-on sauter ? // Peut-on sauter ?
bFree = IsFreeJump(cel, tryDirect, rank, action); bFree = IsFreeJump(cel, tryDirect, rank, action);
cout = 3; // coût élevé cout = 3; // coût élevé
} }
ampli = GetAmplitude(action); // a <- amplitude (1..5) ampli = GetAmplitude(action); // a <- amplitude (1..5)
cout *= ampli; // coût plus élevé si grande amplitude cout *= ampli; // coût plus élevé si grande amplitude
// Blupi peut aller sur le lieu de la construction. // Blupi peut aller sur le lieu de la construction.
if ( !bFree && m_blupi[rank].passCel.x != -1 ) if ( !bFree && m_blupi[rank].passCel.x != -1 )
@ -234,12 +234,12 @@ bool CDecor::CheminTestDirection(int rank, int pos, int dir,
if ( bFree ) // chemin libre (sans tenir compte des perso) ? if ( bFree ) // chemin libre (sans tenir compte des perso) ?
{ {
newCel.x = cel.x + vector.x*ampli; newCel.x = cel.x + vector.x*ampli;
newCel.y = cel.y + vector.y*ampli; // newCel <- arrivée suposée newCel.y = cel.y + vector.y*ampli; // newCel <- arrivée suposée
if ( m_blupi[rank].perso == 3 ) // tracks ? if ( m_blupi[rank].perso == 3 ) // tracks ?
{ {
// Le tracks peut aller sur les blupi // Le tracks peut aller sur les blupi
// pour les écraser ! // pour les écraser !
if ( IsTracksHere(newCel, false) ) // autre perso ici ? if ( IsTracksHere(newCel, false) ) // autre perso ici ?
{ {
return false; return false;
@ -254,7 +254,7 @@ bool CDecor::CheminTestDirection(int rank, int pos, int dir,
//? if ( m_blupi[m_blupiHere].goalCel.x == -1 ) return false; //? if ( m_blupi[m_blupiHere].goalCel.x == -1 ) return false;
if ( m_blupi[rankHere].goalCel.x == -1 ) return false; if ( m_blupi[rankHere].goalCel.x == -1 ) return false;
// Si blupi mobile, possible mais coût élevé. // Si blupi mobile, possible mais coût élevé.
cout = 20; cout = 20;
} }
} }
@ -267,20 +267,20 @@ bool CDecor::CheminTestDirection(int rank, int pos, int dir,
// Retourne true si on a assigné une nouvelle direction à blupi. // Retourne true si on a assigné une nouvelle direction à blupi.
bool CDecor::CheminCherche(int rank, int &action) bool CDecor::CheminCherche(int rank, int &action)
{ {
int cout; // prix pour aller dans une direction int cout; // prix pour aller dans une direction
int pos, dir, next, ampli; int pos, dir, next, ampli;
// Déjà à destination ? // Déjà à destination ?
if ( m_blupi[rank].cel.x == m_blupi[rank].goalCel.x && if ( m_blupi[rank].cel.x == m_blupi[rank].goalCel.x &&
m_blupi[rank].cel.y == m_blupi[rank].goalCel.y ) m_blupi[rank].cel.y == m_blupi[rank].goalCel.y )
{ {
return false; return false;
} }
// Destination occupée ? // Destination occupée ?
if ( IsBlupiHereEx(m_blupi[rank].goalCel, rank, false) ) if ( IsBlupiHereEx(m_blupi[rank].goalCel, rank, false) )
{ {
return false; return false;
@ -290,10 +290,10 @@ bool CDecor::CheminCherche(int rank, int &action)
CheminMemPos(rank); CheminMemPos(rank);
// fait un remplissage du map de travail // fait un remplissage du map de travail
// autour du point de départ // autour du point de départ
CheminFillTerrain(rank); CheminFillTerrain(rank);
// cherche le chemin à partir de la destination // cherche le chemin à partir de la destination
dir = CheminARebours(rank); dir = CheminARebours(rank);
if ( dir < 0 ) return false; if ( dir < 0 ) return false;
@ -310,7 +310,7 @@ bool CDecor::CheminCherche(int rank, int &action)
} }
// Teste s'il est possible de se rendre à un endroit donné. // Teste s'il est possible de se rendre à un endroit donné.
bool CDecor::IsCheminFree(int rank, POINT dest, int button) bool CDecor::IsCheminFree(int rank, POINT dest, int button)
{ {
@ -338,7 +338,7 @@ bool CDecor::IsCheminFree(int rank, POINT dest, int button)
m_decor[dest.x/2][dest.y/2].objectIcon == 16 ) && // armure ? m_decor[dest.x/2][dest.y/2].objectIcon == 16 ) && // armure ?
dest.x%2 == 1 && dest.y%2 == 1 ) dest.x%2 == 1 && dest.y%2 == 1 )
{ {
dest.y --; // va à côté jeep/armure dest.y --; // va à côté jeep/armure
} }
if ( button == BUTTON_GO && if ( button == BUTTON_GO &&
m_decor[dest.x/2][dest.y/2].objectChannel == CHOBJECT && m_decor[dest.x/2][dest.y/2].objectChannel == CHOBJECT &&

File diff suppressed because it is too large Load Diff

View File

@ -614,7 +614,7 @@ static short table_goal_build1[] =
GOAL_GOBLUPI, +1,0, true, GOAL_GOBLUPI, +1,0, true,
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
//? GOAL_ENERGY, MAXENERGY/4, //? GOAL_ENERGY, MAXENERGY/4,
// échaffaudage // échaffaudage
GOAL_BUILDOBJECT, -1,0, CHOBJECT,62, -1,-1, DIMOBJY/10,18,10*100, GOAL_BUILDOBJECT, -1,0, CHOBJECT,62, -1,-1, DIMOBJY/10,18,10*100,
GOAL_ACTION, ACTION_SCIE, DIRECT_S, GOAL_ACTION, ACTION_SCIE, DIRECT_S,
GOAL_GOBLUPI, 0,-1, true, GOAL_GOBLUPI, 0,-1, true,
@ -663,7 +663,7 @@ static short table_goal_build2[] =
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
GOAL_GOBLUPI, +1,0, true, GOAL_GOBLUPI, +1,0, true,
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les planches GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les planches
GOAL_GOBLUPI, -1,+1, true, GOAL_GOBLUPI, -1,+1, true,
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S, GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
GOAL_GOBLUPI, +1,0, true, GOAL_GOBLUPI, +1,0, true,
@ -726,7 +726,7 @@ static short table_goal_build4[] =
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_WORK, 0,-1, GOAL_WORK, 0,-1,
// échaffaudage // échaffaudage
GOAL_BUILDOBJECT, 0,-1, CHOBJECT,126, -1,-1, DIMOBJY/10,18,10*100, GOAL_BUILDOBJECT, 0,-1, CHOBJECT,126, -1,-1, DIMOBJY/10,18,10*100,
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S, GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
GOAL_GOBLUPI, +1,-1, true, GOAL_GOBLUPI, +1,-1, true,
@ -794,7 +794,7 @@ static short table_goal_build5[] =
0 0
}; };
// Construction d'un téléporteur. // Construction d'un téléporteur.
static short table_goal_build6[] = static short table_goal_build6[] =
{ {
WM_ACTION_BUILD6, WM_ACTION_BUILD6,
@ -804,7 +804,7 @@ static short table_goal_build6[] =
GOAL_GROUP, 3, GOAL_GROUP, 3,
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_WORK, 0,-1, GOAL_WORK, 0,-1,
GOAL_BUILDFLOOR, 0,-1, CHFLOOR,80, CHMASK1,0, 16,14,1*100, // téléporteur GOAL_BUILDFLOOR, 0,-1, CHFLOOR,80, CHMASK1,0, 16,14,1*100, // téléporteur
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
GOAL_GOBLUPI, +1,-1, true, GOAL_GOBLUPI, +1,-1, true,
@ -813,7 +813,7 @@ static short table_goal_build6[] =
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
GOAL_GOBLUPI, +1,0, true, GOAL_GOBLUPI, +1,0, true,
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les planches GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les planches
GOAL_GOBLUPI, -1,+1, true, GOAL_GOBLUPI, -1,+1, true,
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S, GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
GOAL_GOBLUPI, +1,0, true, GOAL_GOBLUPI, +1,0, true,
@ -850,7 +850,7 @@ static short table_goal_mur[] =
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_PUTOBJECT, 0,0, -1,-1, // enlève les pierres GOAL_PUTOBJECT, 0,0, -1,-1, // enlève les pierres
GOAL_GOBLUPI, +1,+1, true, GOAL_GOBLUPI, +1,+1, true,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
@ -890,7 +890,7 @@ static short table_goal_tour[] =
GOAL_GOBLUPI, +1,-1, true, GOAL_GOBLUPI, +1,-1, true,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les pierres GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les pierres
GOAL_GOBLUPI, 0,+1, true, GOAL_GOBLUPI, 0,+1, true,
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O, GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O,
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
@ -924,7 +924,7 @@ static short table_goal_palis[] =
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
GOAL_GOBLUPI, 0,-1, true, GOAL_GOBLUPI, 0,-1, true,
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E, GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
GOAL_PUTOBJECT, 0,0, -1,-1, // enlève les planches GOAL_PUTOBJECT, 0,0, -1,-1, // enlève les planches
GOAL_GOBLUPI, +1,+1, true, GOAL_GOBLUPI, +1,+1, true,
GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_E, GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_E,
GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_E, GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_E,
@ -983,7 +983,7 @@ static short table_goal_depose[] =
GOAL_IFTERM, +1,0, // emplacement libre ? GOAL_IFTERM, +1,0, // emplacement libre ?
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_WORK, 0,-1, GOAL_WORK, 0,-1,
GOAL_PUTOBJECT, 0,-1, -3,-3, // l'objet transporté GOAL_PUTOBJECT, 0,-1, -3,-3, // l'objet transporté
GOAL_BUILDOBJECT, 0,-1, -2,-2, -1,-1, 11,1,1*100, GOAL_BUILDOBJECT, 0,-1, -2,-2, -1,-1, 11,1,1*100,
GOAL_ADDMOVES, 0,-1, 4, GOAL_ADDMOVES, 0,-1, 4,
GOAL_DEPOSE, GOAL_DEPOSE,
@ -1003,7 +1003,7 @@ static short table_goal_depose2[] =
GOAL_IFTERM, 0,+1, // emplacement libre ? GOAL_IFTERM, 0,+1, // emplacement libre ?
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_WORK, -1,0, GOAL_WORK, -1,0,
GOAL_PUTOBJECT, -1,0, -3,-3, // l'objet transporté GOAL_PUTOBJECT, -1,0, -3,-3, // l'objet transporté
GOAL_BUILDOBJECT, -1,0, -2,-2, -1,-1, 11,1,1*100, GOAL_BUILDOBJECT, -1,0, -2,-2, -1,-1, 11,1,1*100,
GOAL_ADDMOVES, -1,0, 5, GOAL_ADDMOVES, -1,0, 5,
GOAL_DEPOSE, GOAL_DEPOSE,
@ -1022,7 +1022,7 @@ static short table_goal_newblupi[] =
GOAL_GROUP, 5, GOAL_GROUP, 5,
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_WORK, 0,-1, GOAL_WORK, 0,-1,
GOAL_PUTOBJECT, 0,-1, -3,-3, // l'objet transporté GOAL_PUTOBJECT, 0,-1, -3,-3, // l'objet transporté
GOAL_BUILDOBJECT, 0,-1, -2,-2, -1,-1, 11,1,1*100, GOAL_BUILDOBJECT, 0,-1, -2,-2, -1,-1, 11,1,1*100,
GOAL_ADDMOVES, 0,-1, 4, GOAL_ADDMOVES, 0,-1, 4,
GOAL_DEPOSE, GOAL_DEPOSE,
@ -1159,7 +1159,7 @@ static short table_goal_mange2[] =
0 0
}; };
// Boit à la bouteille (est). // Boit à la bouteille (est).
static short table_goal_boit[] = static short table_goal_boit[] =
{ {
WM_ACTION_BOIT, WM_ACTION_BOIT,
@ -1178,7 +1178,7 @@ static short table_goal_boit[] =
0 0
}; };
// Boit à la bouteille (sud). // Boit à la bouteille (sud).
static short table_goal_boit2[] = static short table_goal_boit2[] =
{ {
WM_ACTION_BOIT2, WM_ACTION_BOIT2,
@ -1323,7 +1323,7 @@ static short table_goal_labo[] =
0 0
}; };
// Blupi fait péter la dynamite. // Blupi fait péter la dynamite.
static short table_goal_dynamite[] = static short table_goal_dynamite[] =
{ {
WM_ACTION_DYNAMITE, WM_ACTION_DYNAMITE,
@ -1335,7 +1335,7 @@ static short table_goal_dynamite[] =
GOAL_WORK, 0,-1, GOAL_WORK, 0,-1,
GOAL_PUTOBJECT, 0,-1, -1,-1, GOAL_PUTOBJECT, 0,-1, -1,-1,
GOAL_BUILDOBJECT, 0,-1, CHOBJECT,-1, -1,-1, DIMOBJY,1,-1*100, GOAL_BUILDOBJECT, 0,-1, CHOBJECT,-1, -1,-1, DIMOBJY,1,-1*100,
GOAL_ADDICONS, 0,-1, 7, // mèche GOAL_ADDICONS, 0,-1, 7, // mèche
GOAL_ACTION, ACTION_MECHE, DIRECT_E, GOAL_ACTION, ACTION_MECHE, DIRECT_E,
GOAL_SOUND, SOUND_DYNAMITE, GOAL_SOUND, SOUND_DYNAMITE,
GOAL_GROUP, 4, GOAL_GROUP, 4,
@ -1373,7 +1373,7 @@ static short table_goal_dynamite[] =
0 0
}; };
// Blupi fait péter la dynamite très fort. // Blupi fait péter la dynamite très fort.
static short table_goal_dynamite2[] = static short table_goal_dynamite2[] =
{ {
WM_ACTION_DYNAMITE2, WM_ACTION_DYNAMITE2,
@ -1385,7 +1385,7 @@ static short table_goal_dynamite2[] =
GOAL_WORK, 0,-1, GOAL_WORK, 0,-1,
GOAL_PUTOBJECT, 0,-1, -1,-1, GOAL_PUTOBJECT, 0,-1, -1,-1,
GOAL_BUILDOBJECT, 0,-1, CHOBJECT,-1, -1,-1, DIMOBJY,1,-1*100, GOAL_BUILDOBJECT, 0,-1, CHOBJECT,-1, -1,-1, DIMOBJY,1,-1*100,
GOAL_ADDICONS, 0,-1, 7, // mèche GOAL_ADDICONS, 0,-1, 7, // mèche
GOAL_ACTION, ACTION_MECHE, DIRECT_E, GOAL_ACTION, ACTION_MECHE, DIRECT_E,
GOAL_SOUND, SOUND_DYNAMITE, GOAL_SOUND, SOUND_DYNAMITE,
GOAL_GROUP, 5, GOAL_GROUP, 5,
@ -1486,7 +1486,7 @@ static short table_goal_dynamite2[] =
0 0
}; };
// Tracks fait péter la dynamite. // Tracks fait péter la dynamite.
static short table_goal_t_dynamite[] = static short table_goal_t_dynamite[] =
{ {
WM_ACTION_T_DYNAMITE, WM_ACTION_T_DYNAMITE,
@ -1548,7 +1548,7 @@ static short table_goal_mine[] =
0 0
}; };
// Détonnateur de mine créé par GOAL_AMORCE (blupi invisible). // Détonnateur de mine créé par GOAL_AMORCE (blupi invisible).
static short table_goal_mine2[] = static short table_goal_mine2[] =
{ {
WM_ACTION_MINE2, WM_ACTION_MINE2,
@ -2006,7 +2006,7 @@ static short table_goal_bateaun[] =
0 0
}; };
// Départ en bateau. // Départ en bateau.
static short table_goal_bateaude[] = static short table_goal_bateaude[] =
{ {
WM_ACTION_BATEAUDE, WM_ACTION_BATEAUDE,
@ -2023,7 +2023,7 @@ static short table_goal_bateaude[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
GOAL_VEHICULE, 1, // en bateau GOAL_VEHICULE, 1, // en bateau
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GOBLUPI, +1,0, true, GOAL_GOBLUPI, +1,0, true,
@ -2047,7 +2047,7 @@ static short table_goal_bateauds[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
GOAL_VEHICULE, 1, // en bateau GOAL_VEHICULE, 1, // en bateau
GOAL_GOBLUPI, 0,+1, true, GOAL_GOBLUPI, 0,+1, true,
GOAL_TERM, GOAL_TERM,
@ -2070,7 +2070,7 @@ static short table_goal_bateaudo[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
GOAL_VEHICULE, 1, // en bateau GOAL_VEHICULE, 1, // en bateau
GOAL_GOBLUPI, -1,0, true, GOAL_GOBLUPI, -1,0, true,
GOAL_TERM, GOAL_TERM,
@ -2093,14 +2093,14 @@ static short table_goal_bateaudn[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
GOAL_VEHICULE, 1, // en bateau GOAL_VEHICULE, 1, // en bateau
GOAL_GOBLUPI, 0,-1, true, GOAL_GOBLUPI, 0,-1, true,
GOAL_TERM, GOAL_TERM,
0 0
}; };
// Arrivée en bateau. // Arrivée en bateau.
static short table_goal_bateauae[] = static short table_goal_bateauae[] =
{ {
WM_ACTION_BATEAUAE, WM_ACTION_BATEAUAE,
@ -2114,7 +2114,7 @@ static short table_goal_bateauae[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau
GOAL_VEHICULE, 0, // à pied GOAL_VEHICULE, 0, // à pied
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
@ -2141,7 +2141,7 @@ static short table_goal_bateauas[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau
GOAL_VEHICULE, 0, // à pied GOAL_VEHICULE, 0, // à pied
GOAL_GOBLUPI, 0,-2, true, GOAL_GOBLUPI, 0,-2, true,
GOAL_TERM, GOAL_TERM,
0 0
@ -2160,7 +2160,7 @@ static short table_goal_bateauao[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau
GOAL_VEHICULE, 0, // à pied GOAL_VEHICULE, 0, // à pied
GOAL_GOBLUPI, +1,0, true, GOAL_GOBLUPI, +1,0, true,
GOAL_TERM, GOAL_TERM,
0 0
@ -2179,7 +2179,7 @@ static short table_goal_bateauan[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau
GOAL_VEHICULE, 0, // à pied GOAL_VEHICULE, 0, // à pied
GOAL_GOBLUPI, 0,+1, true, GOAL_GOBLUPI, 0,+1, true,
GOAL_TERM, GOAL_TERM,
0 0
@ -2223,7 +2223,7 @@ static short table_goal_r_build1[] =
0 0
}; };
// Le robot construit une usine à araignées. // Le robot construit une usine à araignées.
static short table_goal_r_build2[] = static short table_goal_r_build2[] =
{ {
WM_ACTION_R_BUILD2, WM_ACTION_R_BUILD2,
@ -2261,7 +2261,7 @@ static short table_goal_r_build2[] =
0 0
}; };
// Le robot construit une usine à virus. // Le robot construit une usine à virus.
static short table_goal_r_build3[] = static short table_goal_r_build3[] =
{ {
WM_ACTION_R_BUILD3, WM_ACTION_R_BUILD3,
@ -2299,7 +2299,7 @@ static short table_goal_r_build3[] =
0 0
}; };
// Le robot construit une usine à tracks. // Le robot construit une usine à tracks.
static short table_goal_r_build4[] = static short table_goal_r_build4[] =
{ {
WM_ACTION_R_BUILD4, WM_ACTION_R_BUILD4,
@ -2337,7 +2337,7 @@ static short table_goal_r_build4[] =
0 0
}; };
// Le robot construit une usine à bombe. // Le robot construit une usine à bombe.
static short table_goal_r_build5[] = static short table_goal_r_build5[] =
{ {
WM_ACTION_R_BUILD5, WM_ACTION_R_BUILD5,
@ -2375,7 +2375,7 @@ static short table_goal_r_build5[] =
0 0
}; };
// Le robot construit une usine à électro. // Le robot construit une usine à électro.
static short table_goal_r_build6[] = static short table_goal_r_build6[] =
{ {
WM_ACTION_R_BUILD6, WM_ACTION_R_BUILD6,
@ -2436,7 +2436,7 @@ static short table_goal_r_make1[] =
0 0
}; };
// Le robot construit une araignée. // Le robot construit une araignée.
static short table_goal_r_make2[] = static short table_goal_r_make2[] =
{ {
WM_ACTION_R_MAKE2, WM_ACTION_R_MAKE2,
@ -2477,7 +2477,7 @@ static short table_goal_r_make2[] =
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
GOAL_PUTOBJECT, 0,-1, CHOBJECT,101, // ouvre la porte GOAL_PUTOBJECT, 0,-1, CHOBJECT,101, // ouvre la porte
GOAL_NEWPERSO, +1,0, 1, // araignée (qui sortira) GOAL_NEWPERSO, +1,0, 1, // araignée (qui sortira)
GOAL_ACTION, ACTION_R_DELAY, DIRECT_E, GOAL_ACTION, ACTION_R_DELAY, DIRECT_E,
GOAL_ACTION, ACTION_R_DELAY, DIRECT_E, GOAL_ACTION, ACTION_R_DELAY, DIRECT_E,
GOAL_SOUND, SOUND_PORTE, GOAL_SOUND, SOUND_PORTE,
@ -2693,7 +2693,7 @@ static short table_goal_r_make5[] =
0 0
}; };
// Le robot construit un électro. // Le robot construit un électro.
static short table_goal_r_make6[] = static short table_goal_r_make6[] =
{ {
WM_ACTION_R_MAKE6, WM_ACTION_R_MAKE6,
@ -2734,7 +2734,7 @@ static short table_goal_r_make6[] =
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_FINISHMOVE, GOAL_FINISHMOVE,
GOAL_PUTOBJECT, 0,-1, CHOBJECT,18, // ouvre la porte GOAL_PUTOBJECT, 0,-1, CHOBJECT,18, // ouvre la porte
GOAL_NEWPERSO, +1,0, 7, // électro (qui sortira) GOAL_NEWPERSO, +1,0, 7, // électro (qui sortira)
GOAL_ACTION, ACTION_R_DELAY, DIRECT_E, GOAL_ACTION, ACTION_R_DELAY, DIRECT_E,
GOAL_SOUND, SOUND_PORTE, GOAL_SOUND, SOUND_PORTE,
GOAL_PUTOBJECT, 0,-1, CHOBJECT,17, // ferme la porte GOAL_PUTOBJECT, 0,-1, CHOBJECT,17, // ferme la porte
@ -2770,7 +2770,7 @@ static short table_goal_mjeep[] =
GOAL_WORK, -1,0, GOAL_WORK, -1,0,
GOAL_ACTION, ACTION_SAUTE1, DIRECT_S, GOAL_ACTION, ACTION_SAUTE1, DIRECT_S,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève la jeep GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève la jeep
GOAL_VEHICULE, 2, // en jeep GOAL_VEHICULE, 2, // en jeep
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
@ -2796,7 +2796,7 @@ static short table_goal_djeep[] =
GOAL_INTERRUPT, 0, // prioritaire GOAL_INTERRUPT, 0, // prioritaire
GOAL_WORK, -1,-1, GOAL_WORK, -1,-1,
GOAL_PUTOBJECT, -1,-1, CHOBJECT,118, // remet la jeep GOAL_PUTOBJECT, -1,-1, CHOBJECT,118, // remet la jeep
GOAL_VEHICULE, 0, // à pied GOAL_VEHICULE, 0, // à pied
GOAL_ACTUALISE, GOAL_ACTUALISE,
GOAL_ACTION, ACTION_SAUTE1, DIRECT_N, GOAL_ACTION, ACTION_SAUTE1, DIRECT_N,
GOAL_ACTION, ACTION_STOP, DIRECT_N, GOAL_ACTION, ACTION_STOP, DIRECT_N,
@ -2825,7 +2825,7 @@ static short table_goal_marmure[] =
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
GOAL_GROUP, 2, GOAL_GROUP, 2,
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève l'armure GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève l'armure
GOAL_ACTION, ACTION_ARMURECLOSE, DIRECT_E, GOAL_ACTION, ACTION_ARMURECLOSE, DIRECT_E,
GOAL_VEHICULE, 3, // en armure GOAL_VEHICULE, 3, // en armure
GOAL_ACTION, ACTION_STOP, DIRECT_E, GOAL_ACTION, ACTION_STOP, DIRECT_E,
@ -2867,13 +2867,13 @@ static short table_goal_darmure[] =
GOAL_GROUP, 3, GOAL_GROUP, 3,
GOAL_WORK, -1,-1, GOAL_WORK, -1,-1,
GOAL_PUTOBJECT, -1,-1, CHOBJECT,16, // remet l'armure GOAL_PUTOBJECT, -1,-1, CHOBJECT,16, // remet l'armure
GOAL_VEHICULE, 0, // à pied GOAL_VEHICULE, 0, // à pied
GOAL_GOBLUPI, 0,-1, true, GOAL_GOBLUPI, 0,-1, true,
GOAL_TERM, GOAL_TERM,
0 0
}; };
// Blupi cherche où planter des drapeaux. // Blupi cherche où planter des drapeaux.
static short table_goal_drapeau[] = static short table_goal_drapeau[] =
{ {
WM_ACTION_DRAPEAU, WM_ACTION_DRAPEAU,
@ -3164,7 +3164,7 @@ static short table_goal_fabdisc[] =
0 0
}; };
// L'électro va sur un blupi puis lance ses rayons. // L'électro va sur un blupi puis lance ses rayons.
static short table_goal_e_rayon[] = static short table_goal_e_rayon[] =
{ {
WM_ACTION_E_RAYON, WM_ACTION_E_RAYON,
@ -3254,7 +3254,7 @@ static short table_goal_e_rayon[] =
0 0
}; };
// Blupi s'électrocute. // Blupi s'électrocute.
static short table_goal_electro[] = static short table_goal_electro[] =
{ {
WM_ACTION_ELECTRO, WM_ACTION_ELECTRO,
@ -3307,7 +3307,7 @@ static short table_goal_grille[] =
0 0
}; };
// L'araignée meurt. // L'araignée meurt.
static short table_goal_a_mort[] = static short table_goal_a_mort[] =
{ {
WM_ACTION_A_MORT, WM_ACTION_A_MORT,
@ -3318,12 +3318,12 @@ static short table_goal_a_mort[] =
GOAL_ACTION, ACTION_A_MORT1, DIRECT_E, GOAL_ACTION, ACTION_A_MORT1, DIRECT_E,
GOAL_ACTION, ACTION_A_MORT2, DIRECT_E, GOAL_ACTION, ACTION_A_MORT2, DIRECT_E,
GOAL_ACTION, ACTION_A_MORT3, DIRECT_E, GOAL_ACTION, ACTION_A_MORT3, DIRECT_E,
GOAL_DELETE, // l'araignée meurt brutalement GOAL_DELETE, // l'araignée meurt brutalement
GOAL_TERM, GOAL_TERM,
0 0
}; };
// Blupi se prépare à répéter une liste. // Blupi se prépare à répéter une liste.
static short table_goal_repeat[] = static short table_goal_repeat[] =
{ {
WM_ACTION_REPEAT, WM_ACTION_REPEAT,
@ -3331,7 +3331,7 @@ static short table_goal_repeat[] =
0 0
}; };
// Blupi se téléporte d'un endroit à un autre. // Blupi se téléporte d'un endroit à un autre.
static short table_goal_teleporte00[] = static short table_goal_teleporte00[] =
{ {
WM_ACTION_TELEPORTE00, WM_ACTION_TELEPORTE00,
@ -3528,7 +3528,7 @@ static short* table_pGoal[] =
nullptr nullptr
}; };
// Retourne le pointeur à la table table_goal_*. // Retourne le pointeur à la table table_goal_*.
short* GetTableGoal(int action) short* GetTableGoal(int action)
{ {
@ -3538,7 +3538,7 @@ short* GetTableGoal(int action)
{ {
if ( **ppTable == action ) if ( **ppTable == action )
{ {
return *ppTable+1; // après WM_ACTION_* return *ppTable+1; // après WM_ACTION_*
} }
ppTable ++; ppTable ++;

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
// Méta opérations (goal). // Méta opérations (goal).
#define GOAL_TERM 0 // #define GOAL_TERM 0 //
#define GOAL_GOHILI 1 // dx,dy, bPass #define GOAL_GOHILI 1 // dx,dy, bPass

View File

@ -32,26 +32,26 @@ DescFile;
typedef struct typedef struct
{ {
int bExist; // true -> utilisé int bExist; // true -> utilisé
int bHili; // true -> sélectionné int bHili; // true -> sélectionné
short perso; // personnage, voir (*) short perso; // personnage, voir (*)
short goalAction; // action (long terme) short goalAction; // action (long terme)
short goalPhase; // phase (long terme) short goalPhase; // phase (long terme)
POINT goalCel; // cellule visée (long terme) POINT goalCel; // cellule visée (long terme)
POINT passCel; // cellule tranversante POINT passCel; // cellule tranversante
short energy; // énergie restante short energy; // énergie restante
POINT cel; // cellule actuelle POINT cel; // cellule actuelle
POINT destCel; // cellule destination POINT destCel; // cellule destination
short action; // action en cours short action; // action en cours
short aDirect; // direction actuelle short aDirect; // direction actuelle
short sDirect; // direction souhaitée short sDirect; // direction souhaitée
POINT pos; // position relative à partir de la cellule POINT pos; // position relative à partir de la cellule
short posZ; // déplacement z short posZ; // déplacement z
short channel; short channel;
short lastIcon; short lastIcon;
short icon; short icon;
@ -60,12 +60,12 @@ typedef struct
short interrupt; // 0=prioritaire, 1=normal, 2=misc short interrupt; // 0=prioritaire, 1=normal, 2=misc
short clipLeft; short clipLeft;
int nbUsed; // nb de points déjà visités int nbUsed; // nb de points déjà visités
char nextRankUsed; char nextRankUsed;
POINT posUsed[MAXUSED]; POINT posUsed[MAXUSED];
char rankUsed[MAXUSED]; char rankUsed[MAXUSED];
short takeChannel; // objet transporté short takeChannel; // objet transporté
short takeIcon; short takeIcon;
POINT fix; // point fixe (cultive, pont) POINT fix; // point fixe (cultive, pont)
@ -73,15 +73,15 @@ typedef struct
short jaugePhase; short jaugePhase;
short jaugeMax; short jaugeMax;
short stop; // 1 -> devra stopper short stop; // 1 -> devra stopper
short bArrow; // true -> flèche en dessus de blupi short bArrow; // true -> flèche en dessus de blupi
short bRepeat; // true -> répète l'action short bRepeat; // true -> répète l'action
short nLoop; // nb de boucles pour GOAL_OTHERLOOP short nLoop; // nb de boucles pour GOAL_OTHERLOOP
short cLoop; // boucle en cours short cLoop; // boucle en cours
short vIcon; // icône variable short vIcon; // icône variable
POINT goalHili; // but visé POINT goalHili; // but visé
short bMalade; // true -> blupi malade short bMalade; // true -> blupi malade
short bCache; // true -> caché (pas dessiné) short bCache; // true -> caché (pas dessiné)
short vehicule; // véhicule utilisé par blupi, voir (**) short vehicule; // véhicule utilisé par blupi, voir (**)
char busyCount; char busyCount;
char busyDelay; char busyDelay;
char clicCount; char clicCount;
@ -91,7 +91,7 @@ typedef struct
OldBlupi; OldBlupi;
// Sauve le décor sur disque. // Sauve le décor sur disque.
bool CDecor::Write(int rank, bool bUser, int world, int time, int total) bool CDecor::Write(int rank, bool bUser, int world, int time, int total)
{ {
@ -170,7 +170,7 @@ bool CDecor::Write(int rank, bool bUser, int world, int time, int total)
return false; return false;
} }
// Lit le décor sur disque. // Lit le décor sur disque.
bool CDecor::Read(int rank, bool bUser, int &world, int &time, int &total) bool CDecor::Read(int rank, bool bUser, int &world, int &time, int &total)
{ {
@ -297,7 +297,7 @@ bool CDecor::Read(int rank, bool bUser, int &world, int &time, int &total)
InitDrapeau(); InitDrapeau();
} }
BlupiDeselect(); // désélectionne tous les blupi BlupiDeselect(); // désélectionne tous les blupi
free(pBuffer); free(pBuffer);
fclose(file); fclose(file);
@ -307,7 +307,7 @@ bool CDecor::Read(int rank, bool bUser, int &world, int &time, int &total)
if ( pBuffer != nullptr ) free(pBuffer); if ( pBuffer != nullptr ) free(pBuffer);
if ( file != nullptr ) fclose(file); if ( file != nullptr ) fclose(file);
Flush(); // initialise un décor neutre Flush(); // initialise un décor neutre
return false; return false;
} }
@ -381,7 +381,7 @@ bool CDecor::FileExist(int rank, bool bUser, int &world, int &time, int &total)
#define MARG 18 #define MARG 18
// Initialise un décor neutre. // Initialise un décor neutre.
void CDecor::Flush() void CDecor::Flush()
{ {

View File

@ -56,10 +56,10 @@ void CDecor::MapInitColors()
m_colors[MAP_FIRE] = MapRGB (255, 0, 0); // rouge m_colors[MAP_FIRE] = MapRGB (255, 0, 0); // rouge
m_colors[MAP_TOMAT] = MapRGB (255, 0, 0); // rouge m_colors[MAP_TOMAT] = MapRGB (255, 0, 0); // rouge
m_colors[MAP_BUILD] = MapRGB (0, 0, 0); // noir m_colors[MAP_BUILD] = MapRGB (0, 0, 0); // noir
m_colors[MAP_ENNEMI]= MapRGB (0, 192, 255); // bleu métal m_colors[MAP_ENNEMI]= MapRGB (0, 192, 255); // bleu métal
m_colors[MAP_FLEUR] = MapRGB (255, 206, 0); // jaune m_colors[MAP_FLEUR] = MapRGB (255, 206, 0); // jaune
m_colors[MAP_TREE] = MapRGB (0 ,102, 0); // vert foncé m_colors[MAP_TREE] = MapRGB (0 ,102, 0); // vert foncé
m_colors[MAP_HERB1] = MapRGB (0 ,204, 51); // vert clair m_colors[MAP_HERB1] = MapRGB (0 ,204, 51); // vert clair
m_colors[MAP_HERB2] = MapRGB (0 ,156, 8); // vert moyen m_colors[MAP_HERB2] = MapRGB (0 ,156, 8); // vert moyen
m_colors[MAP_TERRE] = MapRGB (94, 78, 12); // brun m_colors[MAP_TERRE] = MapRGB (94, 78, 12); // brun
@ -124,7 +124,7 @@ POINT CDecor::ConvMapToCel(POINT pos)
} }
// Déplace le décor suite ŕ un clic dans la carte. // Déplace le décor suite à un clic dans la carte.
bool CDecor::MapMove(POINT pos) bool CDecor::MapMove(POINT pos)
{ {
@ -343,7 +343,7 @@ static char color_object[] =
MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR,
MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR,
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, // ennemi piégé MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, // ennemi piégé
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1,
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1,
@ -355,7 +355,7 @@ static char color_object[] =
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, // barričre MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, // barrière
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
@ -364,7 +364,7 @@ static char color_object[] =
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
MAP_BUILD, MAP_BUILD, MAP_BUILD, MAP_BUILD, // maison MAP_BUILD, MAP_BUILD, MAP_BUILD, MAP_BUILD, // maison
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, // ennemi piégé MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, // ennemi piégé
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
@ -433,7 +433,7 @@ void CDecor::MapPutCel(POINT pos)
fogCel.y = (fogCel.y/4)*4; fogCel.y = (fogCel.y/4)*4;
if ( fogCel.x < 0 || fogCel.x >= MAXCELX || if ( fogCel.x < 0 || fogCel.x >= MAXCELX ||
fogCel.y < 0 || fogCel.y >= MAXCELY || fogCel.y < 0 || fogCel.y >= MAXCELY ||
m_decor[fogCel.x/2][fogCel.y/2].fog == FOGHIDE ) // caché ? m_decor[fogCel.x/2][fogCel.y/2].fog == FOGHIDE ) // caché ?
{ {
pColors = color_deffog; pColors = color_deffog;
goto color; goto color;
@ -474,7 +474,7 @@ void CDecor::MapPutCel(POINT pos)
} }
// Génčre la carte. // Génère la carte.
bool CDecor::GenerateMap() bool CDecor::GenerateMap()
{ {
@ -483,7 +483,7 @@ bool CDecor::GenerateMap()
if ( m_phase != -1 && m_phase%20 != 0 ) return true; if ( m_phase != -1 && m_phase%20 != 0 ) return true;
// Dessine le décor (sol, objets et brouillard). // Dessine le décor (sol, objets et brouillard).
for ( pos.y=0 ; pos.y<DIMMAPY ; pos.y++ ) for ( pos.y=0 ; pos.y<DIMMAPY ; pos.y++ )
{ {
dx = pos.y%2; dx = pos.y%2;

View File

@ -77,7 +77,7 @@ static short table_move3[] =
30,-56, 30,-56,
}; };
// Mouvement pour déposer un objet (est) sur blupi // Mouvement pour déposer un objet (est) sur blupi
// (synchrone avec ACTION_DEPOSE). // (synchrone avec ACTION_DEPOSE).
static short table_move4[] = static short table_move4[] =
{ {
@ -94,7 +94,7 @@ static short table_move4[] =
0,-10, 0,-10,
}; };
// Mouvement pour déposer un objet (sud) sur blupi // Mouvement pour déposer un objet (sud) sur blupi
// (synchrone avec ACTION_DEPOSE2). // (synchrone avec ACTION_DEPOSE2).
static short table_move5[] = static short table_move5[] =
{ {
@ -443,7 +443,7 @@ static short table_icon6[] =
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
}; };
// Mèche de la dynamite. // Mèche de la dynamite.
static short table_icon7[] = static short table_icon7[] =
{ {
12*4, // nb 12*4, // nb
@ -453,7 +453,7 @@ static short table_icon7[] =
86,87,86,87,86,87,86,87,86,87,86,87, 86,87,86,87,86,87,86,87,86,87,86,87,
}; };
// Rayons de l'électrocuteur. // Rayons de l'électrocuteur.
static short table_icon8[] = static short table_icon8[] =
{ {
10*10, // nb 10*10, // nb
@ -469,7 +469,7 @@ static short table_icon8[] =
-1,-1,-1,-1,-1,-1,-1,-1,-1,74, -1,-1,-1,-1,-1,-1,-1,-1,-1,74,
}; };
// Blupi écrasé. // Blupi écrasé.
static short table_icon9[] = static short table_icon9[] =
{ {
10*10, // nb 10*10, // nb
@ -485,7 +485,7 @@ static short table_icon9[] =
76,76,76,76,76,76,76,76,76,76, 76,76,76,76,76,76,76,76,76,76,
}; };
// Blupi malade écrasé. // Blupi malade écrasé.
static short table_icon10[] = static short table_icon10[] =
{ {
10*10, // nb 10*10, // nb
@ -501,7 +501,7 @@ static short table_icon10[] =
77,77,77,77,77,77,77,77,77,77, 77,77,77,77,77,77,77,77,77,77,
}; };
// Eclairs de la dalle téléporteur. // Eclairs de la dalle téléporteur.
static short table_icon11[] = static short table_icon11[] =
{ {
4, // nb 4, // nb
@ -528,7 +528,7 @@ short* GetListIcons(int rank)
// Supprime tous les décors animés. // Supprime tous les décors animés.
void CDecor::MoveFlush() void CDecor::MoveFlush()
{ {
@ -548,7 +548,7 @@ void CDecor::MoveFlush()
} }
} }
// Retourne la durée du feu. // Retourne la durée du feu.
int CDecor::MoveMaxFire() int CDecor::MoveMaxFire()
{ {
@ -556,7 +556,7 @@ int CDecor::MoveMaxFire()
return MAXFIRE; return MAXFIRE;
} }
// Initialise tous les mouvements perpétuels du décor. // Initialise tous les mouvements perpétuels du décor.
void CDecor::MoveFixInit() void CDecor::MoveFixInit()
{ {
@ -568,37 +568,37 @@ void CDecor::MoveFixInit()
{ {
for ( y=0 ; y<MAXCELY ; y+=2 ) for ( y=0 ; y<MAXCELY ; y+=2 )
{ {
// Démarre le feu. // Démarre le feu.
if ( m_decor[x/2][y/2].fire > 0 && if ( m_decor[x/2][y/2].fire > 0 &&
m_decor[x/2][y/2].fire < MoveMaxFire() ) m_decor[x/2][y/2].fire < MoveMaxFire() )
{ {
MoveStartFire(GetCel(x,y)); MoveStartFire(GetCel(x,y));
} }
// Démarre les éclairs entre les tours. // Démarre les éclairs entre les tours.
if ( m_decor[x/2][y/2].objectIcon == 10000 ) // éclair n-s if ( m_decor[x/2][y/2].objectIcon == 10000 ) // éclair n-s
{ {
if ( MoveCreate(GetCel(x,y), -1, false, CHOBJECT,-1, if ( MoveCreate(GetCel(x,y), -1, false, CHOBJECT,-1,
-1,-1, 9999,1,0, true) ) -1,-1, 9999,1,0, true) )
{ {
MoveAddIcons(GetCel(x,y), 4, true); // éclairs n-s MoveAddIcons(GetCel(x,y), 4, true); // éclairs n-s
} }
} }
if ( m_decor[x/2][y/2].objectIcon == 10001 ) // éclair e-o if ( m_decor[x/2][y/2].objectIcon == 10001 ) // éclair e-o
{ {
if ( MoveCreate(GetCel(x,y), -1, false, CHOBJECT,-1, if ( MoveCreate(GetCel(x,y), -1, false, CHOBJECT,-1,
-1,-1, 9999,1,0, true) ) -1,-1, 9999,1,0, true) )
{ {
MoveAddIcons(GetCel(x,y), 5, true); // éclairs e-o MoveAddIcons(GetCel(x,y), 5, true); // éclairs e-o
} }
} }
} }
} }
} }
// Crée un nouveau décor animé. // Crée un nouveau décor animé.
// Si bMisc=true, on garde 10 mouvements en réserve pour // Si bMisc=true, on garde 10 mouvements en réserve pour
// des actions importantes (bMisc=false). // des actions importantes (bMisc=false).
bool CDecor::MoveCreate(POINT cel, int rankBlupi, bool bFloor, bool CDecor::MoveCreate(POINT cel, int rankBlupi, bool bFloor,
@ -691,7 +691,7 @@ bool CDecor::MoveAddIcons(POINT cel, int rankIcons, bool bContinue)
m_move[rank].rankIcons = rankIcons; m_move[rank].rankIcons = rankIcons;
if ( !bContinue ) m_move[rank].phase = 0; if ( !bContinue ) m_move[rank].phase = 0;
if ( rankIcons == 4 || rankIcons == 5 ) // éclairs entre tours ? if ( rankIcons == 4 || rankIcons == 5 ) // éclairs entre tours ?
{ {
m_move[rank].cTotal = Random(0,10); m_move[rank].cTotal = Random(0,10);
} }
@ -703,7 +703,7 @@ bool CDecor::MoveAddIcons(POINT cel, int rankIcons, bool bContinue)
return false; return false;
} }
// Démarre le feu sur une cellule. // Démarre le feu sur une cellule.
// Retourne true si c'est possible. // Retourne true si c'est possible.
bool CDecor::MoveStartFire(POINT cel) bool CDecor::MoveStartFire(POINT cel)
@ -742,7 +742,7 @@ bool CDecor::MoveStartFire(POINT cel)
icon = m_decor[cel.x/2][cel.y/2].floorIcon; icon = m_decor[cel.x/2][cel.y/2].floorIcon;
if ( channel == CHFLOOR && if ( channel == CHFLOOR &&
(icon == 20 || // herbe foncée ? (icon == 20 || // herbe foncée ?
(icon >= 59 && icon <= 64)) ) // pont ? (icon >= 59 && icon <= 64)) ) // pont ?
{ {
if ( !MoveCreate(cel, -1, false, CHOBJECT,-1, if ( !MoveCreate(cel, -1, false, CHOBJECT,-1,
@ -756,7 +756,7 @@ bool CDecor::MoveStartFire(POINT cel)
return false; return false;
} }
// Démarre le feu si c'est possible par proximité. // Démarre le feu si c'est possible par proximité.
void CDecor::MoveProxiFire(POINT cel) void CDecor::MoveProxiFire(POINT cel)
{ {
@ -787,7 +787,7 @@ void CDecor::MoveProxiFire(POINT cel)
if ( x < 0 || x >= MAXCELX || if ( x < 0 || x >= MAXCELX ||
y < 0 || y >= MAXCELX ) continue; y < 0 || y >= MAXCELX ) continue;
if ( m_decor[x/2][y/2].fire != 0 ) continue; // brule déjà ? if ( m_decor[x/2][y/2].fire != 0 ) continue; // brule déjà ?
x = ((cel.x + xx)/2)*2; x = ((cel.x + xx)/2)*2;
y = ((cel.y + yy)/2)*2; y = ((cel.y + yy)/2)*2;
@ -809,13 +809,13 @@ void CDecor::MoveProxiFire(POINT cel)
((icon >= 20 && icon <= 26)|| ((icon >= 20 && icon <= 26)||
(icon >= 37 && icon <= 43)) ) continue; (icon >= 37 && icon <= 43)) ) continue;
// Démarre éventuellement un seul foyer. // Démarre éventuellement un seul foyer.
if ( MoveStartFire(GetCel(x,y)) ) return; if ( MoveStartFire(GetCel(x,y)) ) return;
} }
} }
} }
// Fait évoluer le feu. // Fait évoluer le feu.
void CDecor::MoveFire(int rank) void CDecor::MoveFire(int rank)
{ {
@ -841,25 +841,25 @@ void CDecor::MoveFire(int rank)
MoveProxiFire(GetCel(x,y)); // boutte le feu MoveProxiFire(GetCel(x,y)); // boutte le feu
} }
// Début petites flammes. // Début petites flammes.
if ( m_decor[x/2][y/2].fire == 2 ) if ( m_decor[x/2][y/2].fire == 2 )
{ {
MoveStartFire(GetCel(x,y)); MoveStartFire(GetCel(x,y));
} }
// Début grandes flammes. // Début grandes flammes.
if ( m_decor[x/2][y/2].fire == (MoveMaxFire()-DIMOBJY*2)/2 ) if ( m_decor[x/2][y/2].fire == (MoveMaxFire()-DIMOBJY*2)/2 )
{ {
MoveAddIcons(GetCel(x,y), 2, true); // grandes flammes MoveAddIcons(GetCel(x,y), 2, true); // grandes flammes
} }
// Début objet squelette. // Début objet squelette.
if ( m_decor[x/2][y/2].fire == MoveMaxFire()-DIMOBJY*2 ) if ( m_decor[x/2][y/2].fire == MoveMaxFire()-DIMOBJY*2 )
{ {
icon = m_decor[x/2][y/2].floorIcon; icon = m_decor[x/2][y/2].floorIcon;
if ( icon == 20 ) // herbe foncée ? if ( icon == 20 ) // herbe foncée ?
{ {
PutFloor(GetCel(x,y), CHFLOOR, 19); // herbe brulée PutFloor(GetCel(x,y), CHFLOOR, 19); // herbe brulée
} }
icon = m_decor[x/2][y/2].objectIcon; icon = m_decor[x/2][y/2].objectIcon;
@ -894,7 +894,7 @@ void CDecor::MoveFire(int rank)
m_decor[x/2][y/2].objectChannel = -1; m_decor[x/2][y/2].objectChannel = -1;
m_decor[x/2][y/2].objectIcon = -1; m_decor[x/2][y/2].objectIcon = -1;
} }
m_decor[x/2][y/2].fire = MoveMaxFire(); // déjà brulé m_decor[x/2][y/2].fire = MoveMaxFire(); // déjà brulé
} }
} }
else // sol qui brule ? else // sol qui brule ?
@ -905,7 +905,7 @@ void CDecor::MoveFire(int rank)
MoveProxiFire(GetCel(x,y)); // boutte le feu MoveProxiFire(GetCel(x,y)); // boutte le feu
} }
// Début petites flammes. // Début petites flammes.
if ( m_decor[x/2][y/2].fire == 2 ) if ( m_decor[x/2][y/2].fire == 2 )
{ {
MoveStartFire(GetCel(x,y)); MoveStartFire(GetCel(x,y));
@ -915,9 +915,9 @@ void CDecor::MoveFire(int rank)
if ( m_decor[x/2][y/2].fire == DIMOBJY ) if ( m_decor[x/2][y/2].fire == DIMOBJY )
{ {
icon = m_decor[x/2][y/2].floorIcon; icon = m_decor[x/2][y/2].floorIcon;
if ( icon == 20 ) // herbe foncée ? if ( icon == 20 ) // herbe foncée ?
{ {
PutFloor(GetCel(x,y), CHFLOOR, 19); // herbe brulée PutFloor(GetCel(x,y), CHFLOOR, 19); // herbe brulée
} }
if ( icon == 59 ) // pont ? if ( icon == 59 ) // pont ?
{ {
@ -947,12 +947,12 @@ void CDecor::MoveFire(int rank)
MoveFinish(GetCel(x,y)); MoveFinish(GetCel(x,y));
m_decor[x/2][y/2].objectChannel = -1; m_decor[x/2][y/2].objectChannel = -1;
m_decor[x/2][y/2].objectIcon = -1; m_decor[x/2][y/2].objectIcon = -1;
m_decor[x/2][y/2].fire = MoveMaxFire(); // déjà brulé m_decor[x/2][y/2].fire = MoveMaxFire(); // déjà brulé
} }
} }
} }
// Fait évoluer tous les décors animés. // Fait évoluer tous les décors animés.
void CDecor::MoveStep(bool bFirst) void CDecor::MoveStep(bool bFirst)
{ {
@ -963,7 +963,7 @@ void CDecor::MoveStep(bool bFirst)
if ( m_move[rank].bExist ) if ( m_move[rank].bExist )
{ {
if ( !bFirst && if ( !bFirst &&
(m_move[rank].rankIcons == 4 || // éclair entre tours ? (m_move[rank].rankIcons == 4 || // éclair entre tours ?
m_move[rank].rankIcons == 5 ) ) m_move[rank].rankIcons == 5 ) )
{ {
continue; continue;
@ -971,8 +971,8 @@ void CDecor::MoveStep(bool bFirst)
MoveFire(rank); MoveFire(rank);
// Si le blupi travaillant ici est stoppé, on // Si le blupi travaillant ici est stoppé, on
// arrête aussi la construction. // arrête aussi la construction.
rankBlupi = m_move[rank].rankBlupi; rankBlupi = m_move[rank].rankBlupi;
if ( rankBlupi != -1 ) if ( rankBlupi != -1 )
{ {
@ -987,7 +987,7 @@ void CDecor::MoveStep(bool bFirst)
} }
m_move[rank].cDelai ++; m_move[rank].cDelai ++;
if ( m_move[rank].cDelai >= m_move[rank].delai ) // délai écoulé ? if ( m_move[rank].cDelai >= m_move[rank].delai ) // délai écoulé ?
{ {
m_move[rank].cDelai = 0; m_move[rank].cDelai = 0;
@ -1007,7 +1007,7 @@ void CDecor::MoveStep(bool bFirst)
} }
} }
// Termine un mouvement pour une cellule donnée. // Termine un mouvement pour une cellule donnée.
void CDecor::MoveFinish(POINT cel) void CDecor::MoveFinish(POINT cel)
{ {
@ -1038,7 +1038,7 @@ void CDecor::MoveFinish(POINT cel)
} }
} }
// Termine un mouvement, d'après le rang du blupi. // Termine un mouvement, d'après le rang du blupi.
void CDecor::MoveFinish(int rankBlupi) void CDecor::MoveFinish(int rankBlupi)
{ {
@ -1054,7 +1054,7 @@ void CDecor::MoveFinish(int rankBlupi)
} }
} }
// Vérifie si une cellule est déjà utilisée. // Vérifie si une cellule est déjà utilisée.
bool CDecor::MoveIsUsed(POINT cel) bool CDecor::MoveIsUsed(POINT cel)
{ {
@ -1073,7 +1073,7 @@ bool CDecor::MoveIsUsed(POINT cel)
return false; return false;
} }
// Retourne l'objet en construction à un endroit donné. // Retourne l'objet en construction à un endroit donné.
bool CDecor::MoveGetObject(POINT cel, int &channel, int &icon) bool CDecor::MoveGetObject(POINT cel, int &channel, int &icon)
{ {
@ -1095,7 +1095,7 @@ bool CDecor::MoveGetObject(POINT cel, int &channel, int &icon)
return false; return false;
} }
// Modifie un objet en construction à un endroit donné. // Modifie un objet en construction à un endroit donné.
bool CDecor::MovePutObject(POINT cel, int channel, int icon) bool CDecor::MovePutObject(POINT cel, int channel, int icon)
{ {

View File

@ -21,7 +21,7 @@
#define TEXTDELAY 10 // délai avant apparition tooltips #define TEXTDELAY 10 // délai avant apparition tooltips
POINT GetCel(int x, int y) POINT GetCel(int x, int y)
{ {
@ -41,9 +41,9 @@ POINT GetCel(POINT cel, int x, int y)
return cel; return cel;
} }
// Indique si une coordonnée de cellule est valide. // Indique si une coordonnée de cellule est valide.
// On ne peut pas aller dans la dernière cellule tout au // On ne peut pas aller dans la dernière cellule tout au
// bord (-2) pour permettre de gérer le brouillard proprement // bord (-2) pour permettre de gérer le brouillard proprement
// jusque dans les bords ! // jusque dans les bords !
bool IsValid(POINT cel) bool IsValid(POINT cel)
@ -53,7 +53,7 @@ bool IsValid(POINT cel)
return true; return true;
} }
// Retourne un vecteur orienté dans une direction donnée. // Retourne un vecteur orienté dans une direction donnée.
POINT GetVector(int direct) POINT GetVector(int direct)
{ {
@ -110,7 +110,7 @@ CDecor::CDecor()
m_celOutline1.x = -1; m_celOutline1.x = -1;
m_celOutline2.x = -1; m_celOutline2.x = -1;
m_bHiliRect = false; // pas de rectangle de sélection m_bHiliRect = false; // pas de rectangle de sélection
m_shiftHili = 0; m_shiftHili = 0;
m_shiftOffset.x = 0; m_shiftOffset.x = 0;
@ -143,11 +143,11 @@ CDecor::CDecor()
CDecor::~CDecor() CDecor::~CDecor()
{ {
UndoClose(); // libère le buffer du undo UndoClose(); // libère le buffer du undo
} }
// Initialisation générale. // Initialisation générale.
void CDecor::Create(CSound *pSound, CPixmap *pPixmap) void CDecor::Create(CSound *pSound, CPixmap *pPixmap)
{ {
@ -156,7 +156,7 @@ void CDecor::Create(CSound *pSound, CPixmap *pPixmap)
m_bOutline = false; m_bOutline = false;
} }
// Initialise le décor avec un sol plat partout. // Initialise le décor avec un sol plat partout.
void CDecor::Init(int channel, int icon) void CDecor::Init(int channel, int icon)
{ {
@ -172,7 +172,7 @@ void CDecor::Init(int channel, int icon)
m_decor[x][y].objectChannel = -1; m_decor[x][y].objectChannel = -1;
m_decor[x][y].objectIcon = -1; m_decor[x][y].objectIcon = -1;
m_decor[x][y].fog = FOGHIDE; // caché m_decor[x][y].fog = FOGHIDE; // caché
m_decor[x][y].rankMove = -1; m_decor[x][y].rankMove = -1;
m_decor[x][y].workBlupi = -1; m_decor[x][y].workBlupi = -1;
m_decor[x][y].fire = 0; m_decor[x][y].fire = 0;
@ -191,7 +191,7 @@ void CDecor::Init(int channel, int icon)
m_bGroundRedraw = true; m_bGroundRedraw = true;
} }
// Initialise le décor après une modification. // Initialise le décor après une modification.
void CDecor::InitAfterBuild() void CDecor::InitAfterBuild()
{ {
@ -202,7 +202,7 @@ void CDecor::InitAfterBuild()
BlupiDeselect(); BlupiDeselect();
} }
// Initialise les mises en évidence, avant de jouer. // Initialise les mises en évidence, avant de jouer.
void CDecor::ResetHili() void CDecor::ResetHili()
{ {
@ -210,7 +210,7 @@ void CDecor::ResetHili()
InitOutlineRect(); InitOutlineRect();
} }
// Charge les images nécessaires au décor. // Charge les images nécessaires au décor.
bool CDecor::LoadImages() bool CDecor::LoadImages()
{ {
@ -256,7 +256,7 @@ void CDecor::ClearFog()
{ {
for ( y=0 ; y<MAXCELY/2 ; y++ ) for ( y=0 ; y<MAXCELY/2 ; y++ )
{ {
m_decor[x][y].fog = FOGHIDE; // caché m_decor[x][y].fog = FOGHIDE; // caché
} }
} }
@ -271,7 +271,7 @@ void CDecor::ClearFog()
m_bOutline = false; m_bOutline = false;
} }
// Permet de nouveau aux cellules brulées de bruler. // Permet de nouveau aux cellules brulées de bruler.
void CDecor::ClearFire() void CDecor::ClearFire()
{ {
@ -281,14 +281,14 @@ void CDecor::ClearFire()
{ {
for ( y=0 ; y<MAXCELY/2 ; y++ ) for ( y=0 ; y<MAXCELY/2 ; y++ )
{ {
if ( m_decor[x][y].fire >= MoveMaxFire() ) // déjà brulé ? if ( m_decor[x][y].fire >= MoveMaxFire() ) // déjà brulé ?
{ {
m_decor[x][y].fire = 0; // pourra de nouveau bruler m_decor[x][y].fire = 0; // pourra de nouveau bruler
} }
if ( m_decor[x][y].fire > 1 ) // en train de bruler ? if ( m_decor[x][y].fire > 1 ) // en train de bruler ?
{ {
m_decor[x][y].fire = 1; // début du feu m_decor[x][y].fire = 1; // début du feu
} }
} }
} }
@ -422,7 +422,7 @@ void CDecor::SetShiftOffset(POINT offset)
m_bGroundRedraw = true; m_bGroundRedraw = true;
} }
// Convertit la position d'une cellule en coordonnée graphique. // Convertit la position d'une cellule en coordonnée graphique.
POINT CDecor::ConvCelToPos(POINT cel) POINT CDecor::ConvCelToPos(POINT cel)
{ {
@ -437,7 +437,7 @@ POINT CDecor::ConvCelToPos(POINT cel)
return pos; return pos;
} }
// Convertit une coordonnée graphique en cellule. // Convertit une coordonnée graphique en cellule.
POINT CDecor::ConvPosToCel(POINT pos, bool bMap) POINT CDecor::ConvPosToCel(POINT pos, bool bMap)
{ {
@ -467,7 +467,7 @@ POINT CDecor::ConvPosToCel(POINT pos, bool bMap)
return cel; return cel;
} }
// Convertit une coordonnée graphique en grande cellule (2x2). // Convertit une coordonnée graphique en grande cellule (2x2).
POINT CDecor::ConvPosToCel2(POINT pos) POINT CDecor::ConvPosToCel2(POINT pos)
{ {
@ -507,7 +507,7 @@ POINT CDecor::ConvPosToCel2(POINT pos)
// Attribution des blupi aux différentes cellules. // Attribution des blupi aux différentes cellules.
// Lorsque un blupi a deux positions (courante et destination), // Lorsque un blupi a deux positions (courante et destination),
// il faut toujours mettre blupi le plus au fond possible // il faut toujours mettre blupi le plus au fond possible
// (minimiser x et y). // (minimiser x et y).
@ -517,7 +517,7 @@ void CDecor::BuildPutBlupi()
int x, y, dx, dy, xMin, yMin, rank, clipLeft; int x, y, dx, dy, xMin, yMin, rank, clipLeft;
POINT pos; POINT pos;
#if 0 // déjà fait au point (1), voir Build #if 0 // déjà fait au point (1), voir Build
for ( x=0 ; x<MAXCELX ; x++ ) for ( x=0 ; x<MAXCELX ; x++ )
{ {
for ( y=0 ; y<MAXCELY ; y++ ) for ( y=0 ; y<MAXCELY ; y++ )
@ -539,7 +539,7 @@ void CDecor::BuildPutBlupi()
if ( yMin > m_blupi[rank].cel.y ) yMin = m_blupi[rank].cel.y; if ( yMin > m_blupi[rank].cel.y ) yMin = m_blupi[rank].cel.y;
// Si blupi entre dans une maison, il faut initialiser // Si blupi entre dans une maison, il faut initialiser
// le clipping à gauche. // le clipping à gauche.
m_blupi[rank].clipLeft = 0; // pas de clipping m_blupi[rank].clipLeft = 0; // pas de clipping
if ( !m_bOutline && if ( !m_bOutline &&
@ -568,12 +568,12 @@ void CDecor::BuildPutBlupi()
dx = m_blupi[rank].destCel.x - x; dx = m_blupi[rank].destCel.x - x;
dy = m_blupi[rank].destCel.y - y; dy = m_blupi[rank].destCel.y - y;
if ( dx != -dy ) // déplacement non horizontal (ne/so) ? if ( dx != -dy ) // déplacement non horizontal (ne/so) ?
{ {
if ( dx < 0 ) x = m_blupi[rank].destCel.x; if ( dx < 0 ) x = m_blupi[rank].destCel.x;
if ( dy < 0 ) y = m_blupi[rank].destCel.y; if ( dy < 0 ) y = m_blupi[rank].destCel.y;
} }
if ( dx == -1 && dy == 1 ) // déplacement "so" ? if ( dx == -1 && dy == 1 ) // déplacement "so" ?
{ {
x = m_blupi[rank].destCel.x; x = m_blupi[rank].destCel.x;
y = m_blupi[rank].destCel.y; y = m_blupi[rank].destCel.y;
@ -595,7 +595,7 @@ void CDecor::BuildPutBlupi()
if ( !IsFreeCelObstacle(GetCel(x+1,y-1)) ) x ++; if ( !IsFreeCelObstacle(GetCel(x+1,y-1)) ) x ++;
} }
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ? if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
{ {
if ( x == m_blupi[rank].cel.x ) if ( x == m_blupi[rank].cel.x )
{ {
@ -606,7 +606,7 @@ void CDecor::BuildPutBlupi()
x = m_blupi[rank].cel.x; x = m_blupi[rank].cel.x;
} }
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ? if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
{ {
if ( y == m_blupi[rank].cel.y ) if ( y == m_blupi[rank].cel.y )
{ {
@ -617,7 +617,7 @@ void CDecor::BuildPutBlupi()
y = m_blupi[rank].cel.y; y = m_blupi[rank].cel.y;
} }
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ? if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
{ {
//? OutputDebug(">>> Manque un blupi <<<\n"); //? OutputDebug(">>> Manque un blupi <<<\n");
continue; // que faire d'autre ? continue; // que faire d'autre ?
@ -629,7 +629,7 @@ void CDecor::BuildPutBlupi()
} }
} }
// Dessine une cellule du décor contenant un sol animé. // Dessine une cellule du décor contenant un sol animé.
void CDecor::BuildMoveFloor(int x, int y, POINT pos, int rank) void CDecor::BuildMoveFloor(int x, int y, POINT pos, int rank)
{ {
@ -668,7 +668,7 @@ void CDecor::BuildMoveFloor(int x, int y, POINT pos, int rank)
} }
} }
// Dessine une cellule du décor contenant un objet animé. // Dessine une cellule du décor contenant un objet animé.
void CDecor::BuildMoveObject(int x, int y, POINT pos, int rank) void CDecor::BuildMoveObject(int x, int y, POINT pos, int rank)
{ {
@ -720,7 +720,7 @@ void CDecor::BuildMoveObject(int x, int y, POINT pos, int rank)
if ( hBuild < -DIMOBJY ) hBuild = -DIMOBJY; if ( hBuild < -DIMOBJY ) hBuild = -DIMOBJY;
} }
// Dessine l'objet actuellement dans le décor. // Dessine l'objet actuellement dans le décor.
if ( m_decor[x/2][y/2].objectChannel >= 0 ) if ( m_decor[x/2][y/2].objectChannel >= 0 )
{ {
if ( hBuild >= 0 ) if ( hBuild >= 0 )
@ -781,7 +781,7 @@ void CDecor::BuildMoveObject(int x, int y, POINT pos, int rank)
} }
} }
// Déplace l'objet transporté par blupi. // Déplace l'objet transporté par blupi.
void BuildMoveTransport(int icon, POINT &pos) void BuildMoveTransport(int icon, POINT &pos)
{ {
@ -839,13 +839,13 @@ void BuildMoveTransport(int icon, POINT &pos)
pos.y += 1; pos.y += 1;
} }
if ( icon == 106 ) // se penche (mèche dynamite) ? if ( icon == 106 ) // se penche (mèche dynamite) ?
{ {
pos.x += 8; pos.x += 8;
pos.y += 10; pos.y += 10;
} }
if ( icon == 194 ) // se penche (mèche dynamite) ? if ( icon == 194 ) // se penche (mèche dynamite) ?
{ {
pos.x += 9; pos.x += 9;
pos.y += 9; pos.y += 9;
@ -869,7 +869,7 @@ void BuildMoveTransport(int icon, POINT &pos)
pos.y += offset_jeep[(icon-250)*2+1]; pos.y += offset_jeep[(icon-250)*2+1];
} }
if ( icon == 270 ) pos.y += 3; // blupi électrocuté if ( icon == 270 ) pos.y += 3; // blupi électrocuté
if ( icon == 271 ) pos.y -= 2; if ( icon == 271 ) pos.y -= 2;
if ( icon == 272 ) pos.y -= 7; if ( icon == 272 ) pos.y -= 7;
} }
@ -965,7 +965,7 @@ void CDecor::BuildGround(RECT clip)
icon = 78; // losange noir icon = 78; // losange noir
} }
if ( !m_bBuild && icon == 71 ) // terre à fer ? if ( !m_bBuild && icon == 71 ) // terre à fer ?
{ {
icon = 33; // terre normale ! icon = 33; // terre normale !
} }
@ -1002,7 +1002,7 @@ void CDecor::BuildGround(RECT clip)
m_bGroundRedraw = false; m_bGroundRedraw = false;
} }
// Construit le décor dans un pixmap. // Construit le décor dans un pixmap.
void CDecor::Build(RECT clip, POINT posMouse) void CDecor::Build(RECT clip, POINT posMouse)
{ {
@ -1102,7 +1102,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
{ {
icon = m_decor[x/2][y/2].floorIcon; icon = m_decor[x/2][y/2].floorIcon;
if ( !m_bBuild && icon == 71 ) // terre à fer ? if ( !m_bBuild && icon == 71 ) // terre à fer ?
{ {
icon = 33; // terre normale ! icon = 33; // terre normale !
} }
@ -1125,7 +1125,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
} }
rank = m_decor[x/2][y/2].rankMove; rank = m_decor[x/2][y/2].rankMove;
if ( rank != -1 && // décor animé ? if ( rank != -1 && // décor animé ?
m_move[rank].bFloor ) m_move[rank].bFloor )
{ {
pos.x = cPos.x-DIMCELX/2; pos.x = cPos.x-DIMCELX/2;
@ -1149,7 +1149,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
} }
} }
if ( m_bHiliRect ) // rectangle de sélection existe ? if ( m_bHiliRect ) // rectangle de sélection existe ?
{ {
if ( (m_p1Hili.x == x && m_p1Hili.y == y) || if ( (m_p1Hili.x == x && m_p1Hili.y == y) ||
(m_p2Hili.x == x && m_p2Hili.y == y) ) (m_p2Hili.x == x && m_p2Hili.y == y) )
@ -1202,7 +1202,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
} }
} }
BlupiDrawHili(); // dessine le rectangle de sélection BlupiDrawHili(); // dessine le rectangle de sélection
// Construit les objets et les blupi. // Construit les objets et les blupi.
BuildPutBlupi(); // m_rankBlupi[x][y] <- rangs des blupi BuildPutBlupi(); // m_rankBlupi[x][y] <- rangs des blupi
@ -1240,7 +1240,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
{ {
tPos.y -= 6; tPos.y -= 6;
} }
// Dessine la sélection/énergie // Dessine la sélection/énergie
if ( m_blupi[rank].clipLeft == 0 ) if ( m_blupi[rank].clipLeft == 0 )
{ {
m_pPixmap->DrawIconDemi(-1, CHBLUPI, icon, tPos); m_pPixmap->DrawIconDemi(-1, CHBLUPI, icon, tPos);
@ -1255,7 +1255,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
} }
} }
// Dessine la flèche ronde "répète" sous blupi. // Dessine la flèche ronde "répète" sous blupi.
if ( m_blupi[rank].repeatLevel != -1 ) if ( m_blupi[rank].repeatLevel != -1 )
{ {
tPos = pos; tPos = pos;
@ -1264,7 +1264,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
{ {
tPos.y -= 6; tPos.y -= 6;
} }
// Dessine la sélection/énergie // Dessine la sélection/énergie
if ( m_blupi[rank].clipLeft == 0 ) if ( m_blupi[rank].clipLeft == 0 )
{ {
m_pPixmap->DrawIconDemi(-1, CHBLUPI, 116, tPos); m_pPixmap->DrawIconDemi(-1, CHBLUPI, 116, tPos);
@ -1279,7 +1279,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
} }
} }
// Dessine la flèche jaune sur blupi. // Dessine la flèche jaune sur blupi.
if ( m_blupi[rank].bArrow ) if ( m_blupi[rank].bArrow )
{ {
tPos = pos; tPos = pos;
@ -1311,7 +1311,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
m_pPixmap->DrawIcon(-1, m_blupi[rank].channel, m_pPixmap->DrawIcon(-1, m_blupi[rank].channel,
m_blupi[rank].icon, pos); m_blupi[rank].icon, pos);
// Dessine l'objet transporté. // Dessine l'objet transporté.
if ( m_blupi[rank].takeChannel != -1 ) if ( m_blupi[rank].takeChannel != -1 )
{ {
BuildMoveTransport(m_blupi[rank].icon, pos); BuildMoveTransport(m_blupi[rank].icon, pos);
@ -1327,7 +1327,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
m_pPixmap->DrawIcon(-1, m_blupi[rank].channel, m_pPixmap->DrawIcon(-1, m_blupi[rank].channel,
m_blupi[rank].icon, pos); m_blupi[rank].icon, pos);
// Dessine l'objet transporté. // Dessine l'objet transporté.
if ( m_blupi[rank].takeChannel != -1 ) if ( m_blupi[rank].takeChannel != -1 )
{ {
BuildMoveTransport(m_blupi[rank].icon, pos); BuildMoveTransport(m_blupi[rank].icon, pos);
@ -1347,7 +1347,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
pos.y = cPos.y-(DIMOBJY-DIMCELY*2); pos.y = cPos.y-(DIMOBJY-DIMCELY*2);
// Dessine l'objet // Dessine l'objet
if ( rank == -1 || // décor fixe ? if ( rank == -1 || // décor fixe ?
m_move[rank].bFloor || m_move[rank].bFloor ||
m_bBuild ) m_bBuild )
{ {
@ -1367,20 +1367,20 @@ void CDecor::Build(RECT clip, POINT posMouse)
m_decor[x/2][y/2].objectIcon, m_decor[x/2][y/2].objectIcon,
pos); pos);
if ( m_decor[x/2][y/2].objectIcon == 12 ) // fusée ? if ( m_decor[x/2][y/2].objectIcon == 12 ) // fusée ?
{ {
pos.y -= DIMOBJY; pos.y -= DIMOBJY;
m_pPixmap->DrawIcon(-1, channel, 13, pos); m_pPixmap->DrawIcon(-1, channel, 13, pos);
} }
} }
else // décor animé ? else // décor animé ?
{ {
BuildMoveObject(x, y, pos, rank); BuildMoveObject(x, y, pos, rank);
} }
} }
else else
{ {
if ( rank != -1 && // décor animé ? if ( rank != -1 && // décor animé ?
!m_move[rank].bFloor && !m_move[rank].bFloor &&
!m_bBuild ) !m_bBuild )
{ {
@ -1424,22 +1424,22 @@ void CDecor::Build(RECT clip, POINT posMouse)
// Construit le brouillard. // Construit le brouillard.
if ( !m_bFog ) goto term; if ( !m_bFog ) goto term;
if ( m_shiftOffset.x < 0 ) // décalage à droite ? if ( m_shiftOffset.x < 0 ) // décalage à droite ?
{ {
nbx += 2; nbx += 2;
} }
if ( m_shiftOffset.y < 0 ) // décalage en bas ? if ( m_shiftOffset.y < 0 ) // décalage en bas ?
{ {
nby += 2; nby += 2;
} }
if ( m_shiftOffset.x > 0 ) // décalage à gauche ? if ( m_shiftOffset.x > 0 ) // décalage à gauche ?
{ {
nbx += 2; nbx += 2;
iCel.x --; iCel.x --;
iCel.y ++; iCel.y ++;
iPos = ConvCelToPos(iCel); iPos = ConvCelToPos(iCel);
} }
if ( m_shiftOffset.y > 0 ) // décalage en haut ? if ( m_shiftOffset.y > 0 ) // décalage en haut ?
{ {
nby += 2; nby += 2;
iCel.x --; iCel.x --;
@ -1464,7 +1464,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
} }
else else
{ {
icon = FOGHIDE; // caché icon = FOGHIDE; // caché
} }
if ( abs(x)%4 == abs(y)%4 && if ( abs(x)%4 == abs(y)%4 &&
@ -1497,7 +1497,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
} }
term: term:
// Dessine la flèche jaune sur un objet. // Dessine la flèche jaune sur un objet.
if ( m_celArrow.x != -1 ) if ( m_celArrow.x != -1 )
{ {
tPos = ConvCelToPos(m_celArrow); tPos = ConvCelToPos(m_celArrow);
@ -1512,7 +1512,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
m_pPixmap->DrawIcon(-1, CHBLUPI,132, tPos); m_pPixmap->DrawIcon(-1, CHBLUPI,132, tPos);
} }
// Dessine le nom de l'objet pointé par la souris. // Dessine le nom de l'objet pointé par la souris.
if ( posMouse.x == m_textLastPos.x && if ( posMouse.x == m_textLastPos.x &&
posMouse.y == m_textLastPos.y ) posMouse.y == m_textLastPos.y )
{ {
@ -1545,9 +1545,9 @@ void CDecor::Build(RECT clip, POINT posMouse)
// Augmente la phase. // Augmente la phase.
// -1 mise à jour continue // -1 mise à jour continue
// 0 début de mise à jour périodique // 0 début de mise à jour périodique
// 1 mise à jour périodique suivante // 1 mise à jour périodique suivante
void CDecor::NextPhase(int mode) void CDecor::NextPhase(int mode)
{ {
@ -1569,14 +1569,14 @@ void CDecor::NextPhase(int mode)
m_totalTime ++; m_totalTime ++;
} }
// Modifie le temps total passé dans cette partie. // Modifie le temps total passé dans cette partie.
void CDecor::SetTotalTime(int total) void CDecor::SetTotalTime(int total)
{ {
m_totalTime = total; m_totalTime = total;
} }
// Retourne le temps total passé dans cette partie. // Retourne le temps total passé dans cette partie.
int CDecor::GetTotalTime() int CDecor::GetTotalTime()
{ {
@ -1584,7 +1584,7 @@ int CDecor::GetTotalTime()
} }
// Compte le nombre total de sols contenus dans les décors. // Compte le nombre total de sols contenus dans les décors.
int CDecor::CountFloor(int channel, int icon) int CDecor::CountFloor(int channel, int icon)
{ {
@ -1604,8 +1604,8 @@ int CDecor::CountFloor(int channel, int icon)
} }
// Indique si une cellule est ok pour une action. // Indique si une cellule est ok pour une action.
// Le rang du blupi qui effectuera le travail est donnée dans rank. // Le rang du blupi qui effectuera le travail est donnée dans rank.
// action = 0 sélection jeu // action = 0 sélection jeu
// 1 construction d'une cellule 1x1 // 1 construction d'une cellule 1x1
// 2 construction d'une cellule 2x2 // 2 construction d'une cellule 2x2
// WM_ACTION* action // WM_ACTION* action
@ -1657,11 +1657,11 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
{ {
bTransport = true; bTransport = true;
} }
if ( m_blupi[rank].vehicule != 0 ) // pas à pied ? if ( m_blupi[rank].vehicule != 0 ) // pas à pied ?
{ {
bVehicule = true; bVehicule = true;
} }
if ( m_blupi[rank].vehicule != 0 && // pas à pied ? if ( m_blupi[rank].vehicule != 0 && // pas à pied ?
m_blupi[rank].vehicule != 3 ) // pas armure ? m_blupi[rank].vehicule != 3 ) // pas armure ?
{ {
bVehiculeA = true; bVehiculeA = true;
@ -1754,7 +1754,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
IsFreeCelGo(GetCel(cel.x+x,cel.y+y), rank) && IsFreeCelGo(GetCel(cel.x+x,cel.y+y), rank) &&
!IsBlupiHere(GetCel(cel.x+x,cel.y+y), true) ) !IsBlupiHere(GetCel(cel.x+x,cel.y+y), true) )
{ {
//? icons[1+x][1+y] = ICON_HILI_GO; // flèche //? icons[1+x][1+y] = ICON_HILI_GO; // flèche
icons[1+x][1+y] = ICON_HILI_OP; // action icons[1+x][1+y] = ICON_HILI_OP; // action
error = 0; error = 0;
} }
@ -1841,30 +1841,30 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
if ( action == WM_ACTION_BUILD1 || // cabane ? if ( action == WM_ACTION_BUILD1 || // cabane ?
action == WM_ACTION_BUILD2 || // couveuse ? action == WM_ACTION_BUILD2 || // couveuse ?
action == WM_ACTION_BUILD6 ) // téléporteur ? action == WM_ACTION_BUILD6 ) // téléporteur ?
{ {
GetFloor(cel, channel, icon); GetFloor(cel, channel, icon);
if ( channel != CHFLOOR || if ( channel != CHFLOOR ||
(icon != 1 && // herbe claire ? (icon != 1 && // herbe claire ?
(icon < 19 || icon > 32)) ) // herbe foncée ? (icon < 19 || icon > 32)) ) // herbe foncée ?
{ {
error = ERROR_GROUND; // sol pas adéquat error = ERROR_GROUND; // sol pas adéquat
} }
} }
if ( action == WM_ACTION_BUILD4 ) // mine ? if ( action == WM_ACTION_BUILD4 ) // mine ?
{ {
GetFloor(cel, channel, icon); GetFloor(cel, channel, icon);
if ( channel != CHFLOOR || icon != 71 ) // terre à fer ? if ( channel != CHFLOOR || icon != 71 ) // terre à fer ?
{ {
error = ERROR_GROUND; // sol pas adéquat error = ERROR_GROUND; // sol pas adéquat
} }
} }
if ( action == WM_ACTION_BUILD6 && // téléporteur ? if ( action == WM_ACTION_BUILD6 && // téléporteur ?
CountFloor(CHFLOOR, 80) >= 2 ) // déjà 2 ? CountFloor(CHFLOOR, 80) >= 2 ) // déjà 2 ?
{ {
error = ERROR_TELE2; // déjà 2 téléporteurs error = ERROR_TELE2; // déjà 2 téléporteurs
} }
if ( action == WM_ACTION_BUILD3 || if ( action == WM_ACTION_BUILD3 ||
@ -1978,9 +1978,9 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
// GetFloor(cel, channel, icon); // GetFloor(cel, channel, icon);
// if ( channel != CHFLOOR || // if ( channel != CHFLOOR ||
// (icon != 1 && // herbe claire ? // (icon != 1 && // herbe claire ?
// (icon < 19 || icon > 32)) ) // herbe foncée ? // (icon < 19 || icon > 32)) ) // herbe foncée ?
// { // {
// error = ERROR_GROUND; // sol pas adéquat // error = ERROR_GROUND; // sol pas adéquat
// } // }
GetObject(cel, channel, icon); GetObject(cel, channel, icon);
@ -2002,7 +2002,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
{ {
for ( y=-1 ; y<3 ; y++ ) for ( y=-1 ; y<3 ; y++ )
{ {
if ( x<0 || x>1 || y<0 || y>1 ) // périphérie ? if ( x<0 || x>1 || y<0 || y>1 ) // périphérie ?
{ {
GetFloor(GetCel(cel,x,y), channel, icon); GetFloor(GetCel(cel,x,y), channel, icon);
if ( channel == CHFLOOR && if ( channel == CHFLOOR &&
@ -2160,7 +2160,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
GetObject(GetCel(cel,-1,-1), channel, icon); GetObject(GetCel(cel,-1,-1), channel, icon);
if ( bStrong && !bTransport && !bVehiculeA && if ( bStrong && !bTransport && !bVehiculeA &&
channel == CHOBJECT && channel == CHOBJECT &&
(icon == 14 || // métal ? (icon == 14 || // métal ?
icon == 36 || // planches ? icon == 36 || // planches ?
icon == 44 || // pierres ? icon == 44 || // pierres ?
icon == 60 || // tomates ? icon == 60 || // tomates ?
@ -2171,7 +2171,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
icon == 95 || // fleurs ? icon == 95 || // fleurs ?
icon == 85 || // dynamite ? icon == 85 || // dynamite ?
icon == 92 || // poison ? icon == 92 || // poison ?
icon == 93 || // piège ? icon == 93 || // piège ?
icon == 123 || // fer ? icon == 123 || // fer ?
icon == 125) && // mine ? icon == 125) && // mine ?
(!IsBlupiHereEx(GetCel(cel,-1,0), rank, false) || (!IsBlupiHereEx(GetCel(cel,-1,0), rank, false) ||
@ -2522,7 +2522,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
error = ERROR_MISC; error = ERROR_MISC;
if ( m_blupi[rank].vehicule == 2 && // en jeep ? if ( m_blupi[rank].vehicule == 2 && // en jeep ?
m_decor[cel.x/2][cel.y/2].objectIcon == -1 && m_decor[cel.x/2][cel.y/2].objectIcon == -1 &&
m_decor[cel.x/2][cel.y/2].floorIcon != 80 ) // pas téléporteur ? m_decor[cel.x/2][cel.y/2].floorIcon != 80 ) // pas téléporteur ?
{ {
if ( IsFreeCelGo(GetCel(cel,+1, 0), rank) && if ( IsFreeCelGo(GetCel(cel,+1, 0), rank) &&
IsFreeCelGo(GetCel(cel,+1,+1), rank) && IsFreeCelGo(GetCel(cel,+1,+1), rank) &&
@ -2553,7 +2553,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
if ( m_blupi[rank].vehicule == 3 && // armure ? if ( m_blupi[rank].vehicule == 3 && // armure ?
!bTransport && !bTransport &&
m_decor[cel.x/2][cel.y/2].objectIcon == -1 && m_decor[cel.x/2][cel.y/2].objectIcon == -1 &&
m_decor[cel.x/2][cel.y/2].floorIcon != 80 ) // pas téléporteur ? m_decor[cel.x/2][cel.y/2].floorIcon != 80 ) // pas téléporteur ?
{ {
if ( IsFreeCelGo(GetCel(cel,+1, 0), rank) && if ( IsFreeCelGo(GetCel(cel,+1, 0), rank) &&
IsFreeCelGo(GetCel(cel,+1,+1), rank) && IsFreeCelGo(GetCel(cel,+1,+1), rank) &&
@ -2587,13 +2587,13 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
if ( (icon < 33 || icon > 48) && if ( (icon < 33 || icon > 48) &&
icon != 71 ) // pas terre ? icon != 71 ) // pas terre ?
{ {
error = ERROR_MISC; // terrain pas adapté error = ERROR_MISC; // terrain pas adapté
} }
GetObject(cel, channel, icon); GetObject(cel, channel, icon);
if ( channel == CHOBJECT ) // y a-t-il un objet ? if ( channel == CHOBJECT ) // y a-t-il un objet ?
{ {
error = ERROR_MISC; // terrain pas adapté error = ERROR_MISC; // terrain pas adapté
} }
for ( x=0 ; x<2 ; x++ ) for ( x=0 ; x<2 ; x++ )
@ -2712,7 +2712,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
GetObject(cel, channel, icon); GetObject(cel, channel, icon);
if ( channel != CHOBJECT || icon != 120 || // usine ? if ( channel != CHOBJECT || icon != 120 || // usine ?
m_blupi[rank].takeChannel != CHOBJECT || m_blupi[rank].takeChannel != CHOBJECT ||
m_blupi[rank].takeIcon != 14 ) // métal ? m_blupi[rank].takeIcon != 14 ) // métal ?
{ {
error = ERROR_MISC; // pas d'usine ! error = ERROR_MISC; // pas d'usine !
} }
@ -2743,7 +2743,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
} }
// Indique si une cellule est ok pour une action. // Indique si une cellule est ok pour une action.
// Le rang du blupi qui effectuera le travail est donnée dans rank. // Le rang du blupi qui effectuera le travail est donnée dans rank.
int CDecor::CelOkForAction(POINT cel, int action, int rank) int CDecor::CelOkForAction(POINT cel, int action, int rank)
{ {
@ -2754,7 +2754,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank)
celOutline1, celOutline2); celOutline1, celOutline2);
} }
// Retourne le rang du nième blupi sélectionné. // Retourne le rang du nième blupi sélectionné.
int CDecor::GetHiliRankBlupi(int nb) int CDecor::GetHiliRankBlupi(int nb)
{ {
@ -2780,8 +2780,8 @@ int CDecor::GetHiliRankBlupi(int nb)
return -1; return -1;
} }
// Marque la cellule visée par la souris. // Marque la cellule visée par la souris.
// action = 0 sélection jeu // action = 0 sélection jeu
// 1 construction d'une cellule 1x1 // 1 construction d'une cellule 1x1
// 2 construction d'une cellule 2x2 // 2 construction d'une cellule 2x2
@ -2802,7 +2802,7 @@ void CDecor::CelHili(POINT pos, int action)
m_celOutline2.x = -1; m_celOutline2.x = -1;
m_rankHili = -1; m_rankHili = -1;
if ( action == 0 ) // sélection pendant jeu ? if ( action == 0 ) // sélection pendant jeu ?
{ {
rank = GetTargetBlupi(pos); rank = GetTargetBlupi(pos);
if ( rank >= 0 ) if ( rank >= 0 )
@ -2852,7 +2852,7 @@ void CDecor::CelHili(POINT pos, int action)
m_celOutline1.y = (m_celHili.y/2)*2; m_celOutline1.y = (m_celHili.y/2)*2;
GetObject(m_celOutline1, channel, icon); GetObject(m_celOutline1, channel, icon);
if ( channel == CHOBJECT && if ( channel == CHOBJECT &&
(icon == 14 || // métal ? (icon == 14 || // métal ?
icon == 36 || // planches ? icon == 36 || // planches ?
icon == 44 || // pierres ? icon == 44 || // pierres ?
icon == 60 || // tomates ? icon == 60 || // tomates ?
@ -2863,7 +2863,7 @@ void CDecor::CelHili(POINT pos, int action)
icon == 95 || // fleurs ? icon == 95 || // fleurs ?
icon == 85 || // dynamite ? icon == 85 || // dynamite ?
icon == 92 || // poison ? icon == 92 || // poison ?
icon == 93 || // piège ? icon == 93 || // piège ?
icon == 123 || // fer ? icon == 123 || // fer ?
icon == 125 ) ) // mine ? icon == 125 ) ) // mine ?
{ {
@ -2896,7 +2896,7 @@ void CDecor::CelHili(POINT pos, int action)
} }
} }
// Marque la cellule visée par la souris pour un bouton donné. // Marque la cellule visée par la souris pour un bouton donné.
void CDecor::CelHiliButton(POINT cel, int button) void CDecor::CelHiliButton(POINT cel, int button)
{ {
@ -2941,7 +2941,7 @@ void CDecor::CelHiliButton(POINT cel, int button)
} }
} }
// Marque la cellule visée par la souris pour une répétition donnée. // Marque la cellule visée par la souris pour une répétition donnée.
void CDecor::CelHiliRepeat(int list) void CDecor::CelHiliRepeat(int list)
{ {
@ -3007,14 +3007,14 @@ void CDecor::CelHiliRepeat(int list)
m_celHili = cel; m_celHili = cel;
} }
// Retourne l'identificateur du texte correspondant à // Retourne l'identificateur du texte correspondant à
// l'objet ou au blupi visé par la souris. // l'objet ou au blupi visé par la souris.
const char *CDecor::GetResHili(POINT posMouse) const char *CDecor::GetResHili(POINT posMouse)
{ {
int icon; int icon;
// Les valeurs `corner == true` correspondent aux objets placés // Les valeurs `corner == true` correspondent aux objets placés
// au coin inf/droit de la cellule. // au coin inf/droit de la cellule.
struct object_t struct object_t
{ {
@ -3213,7 +3213,7 @@ const char *CDecor::GetResHili(POINT posMouse)
}; };
if (m_bHideTooltips) if (m_bHideTooltips)
return nullptr; // rien si menu présent return nullptr; // rien si menu présent
if ( posMouse.x < POSDRAWX if ( posMouse.x < POSDRAWX
|| posMouse.x > POSDRAWX + DIMDRAWX || posMouse.x > POSDRAWX + DIMDRAWX
@ -3223,7 +3223,7 @@ const char *CDecor::GetResHili(POINT posMouse)
if ( m_celHili.x != -1 ) if ( m_celHili.x != -1 )
{ {
if ( m_rankHili != -1 ) // blupi visé ? if ( m_rankHili != -1 ) // blupi visé ?
{ {
switch (m_blupi[m_rankHili].perso) switch (m_blupi[m_rankHili].perso)
{ {
@ -3233,7 +3233,7 @@ const char *CDecor::GetResHili(POINT posMouse)
if (m_blupi[m_rankHili].bMalade) if (m_blupi[m_rankHili].bMalade)
return gettext ("Sick Blupi"); return gettext ("Sick Blupi");
return gettext ("Blupi"); return gettext ("Blupi");
case 1: // araignée ? case 1: // araignée ?
return gettext ("Spider"); return gettext ("Spider");
case 2: // virus ? case 2: // virus ?
return gettext ("Virus"); return gettext ("Virus");
@ -3279,8 +3279,8 @@ const char *CDecor::GetResHili(POINT posMouse)
return nullptr; return nullptr;
} }
// Indique si le menu est présent et qu'il faut cacher // Indique si le menu est présent et qu'il faut cacher
// les tooltips du décor. // les tooltips du décor.
void CDecor::HideTooltips(bool bHide) void CDecor::HideTooltips(bool bHide)
{ {
@ -3288,7 +3288,7 @@ void CDecor::HideTooltips(bool bHide)
} }
// Modifie l'origine supérieure/gauche du décor. // Modifie l'origine supérieure/gauche du décor.
void CDecor::SetCoin(POINT coin, bool bCenter) void CDecor::SetCoin(POINT coin, bool bCenter)
{ {
@ -3320,7 +3320,7 @@ POINT CDecor::GetHome()
} }
// Mémoirise une position pendant le jeu. // Mémoirise une position pendant le jeu.
void CDecor::MemoPos(int rank, bool bRecord) void CDecor::MemoPos(int rank, bool bRecord)
{ {
@ -3380,7 +3380,7 @@ int CDecor::GetMusic()
} }
// Gestion de la difficulté. // Gestion de la difficulté.
void CDecor::SetSkill(int skill) void CDecor::SetSkill(int skill)
{ {
@ -3393,7 +3393,7 @@ int CDecor::GetSkill()
} }
// Gestion de la région. // Gestion de la région.
// 0 = normal // 0 = normal
// 1 = palmier // 1 = palmier
// 2 = hiver // 2 = hiver
@ -3436,7 +3436,7 @@ int CDecor::GetInfoHeight()
} }
// Retourne le pointeur à la liste des boutons existants. // Retourne le pointeur à la liste des boutons existants.
char* CDecor::GetButtonExist() char* CDecor::GetButtonExist()
{ {
@ -3466,11 +3466,11 @@ void CDecor::UndoClose()
} }
} }
// Copie le décor dans le buffer pour le undo. // Copie le décor dans le buffer pour le undo.
void CDecor::UndoCopy() void CDecor::UndoCopy()
{ {
UndoOpen(); // ouvre le buffer du undo si nécessaire UndoOpen(); // ouvre le buffer du undo si nécessaire
if ( m_pUndoDecor != nullptr ) if ( m_pUndoDecor != nullptr )
{ {
@ -3478,7 +3478,7 @@ void CDecor::UndoCopy()
} }
} }
// Revient en arrière pour tout le décor. // Revient en arrière pour tout le décor.
void CDecor::UndoBack() void CDecor::UndoBack()
{ {

View File

@ -21,7 +21,7 @@
#define ICON_HILI_BUILD 118 #define ICON_HILI_BUILD 118
#define ICON_HILI_ERR 119 #define ICON_HILI_ERR 119
// Descripteur d'une cellule du décor. // Descripteur d'une cellule du décor.
typedef struct typedef struct
{ {
short floorChannel; short floorChannel;
@ -34,36 +34,36 @@ typedef struct
short fire; short fire;
} }
Cellule; Cellule;
// Cette structure doit être la plus petite possible, car // Cette structure doit être la plus petite possible, car
// il en existe un tableau de 100x100 = 10'000 cellules ! // il en existe un tableau de 100x100 = 10'000 cellules !
// Descripteur d'un blupi animé. // Descripteur d'un blupi animé.
#define MAXBLUPI 100 #define MAXBLUPI 100
#define MAXUSED 50 #define MAXUSED 50
#define MAXLIST 10 #define MAXLIST 10
typedef struct typedef struct
{ {
int bExist; // true -> utilisé int bExist; // true -> utilisé
int bHili; // true -> sélectionné int bHili; // true -> sélectionné
short perso; // personnage, voir (*) short perso; // personnage, voir (*)
short goalAction; // action (long terme) short goalAction; // action (long terme)
short goalPhase; // phase (long terme) short goalPhase; // phase (long terme)
POINT goalCel; // cellule visée (long terme) POINT goalCel; // cellule visée (long terme)
POINT passCel; // cellule tranversante POINT passCel; // cellule tranversante
short energy; // énergie restante short energy; // énergie restante
POINT cel; // cellule actuelle POINT cel; // cellule actuelle
POINT destCel; // cellule destination POINT destCel; // cellule destination
short action; // action en cours short action; // action en cours
short aDirect; // direction actuelle short aDirect; // direction actuelle
short sDirect; // direction souhaitée short sDirect; // direction souhaitée
POINT pos; // position relative à partir de la cellule POINT pos; // position relative à partir de la cellule
short posZ; // déplacement z short posZ; // déplacement z
short channel; short channel;
short lastIcon; short lastIcon;
short icon; short icon;
@ -72,12 +72,12 @@ typedef struct
short interrupt; // 0=prioritaire, 1=normal, 2=misc short interrupt; // 0=prioritaire, 1=normal, 2=misc
short clipLeft; short clipLeft;
int nbUsed; // nb de points déjà visités int nbUsed; // nb de points déjà visités
char nextRankUsed; char nextRankUsed;
POINT posUsed[MAXUSED]; POINT posUsed[MAXUSED];
char rankUsed[MAXUSED]; char rankUsed[MAXUSED];
short takeChannel; // objet transporté short takeChannel; // objet transporté
short takeIcon; short takeIcon;
POINT fix; // point fixe (cultive, pont) POINT fix; // point fixe (cultive, pont)
@ -85,15 +85,15 @@ typedef struct
short jaugePhase; short jaugePhase;
short jaugeMax; short jaugeMax;
short stop; // 1 -> devra stopper short stop; // 1 -> devra stopper
short bArrow; // true -> flèche en dessus de blupi short bArrow; // true -> flèche en dessus de blupi
short bRepeat; // true -> répète l'action short bRepeat; // true -> répète l'action
short nLoop; // nb de boucles pour GOAL_OTHERLOOP short nLoop; // nb de boucles pour GOAL_OTHERLOOP
short cLoop; // boucle en cours short cLoop; // boucle en cours
short vIcon; // icône variable short vIcon; // icône variable
POINT goalHili; // but visé POINT goalHili; // but visé
short bMalade; // true -> blupi malade short bMalade; // true -> blupi malade
short bCache; // true -> caché (pas dessiné) short bCache; // true -> caché (pas dessiné)
short vehicule; // véhicule utilisé par blupi, voir (**) short vehicule; // véhicule utilisé par blupi, voir (**)
char busyCount; char busyCount;
char busyDelay; char busyDelay;
char clicCount; char clicCount;
@ -110,31 +110,31 @@ Blupi;
// (*) Personnages : // (*) Personnages :
// 0 -> blupi // 0 -> blupi
// 1 -> araignée // 1 -> araignée
// 2 -> virus // 2 -> virus
// 3 -> tracks // 3 -> tracks
// 4 -> robot // 4 -> robot
// 5 -> bombe // 5 -> bombe
// 6 -> détonnateur de mine (invisible) // 6 -> détonnateur de mine (invisible)
// 7 -> électro // 7 -> électro
// 8 -> disciple (robot2) // 8 -> disciple (robot2)
// (**) Véhicule : // (**) Véhicule :
// 0 -> à pied // 0 -> à pied
// 1 -> en bateau // 1 -> en bateau
// 2 -> en jeep // 2 -> en jeep
// 3 -> armure // 3 -> armure
// Descripteur d'un décor animé. // Descripteur d'un décor animé.
#define MAXMOVE 100 #define MAXMOVE 100
#define MOVEICONNB 1000 #define MOVEICONNB 1000
typedef struct typedef struct
{ {
int bExist; // true -> utilisé int bExist; // true -> utilisé
POINT cel; // cellule du décor POINT cel; // cellule du décor
short rankBlupi; // blupi travaillant ici short rankBlupi; // blupi travaillant ici
int bFloor; // true -> floor, false -> object int bFloor; // true -> floor, false -> object
@ -146,8 +146,8 @@ typedef struct
short rankMoves; // *nb,dx,dy,... short rankMoves; // *nb,dx,dy,...
short rankIcons; // *nb,i,i,... short rankIcons; // *nb,i,i,...
short total; // nb total d'étapes short total; // nb total d'étapes
short delai; // délai entre deux pas short delai; // délai entre deux pas
short stepY; // pas vertical *100 short stepY; // pas vertical *100
short cTotal; short cTotal;
@ -455,13 +455,13 @@ protected:
POINT m_celOutline2; POINT m_celOutline2;
POINT m_shiftOffset; POINT m_shiftOffset;
int m_iconHili[4][4]; int m_iconHili[4][4];
int m_rankHili; // rang du blupi visé int m_rankHili; // rang du blupi visé
bool m_bHiliRect; bool m_bHiliRect;
POINT m_p1Hili; // coins rectangle de sélection POINT m_p1Hili; // coins rectangle de sélection
POINT m_p2Hili; POINT m_p2Hili;
int m_shiftHili; int m_shiftHili;
int m_nbBlupiHili; // nb de blupi sélectionnés int m_nbBlupiHili; // nb de blupi sélectionnés
int m_rankBlupiHili; // rang blupi sélectionné int m_rankBlupiHili; // rang blupi sélectionné
bool m_bFog; // true -> brouillard (jeu) bool m_bFog; // true -> brouillard (jeu)
bool m_bBuild; // true -> construction bool m_bBuild; // true -> construction
bool m_bInvincible; // true -> cheat code bool m_bInvincible; // true -> cheat code
@ -470,30 +470,30 @@ protected:
int m_time; // temps relatif global int m_time; // temps relatif global
int m_timeConst; // temps relatif global constant int m_timeConst; // temps relatif global constant
int m_timeFlipOutline; // temps quand basculer mode outline int m_timeFlipOutline; // temps quand basculer mode outline
int m_totalTime; // temps total passé sur une partie int m_totalTime; // temps total passé sur une partie
int m_phase; // phase pour la carte int m_phase; // phase pour la carte
POINT m_celArrow; // cellule avec flèche POINT m_celArrow; // cellule avec flèche
bool m_bOutline; bool m_bOutline;
bool m_bGroundRedraw; bool m_bGroundRedraw;
char m_buttonExist[MAXBUTTON]; char m_buttonExist[MAXBUTTON];
int m_statNb; // nb de statistiques int m_statNb; // nb de statistiques
int m_statFirst; // première statistique visible int m_statFirst; // première statistique visible
int m_bStatUp; // flèche up statistique int m_bStatUp; // flèche up statistique
int m_bStatDown; // flèche down statistique int m_bStatDown; // flèche down statistique
int m_statHili; // statistique survolée int m_statHili; // statistique survolée
bool m_bStatRecalc; // true -> recalcule les statistiques bool m_bStatRecalc; // true -> recalcule les statistiques
bool m_bStatRedraw; // true -> redessine les statistiques bool m_bStatRedraw; // true -> redessine les statistiques
int m_nbStatHach; // nb de hachures int m_nbStatHach; // nb de hachures
int m_nbStatHachBlupi; // hachures occupées par blupi int m_nbStatHachBlupi; // hachures occupées par blupi
int m_nbStatHachPlanche;// hachures occupées par planches int m_nbStatHachPlanche;// hachures occupées par planches
int m_nbStatHachTomate; // hachures occupées par tomates int m_nbStatHachTomate; // hachures occupées par tomates
int m_nbStatHachMetal; // hachures occupées par métal int m_nbStatHachMetal; // hachures occupées par métal
int m_nbStatHachRobot; // hachures occupées par robot int m_nbStatHachRobot; // hachures occupées par robot
int m_nbStatHome; // nb de maisons int m_nbStatHome; // nb de maisons
int m_nbStatHomeBlupi; // maisons occupées par blupi int m_nbStatHomeBlupi; // maisons occupées par blupi
int m_nbStatRobots; // nb d'ennemis int m_nbStatRobots; // nb d'ennemis
Term m_term; // conditions pour gagner Term m_term; // conditions pour gagner
int m_winCount; // compteur avant gagné int m_winCount; // compteur avant gagné
int m_winLastHachBlupi; // dernier nombre atteint int m_winLastHachBlupi; // dernier nombre atteint
int m_winLastHachPlanche;// dernier nombre atteint int m_winLastHachPlanche;// dernier nombre atteint
int m_winLastHachTomate;// dernier nombre atteint int m_winLastHachTomate;// dernier nombre atteint
@ -502,12 +502,12 @@ protected:
int m_winLastHome; // dernier nombre atteint int m_winLastHome; // dernier nombre atteint
int m_winLastHomeBlupi; // dernier nombre atteint int m_winLastHomeBlupi; // dernier nombre atteint
int m_winLastRobots; // dernier nombre atteint int m_winLastRobots; // dernier nombre atteint
int m_music; // numéro musique int m_music; // numéro musique
int m_region; // numéro région (*) int m_region; // numéro région (*)
int m_lastRegion; // numéro dernière région int m_lastRegion; // numéro dernière région
int m_blupiHere; int m_blupiHere;
POINT m_lastDrapeau[MAXLASTDRAPEAU]; POINT m_lastDrapeau[MAXLASTDRAPEAU];
bool m_bHideTooltips; // true -> menu présent bool m_bHideTooltips; // true -> menu présent
char m_text[50]; char m_text[50];
POINT m_textLastPos; POINT m_textLastPos;
int m_textCount; int m_textCount;
@ -529,7 +529,7 @@ protected:
char* m_pFillMap; char* m_pFillMap;
}; };
// (*) Régions : // (*) Régions :
// 0 -> normal // 0 -> normal
// 1 -> palmier // 1 -> palmier
// 2 -> hiver // 2 -> hiver

View File

@ -25,9 +25,9 @@
typedef struct typedef struct
{ {
short bExist; short bExist;
short perso; // -1=objet, -2=feu, -3=flèche short perso; // -1=objet, -2=feu, -3=flèche
short firstIcon; // négatif si sol short firstIcon; // négatif si sol
short lastIcon; // négatif si sol short lastIcon; // négatif si sol
short drawIcon; short drawIcon;
short bBigIcon; short bBigIcon;
const char *text; const char *text;
@ -50,7 +50,7 @@ static Statistic table_statistic[] =
}, },
{ // STATBLUPIf = 1 { // STATBLUPIf = 1
true, true,
0, // blupi fatigué 0, // blupi fatigué
0,0, // 0,0, //
13, 13,
false, false,
@ -59,7 +59,7 @@ static Statistic table_statistic[] =
}, },
{ // STATBLUPI = 2 { // STATBLUPI = 2
true, true,
0, // blupi énergique 0, // blupi énergique
0,0, // 0,0, //
14, 14,
false, false,
@ -105,7 +105,7 @@ static Statistic table_statistic[] =
{ // 7 { // 7
true, true,
-1, // objet -1, // objet
93,93, // piège 93,93, // piège
70, 70,
false, false,
translate ("Sticky trap"), translate ("Sticky trap"),
@ -240,7 +240,7 @@ static Statistic table_statistic[] =
{ // 22 { // 22
true, true,
-1, // objet -1, // objet
-80,-84, // téléporteur -80,-84, // téléporteur
101, 101,
false, false,
translate ("Teleporter"), translate ("Teleporter"),
@ -320,7 +320,7 @@ static Statistic table_statistic[] =
}, },
{ // STATARAIGNEE = 31 { // STATARAIGNEE = 31
true, true,
1, // araignée 1, // araignée
0,0, // 0,0, //
15, 15,
false, false,
@ -338,7 +338,7 @@ static Statistic table_statistic[] =
}, },
{ // STATELECTRO = 33 { // STATELECTRO = 33
true, true,
7, // électro 7, // électro
0,0, // 0,0, //
75, 75,
false, false,
@ -358,7 +358,7 @@ static Statistic table_statistic[] =
}; };
// Retourne la statistique correspondant à un rang donné. // Retourne la statistique correspondant à un rang donné.
Statistic* StatisticGet(int rank) Statistic* StatisticGet(int rank)
{ {
@ -385,7 +385,7 @@ Statistic* StatisticGet(int rank)
// Réinitialise les statistiques. // Réinitialise les statistiques.
void CDecor::StatisticInit() void CDecor::StatisticInit()
{ {
@ -408,7 +408,7 @@ void CDecor::StatisticInit()
} }
// Met à jour tous les compteurs des statistiques. // Met à jour tous les compteurs des statistiques.
void CDecor::StatisticUpdate() void CDecor::StatisticUpdate()
{ {
@ -457,7 +457,7 @@ void CDecor::StatisticUpdate()
x = (m_blupi[rank].cel.x/2)*2; x = (m_blupi[rank].cel.x/2)*2;
y = (m_blupi[rank].cel.y/2)*2; y = (m_blupi[rank].cel.y/2)*2;
if ( m_decor[x/2][y/2].floorChannel == CHFLOOR && if ( m_decor[x/2][y/2].floorChannel == CHFLOOR &&
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ? m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
{ {
m_nbStatHachBlupi ++; m_nbStatHachBlupi ++;
} }
@ -478,7 +478,7 @@ void CDecor::StatisticUpdate()
x = (m_blupi[rank].cel.x/2)*2; x = (m_blupi[rank].cel.x/2)*2;
y = (m_blupi[rank].cel.y/2)*2; y = (m_blupi[rank].cel.y/2)*2;
if ( m_decor[x/2][y/2].floorChannel == CHFLOOR && if ( m_decor[x/2][y/2].floorChannel == CHFLOOR &&
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ? m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
{ {
m_nbStatHachRobot ++; m_nbStatHachRobot ++;
} }
@ -491,7 +491,7 @@ void CDecor::StatisticUpdate()
m_nbStatRobots ++; m_nbStatRobots ++;
} }
} }
if ( m_blupi[rank].perso == 1 ) // araignée ? if ( m_blupi[rank].perso == 1 ) // araignée ?
{ {
table_statistic[STATARAIGNEE].nb ++; table_statistic[STATARAIGNEE].nb ++;
if ( !m_term.bHachRobot ) // pas robot sur hachures ? if ( !m_term.bHachRobot ) // pas robot sur hachures ?
@ -511,7 +511,7 @@ void CDecor::StatisticUpdate()
m_nbStatRobots ++; m_nbStatRobots ++;
} }
} }
if ( m_blupi[rank].perso == 7 ) // électro ? if ( m_blupi[rank].perso == 7 ) // électro ?
{ {
table_statistic[STATELECTRO].nb ++; table_statistic[STATELECTRO].nb ++;
if ( !m_term.bHachRobot ) // pas robot sur hachures ? if ( !m_term.bHachRobot ) // pas robot sur hachures ?
@ -528,7 +528,7 @@ void CDecor::StatisticUpdate()
{ {
bHach = false; bHach = false;
if ( m_decor[x/2][y/2].floorChannel == CHFLOOR && if ( m_decor[x/2][y/2].floorChannel == CHFLOOR &&
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ? m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
{ {
bHach = true; bHach = true;
m_nbStatHach ++; m_nbStatHach ++;
@ -566,7 +566,7 @@ void CDecor::StatisticUpdate()
{ {
m_nbStatHachTomate ++; m_nbStatHachTomate ++;
} }
if ( icon == 14 && bHach ) // métal ? if ( icon == 14 && bHach ) // métal ?
{ {
m_nbStatHachMetal ++; m_nbStatHachMetal ++;
} }
@ -577,7 +577,7 @@ void CDecor::StatisticUpdate()
icon = m_decor[x/2][y/2].floorIcon; icon = m_decor[x/2][y/2].floorIcon;
if ( (icon >= 52 && icon <= 56) || // couveuse ? if ( (icon >= 52 && icon <= 56) || // couveuse ?
(icon >= 80 && icon <= 84) ) // téléporteur ? (icon >= 80 && icon <= 84) ) // téléporteur ?
{ {
pStatistic = table_statistic; pStatistic = table_statistic;
while ( pStatistic->bExist ) while ( pStatistic->bExist )
@ -621,7 +621,7 @@ void CDecor::StatisticUpdate()
} }
else else
{ {
// nb <- nb de pages nécessaires // nb <- nb de pages nécessaires
nb = (m_statNb+STATNB-5)/(STATNB-2); nb = (m_statNb+STATNB-5)/(STATNB-2);
m_bStatUp = true; m_bStatUp = true;
@ -637,7 +637,7 @@ void CDecor::StatisticUpdate()
} }
} }
m_bStatRecalc = false; // c'est calculé m_bStatRecalc = false; // c'est calculé
m_bStatRedraw = true; // faudra tout redessiner m_bStatRedraw = true; // faudra tout redessiner
} }
@ -700,28 +700,28 @@ void CDecor::StatisticDraw()
if ( rank == 0 && m_bStatUp ) if ( rank == 0 && m_bStatUp )
{ {
icon = 6+66; // flèche up icon = 6+66; // flèche up
if ( rank == m_statHili ) // statistique survolée ? if ( rank == m_statHili ) // statistique survolée ?
{ {
icon ++; icon ++;
} }
pos.x -= 3; pos.x -= 3;
pos.y -= 5; pos.y -= 5;
if ( pStatistic->drawIcon == 68 ) pos.x += 26; if ( pStatistic->drawIcon == 68 ) pos.x += 26;
m_pPixmap->DrawIcon(-1, CHBUTTON, icon, pos); // flèche up m_pPixmap->DrawIcon(-1, CHBUTTON, icon, pos); // flèche up
continue; continue;
} }
if ( rank == STATNB-1 && m_bStatDown ) if ( rank == STATNB-1 && m_bStatDown )
{ {
icon = 6+68; // flèche down icon = 6+68; // flèche down
if ( rank == m_statHili ) // statistique survolée ? if ( rank == m_statHili ) // statistique survolée ?
{ {
icon ++; icon ++;
} }
pos.x += 23; pos.x += 23;
pos.y -= 5; pos.y -= 5;
m_pPixmap->DrawIcon(-1, CHBUTTON, icon, pos); // flèche down m_pPixmap->DrawIcon(-1, CHBUTTON, icon, pos); // flèche down
continue; continue;
} }
@ -729,7 +729,7 @@ void CDecor::StatisticDraw()
icon = 6+pStatistic->drawIcon; icon = 6+pStatistic->drawIcon;
if ( rank == m_statHili ) // statistique survolée ? if ( rank == m_statHili ) // statistique survolée ?
{ {
m_pPixmap->DrawIconDemi(-1, CHBLUPI, ICON_HILI_STAT, pos); m_pPixmap->DrawIconDemi(-1, CHBLUPI, ICON_HILI_STAT, pos);
textRes = gettext (pStatistic->text); textRes = gettext (pStatistic->text);
@ -764,7 +764,7 @@ void CDecor::StatisticDraw()
if ( m_statHili == 102 ) textRes = gettext ("Save"); if ( m_statHili == 102 ) textRes = gettext ("Save");
} }
// Dessine le nom de la statistique survolée. // Dessine le nom de la statistique survolée.
pos.x = 0; pos.x = 0;
pos.y = 404; pos.y = 404;
rect.left = pos.x; rect.left = pos.x;
@ -780,10 +780,10 @@ void CDecor::StatisticDraw()
DrawText(m_pPixmap, pos, textRes); DrawText(m_pPixmap, pos, textRes);
} }
m_bStatRedraw = false; // dessin plus nécessaire m_bStatRedraw = false; // dessin plus nécessaire
} }
// Génère les statistiques. // Génère les statistiques.
void CDecor::GenerateStatictic() void CDecor::GenerateStatictic()
{ {
@ -791,7 +791,7 @@ void CDecor::GenerateStatictic()
if ( m_bStatRecalc || m_phase%20 == 10 ) if ( m_bStatRecalc || m_phase%20 == 10 )
{ {
StatisticUpdate(); // met à jour les compteurs StatisticUpdate(); // met à jour les compteurs
} }
if ( m_bStatRedraw ) if ( m_bStatRedraw )
@ -801,7 +801,7 @@ void CDecor::GenerateStatictic()
} }
// Bouton pressé dans les statistiques. // Bouton pressé dans les statistiques.
bool CDecor::StatisticDown(POINT pos) bool CDecor::StatisticDown(POINT pos)
{ {
@ -814,7 +814,7 @@ bool CDecor::StatisticDown(POINT pos)
hili = StatisticDetect(pos); hili = StatisticDetect(pos);
if ( hili < 0 ) return false; if ( hili < 0 ) return false;
if ( m_bStatUp && hili == 0 ) // flèche up ? if ( m_bStatUp && hili == 0 ) // flèche up ?
{ {
m_statFirst -= STATNB-2; m_statFirst -= STATNB-2;
if ( m_statFirst < STATNB-1 ) if ( m_statFirst < STATNB-1 )
@ -828,7 +828,7 @@ bool CDecor::StatisticDown(POINT pos)
return true; return true;
} }
if ( m_bStatDown && hili == STATNB-1 ) // flèche down ? if ( m_bStatDown && hili == STATNB-1 ) // flèche down ?
{ {
if ( m_statFirst == 0 ) if ( m_statFirst == 0 )
{ {
@ -853,7 +853,7 @@ bool CDecor::StatisticDown(POINT pos)
show = pStatistic->lastShow % pStatistic->nb; show = pStatistic->lastShow % pStatistic->nb;
pStatistic->lastShow ++; pStatistic->lastShow ++;
if ( pStatistic->perso >= 0 ) // blupi/araignée ? if ( pStatistic->perso >= 0 ) // blupi/araignée ?
{ {
for ( rank=0 ; rank<MAXBLUPI ; rank++ ) for ( rank=0 ; rank<MAXBLUPI ; rank++ )
{ {
@ -867,9 +867,9 @@ bool CDecor::StatisticDown(POINT pos)
pStatistic->drawIcon == 76) || // malade ? pStatistic->drawIcon == 76) || // malade ?
(!m_blupi[rank].bMalade && (!m_blupi[rank].bMalade &&
m_blupi[rank].energy <= MAXENERGY/4 && m_blupi[rank].energy <= MAXENERGY/4 &&
pStatistic->drawIcon == 13) || // fatigué ? pStatistic->drawIcon == 13) || // fatigué ?
(m_blupi[rank].energy > MAXENERGY/4 && (m_blupi[rank].energy > MAXENERGY/4 &&
pStatistic->drawIcon == 14) ) // énergique ? pStatistic->drawIcon == 14) ) // énergique ?
{ {
if ( show == 0 ) if ( show == 0 )
{ {
@ -878,7 +878,7 @@ bool CDecor::StatisticDown(POINT pos)
{ {
BlupiDeselect(); BlupiDeselect();
m_blupi[rank].bHili = true; m_blupi[rank].bHili = true;
m_rankBlupiHili = rank; // sélectionne m_rankBlupiHili = rank; // sélectionne
m_nbBlupiHili = 1; m_nbBlupiHili = 1;
} }
BlupiSetArrow(rank, true); BlupiSetArrow(rank, true);
@ -910,7 +910,7 @@ bool CDecor::StatisticDown(POINT pos)
cel = GetCel(x,y); cel = GetCel(x,y);
if ( pStatistic->bBigIcon ) if ( pStatistic->bBigIcon )
{ {
// Flèche plus haute. // Flèche plus haute.
m_celArrow = GetCel(cel,-2,-2); m_celArrow = GetCel(cel,-2,-2);
} }
else else
@ -945,7 +945,7 @@ bool CDecor::StatisticDown(POINT pos)
cel = GetCel(x,y); cel = GetCel(x,y);
if ( pStatistic->bBigIcon ) if ( pStatistic->bBigIcon )
{ {
// Flèche plus haute. // Flèche plus haute.
m_celArrow = GetCel(cel,-2,-2); m_celArrow = GetCel(cel,-2,-2);
} }
else else
@ -990,7 +990,7 @@ bool CDecor::StatisticDown(POINT pos)
return true; return true;
} }
// Souris déplacée dans les statistiques. // Souris déplacée dans les statistiques.
bool CDecor::StatisticMove(POINT pos) bool CDecor::StatisticMove(POINT pos)
{ {
@ -998,7 +998,7 @@ bool CDecor::StatisticMove(POINT pos)
rank = StatisticDetect(pos); rank = StatisticDetect(pos);
if ( rank != m_statHili ) // autre mise en évidence ? if ( rank != m_statHili ) // autre mise en évidence ?
{ {
m_statHili = rank; m_statHili = rank;
m_bStatRedraw = true; // faudra tout redessiner m_bStatRedraw = true; // faudra tout redessiner
@ -1007,14 +1007,14 @@ bool CDecor::StatisticMove(POINT pos)
return false; return false;
} }
// Bouton relâché dans les statistiques. // Bouton relâché dans les statistiques.
bool CDecor::StatisticUp(POINT pos) bool CDecor::StatisticUp(POINT pos)
{ {
return false; return false;
} }
// Détecte dans quelle statistique est la souris. // Détecte dans quelle statistique est la souris.
int CDecor::StatisticDetect(POINT pos) int CDecor::StatisticDetect(POINT pos)
{ {

106
src/def.h
View File

@ -6,7 +6,7 @@
#define _INTRO false // true si images d'introduction #define _INTRO false // true si images d'introduction
#define LXIMAGE 640 // dimensions de la fenêtre de jeu #define LXIMAGE 640 // dimensions de la fenêtre de jeu
#define LYIMAGE 480 #define LYIMAGE 480
#define POSDRAWX 144 // surface de dessin #define POSDRAWX 144 // surface de dessin
@ -22,7 +22,7 @@
#define MAXCELX 200 // nb max de cellules d'un monde #define MAXCELX 200 // nb max de cellules d'un monde
#define MAXCELY 200 #define MAXCELY 200
#define DIMCELX 60 // dimensions d'une cellule (décor) #define DIMCELX 60 // dimensions d'une cellule (décor)
#define DIMCELY 30 #define DIMCELY 30
#define DIMOBJX 120 // dimensions d'un objet #define DIMOBJX 120 // dimensions d'un objet
@ -30,7 +30,7 @@
#define DIMBLUPIX 60 // dimensions de blupi #define DIMBLUPIX 60 // dimensions de blupi
#define DIMBLUPIY 60 #define DIMBLUPIY 60
#define SHIFTBLUPIY 5 // petit décalage vers le haut #define SHIFTBLUPIY 5 // petit décalage vers le haut
#define DIMBUTTONX 40 // dimensions d'un button #define DIMBUTTONX 40 // dimensions d'un button
#define DIMBUTTONY 40 #define DIMBUTTONY 40
@ -43,10 +43,10 @@
#define DIMSTATX 60 #define DIMSTATX 60
#define DIMSTATY 30 #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 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 DIMLITTLEY 12
#define CHBACK 0 #define CHBACK 0
@ -95,15 +95,15 @@
// Actions : // Actions :
#define ACTION_STOP 0 // arrêt #define ACTION_STOP 0 // arrêt
#define ACTION_STOPf 1 // arrêt fatigué #define ACTION_STOPf 1 // arrêt fatigué
#define ACTION_MARCHE 2 // marche #define ACTION_MARCHE 2 // marche
#define ACTION_MARCHEf 3 // marche fatigué #define ACTION_MARCHEf 3 // marche fatigué
#define ACTION_BUILD 4 // construit #define ACTION_BUILD 4 // construit
#define ACTION_PIOCHE 5 // pioche #define ACTION_PIOCHE 5 // pioche
#define ACTION_ENERGY 6 // prend de l'énergie #define ACTION_ENERGY 6 // prend de l'énergie
#define ACTION_TAKE 8 // fait sauter un objet sur la tête (est) #define ACTION_TAKE 8 // fait sauter un objet sur la tête (est)
#define ACTION_DEPOSE 9 // repose l'objet sur la tête (est) #define ACTION_DEPOSE 9 // repose l'objet sur la tête (est)
#define ACTION_SCIE 10 // scie du bois #define ACTION_SCIE 10 // scie du bois
#define ACTION_BRULE 11 // blupi crame ! #define ACTION_BRULE 11 // blupi crame !
#define ACTION_TCHAO 12 // blupi disparait ! #define ACTION_TCHAO 12 // blupi disparait !
@ -114,30 +114,30 @@
#define ACTION_SAUTE4 17 // saute par-dessus un obstacle #define ACTION_SAUTE4 17 // saute par-dessus un obstacle
#define ACTION_SAUTE5 18 // saute par-dessus un obstacle #define ACTION_SAUTE5 18 // saute par-dessus un obstacle
#define ACTION_PONT 19 // pousse un pont #define ACTION_PONT 19 // pousse un pont
#define ACTION_MISC1 20 // divers 1 (hausse les épaules) #define ACTION_MISC1 20 // divers 1 (hausse les épaules)
#define ACTION_MISC2 21 // divers 2 (grat-grat) #define ACTION_MISC2 21 // divers 2 (grat-grat)
#define ACTION_MISC3 22 // divers 3 (yoyo) #define ACTION_MISC3 22 // divers 3 (yoyo)
#define ACTION_MISC1f 23 // divers 1 fatigué (bof-bof) #define ACTION_MISC1f 23 // divers 1 fatigué (bof-bof)
#define ACTION_GLISSE 24 // glisse en marchant #define ACTION_GLISSE 24 // glisse en marchant
#define ACTION_BOIT 25 // blupi boit #define ACTION_BOIT 25 // blupi boit
#define ACTION_LABO 26 // blupi travaille dans son laboratoire #define ACTION_LABO 26 // blupi travaille dans son laboratoire
#define ACTION_DYNAMITE 27 // blupi fait péter la dynamite #define ACTION_DYNAMITE 27 // blupi fait péter la dynamite
#define ACTION_DELAY 28 // blupi attend un frame #define ACTION_DELAY 28 // blupi attend un frame
#define ACTION_CUEILLE1 29 // blupi cueille des fleurs #define ACTION_CUEILLE1 29 // blupi cueille des fleurs
#define ACTION_CUEILLE2 30 // blupi cueille des fleurs #define ACTION_CUEILLE2 30 // blupi cueille des fleurs
#define ACTION_MECHE 31 // blupi se bouche les oreilles #define ACTION_MECHE 31 // blupi se bouche les oreilles
#define ACTION_STOPb 32 // arrêt en bateau #define ACTION_STOPb 32 // arrêt en bateau
#define ACTION_MARCHEb 33 // avance en bateau #define ACTION_MARCHEb 33 // avance en bateau
#define ACTION_STOPj 34 // arrêt en jeep #define ACTION_STOPj 34 // arrêt en jeep
#define ACTION_MARCHEj 35 // avance en jeep #define ACTION_MARCHEj 35 // avance en jeep
#define ACTION_ELECTRO 36 // blupi électrocuté #define ACTION_ELECTRO 36 // blupi électrocuté
#define ACTION_GRILLE1 37 // blupi grille (phase 1) #define ACTION_GRILLE1 37 // blupi grille (phase 1)
#define ACTION_GRILLE2 38 // blupi grille (phase 2) #define ACTION_GRILLE2 38 // blupi grille (phase 2)
#define ACTION_GRILLE3 39 // blupi grille (phase 3) #define ACTION_GRILLE3 39 // blupi grille (phase 3)
#define ACTION_MISC4 40 // divers 4 (ferme les yeux) #define ACTION_MISC4 40 // divers 4 (ferme les yeux)
#define ACTION_CONTENT 41 // blupi est content #define ACTION_CONTENT 41 // blupi est content
#define ACTION_ARROSE 42 // blupi arrose #define ACTION_ARROSE 42 // blupi arrose
#define ACTION_BECHE 43 // blupi bèche #define ACTION_BECHE 43 // blupi bèche
#define ACTION_CUEILLE3 44 // blupi cueille des fleurs #define ACTION_CUEILLE3 44 // blupi cueille des fleurs
#define ACTION_BUILDBREF 45 // construit #define ACTION_BUILDBREF 45 // construit
#define ACTION_BUILDSEC 46 // construit #define ACTION_BUILDSEC 46 // construit
@ -145,53 +145,53 @@
#define ACTION_BUILDPIERRE 48 // construit #define ACTION_BUILDPIERRE 48 // construit
#define ACTION_PIOCHEPIERRE 49 // pioche #define ACTION_PIOCHEPIERRE 49 // pioche
#define ACTION_PIOCHESOURD 50 // pioche #define ACTION_PIOCHESOURD 50 // pioche
#define ACTION_MISC5 51 // divers 5 (ohé) #define ACTION_MISC5 51 // divers 5 (ohé)
#define ACTION_TELEPORTE1 52 // téléporte #define ACTION_TELEPORTE1 52 // téléporte
#define ACTION_TELEPORTE2 53 // téléporte #define ACTION_TELEPORTE2 53 // téléporte
#define ACTION_TELEPORTE3 54 // téléporte #define ACTION_TELEPORTE3 54 // téléporte
#define ACTION_STOPa 55 // arrêt armure #define ACTION_STOPa 55 // arrêt armure
#define ACTION_MARCHEa 56 // marche armure #define ACTION_MARCHEa 56 // marche armure
#define ACTION_ARMUREOPEN 57 // ouvre armure #define ACTION_ARMUREOPEN 57 // ouvre armure
#define ACTION_ARMURECLOSE 58 // ferme armure #define ACTION_ARMURECLOSE 58 // ferme armure
#define ACTION_SAUTE1 59 // saute dans la jeep #define ACTION_SAUTE1 59 // saute dans la jeep
#define ACTION_MISC6 60 // divers 6 (diabolo) #define ACTION_MISC6 60 // divers 6 (diabolo)
#define ACTION_A_STOP 100 // araignée: arrêt #define ACTION_A_STOP 100 // araignée: arrêt
#define ACTION_A_MARCHE 101 // araignée: marche #define ACTION_A_MARCHE 101 // araignée: marche
#define ACTION_A_SAUT 102 // araignée: saute #define ACTION_A_SAUT 102 // araignée: saute
#define ACTION_A_GRILLE 103 // araignée: grille dans rayon #define ACTION_A_GRILLE 103 // araignée: grille dans rayon
#define ACTION_A_POISON 105 // araignée: empoisonée #define ACTION_A_POISON 105 // araignée: empoisonée
#define ACTION_A_MORT1 106 // araignée: meurt #define ACTION_A_MORT1 106 // araignée: meurt
#define ACTION_A_MORT2 107 // araignée: meurt #define ACTION_A_MORT2 107 // araignée: meurt
#define ACTION_A_MORT3 108 // araignée: meurt #define ACTION_A_MORT3 108 // araignée: meurt
#define ACTION_V_STOP 200 // virus: arrêt #define ACTION_V_STOP 200 // virus: arrêt
#define ACTION_V_MARCHE 201 // virus: marche #define ACTION_V_MARCHE 201 // virus: marche
#define ACTION_V_GRILLE 202 // virus: grille dans rayon #define ACTION_V_GRILLE 202 // virus: grille dans rayon
#define ACTION_T_STOP 300 // tracks: arrêt #define ACTION_T_STOP 300 // tracks: arrêt
#define ACTION_T_MARCHE 301 // tracks: marche #define ACTION_T_MARCHE 301 // tracks: marche
#define ACTION_T_ECRASE 302 // tracks: écrase un objet #define ACTION_T_ECRASE 302 // tracks: écrase un objet
#define ACTION_R_STOP 400 // robot: arrêt #define ACTION_R_STOP 400 // robot: arrêt
#define ACTION_R_MARCHE 401 // robot: marche #define ACTION_R_MARCHE 401 // robot: marche
#define ACTION_R_APLAT 402 // robot: applatit #define ACTION_R_APLAT 402 // robot: applatit
#define ACTION_R_BUILD 403 // robot: construit #define ACTION_R_BUILD 403 // robot: construit
#define ACTION_R_DELAY 404 // robot: construit #define ACTION_R_DELAY 404 // robot: construit
#define ACTION_R_CHARGE 405 // robot: recharge #define ACTION_R_CHARGE 405 // robot: recharge
#define ACTION_R_ECRASE 406 // robot: écrase un objet #define ACTION_R_ECRASE 406 // robot: écrase un objet
#define ACTION_B_STOP 500 // bombe: arrêt #define ACTION_B_STOP 500 // bombe: arrêt
#define ACTION_B_MARCHE 501 // bombe: marche #define ACTION_B_MARCHE 501 // bombe: marche
#define ACTION_D_DELAY 600 // détonnateur: attend #define ACTION_D_DELAY 600 // détonnateur: attend
#define ACTION_E_STOP 700 // électro: arrêt #define ACTION_E_STOP 700 // électro: arrêt
#define ACTION_E_MARCHE 701 // électro: marche #define ACTION_E_MARCHE 701 // électro: marche
#define ACTION_E_DEBUT 702 // électro: débute #define ACTION_E_DEBUT 702 // électro: débute
#define ACTION_E_RAYON 703 // électro: rayonne #define ACTION_E_RAYON 703 // électro: rayonne
#define ACTION_D_STOP 800 // disciple: arrêt #define ACTION_D_STOP 800 // disciple: arrêt
#define ACTION_D_MARCHE 801 // disciple: marche #define ACTION_D_MARCHE 801 // disciple: marche
#define ACTION_D_BUILD 802 // disciple: construit #define ACTION_D_BUILD 802 // disciple: construit
#define ACTION_D_PIOCHE 803 // disciple: pioche #define ACTION_D_PIOCHE 803 // disciple: pioche
@ -201,7 +201,7 @@
#define ACTION_D_CUEILLE2 807 // disciple: cueille des fleurs #define ACTION_D_CUEILLE2 807 // disciple: cueille des fleurs
#define ACTION_D_MECHE 808 // disciple: se bouche les oreilles #define ACTION_D_MECHE 808 // disciple: se bouche les oreilles
#define ACTION_D_ARROSE 809 // disciple: arrose #define ACTION_D_ARROSE 809 // disciple: arrose
#define ACTION_D_BECHE 810 // disciple: bèche #define ACTION_D_BECHE 810 // disciple: bèche
// Sons : // Sons :
@ -603,16 +603,16 @@ enum MouseSprites
typedef struct typedef struct
{ {
short bHachBlupi; // blupi sur dalle hachurée short bHachBlupi; // blupi sur dalle hachurée
short bHachPlanche; // planches sur dalle hachurée short bHachPlanche; // planches sur dalle hachurée
short bStopFire; // feu éteint short bStopFire; // feu éteint
short nbMinBlupi; // nb de blupi nécessaires short nbMinBlupi; // nb de blupi nécessaires
short nbMaxBlupi; // nb de blupi nécessaires short nbMaxBlupi; // nb de blupi nécessaires
short bHomeBlupi; // blupi à la maison short bHomeBlupi; // blupi à la maison
short bKillRobots; // plus d'ennemis short bKillRobots; // plus d'ennemis
short bHachTomate; // tomates sur dalle hachurée short bHachTomate; // tomates sur dalle hachurée
short bHachMetal; // métal sur dalle hachurée short bHachMetal; // métal sur dalle hachurée
short bHachRobot; // robot sur dalle hachurée short bHachRobot; // robot sur dalle hachurée
short reserve[14]; short reserve[14];
} }
Term; Term;

View File

@ -41,7 +41,7 @@ typedef struct
short mission; // mission en cours (0..n) short mission; // mission en cours (0..n)
short speed; short speed;
short bMovie; short bMovie;
short maxMission; // dernière mission effectuée (0..n) short maxMission; // dernière mission effectuée (0..n)
short scrollSpeed; short scrollSpeed;
short audioVolume; short audioVolume;
short midiVolume; short midiVolume;
@ -54,8 +54,8 @@ DescInfo;
// Toutes les premières lettres doivent // Toutes les premières lettres doivent
// être différentes ! // être différentes !
static char cheat_code[9][20] = static char cheat_code[9][20] =
{ {
@ -960,7 +960,7 @@ static Phase table[] =
{ translate ("Drop") }, { translate ("Drop") },
}, },
{ {
WM_BUTTON32, // répète WM_BUTTON32, // répète
0, {1,100}, 0, {1,100},
170+42*6, 30+52*0, 170+42*6, 30+52*0,
{ translate ("Repeat") }, { translate ("Repeat") },
@ -1028,7 +1028,7 @@ static Phase table[] =
{ translate ("Boat") }, { translate ("Boat") },
}, },
{ {
WM_BUTTON13, // build6 (téléporteur) WM_BUTTON13, // build6 (téléporteur)
0, {1,101}, 0, {1,101},
170+42*4, 30+52*2, 170+42*4, 30+52*2,
{ translate ("Teleporter") }, { translate ("Teleporter") },
@ -1192,7 +1192,7 @@ static Phase table[] =
{ translate ("Tomatoes on striped paving stones") }, { translate ("Tomatoes on striped paving stones") },
}, },
{ {
WM_BUTTON11, // hach métal WM_BUTTON11, // hach métal
0, {1,84}, 0, {1,84},
170+42*3, 30+42*2, 170+42*3, 30+42*2,
{ translate ("Platinium on striped paving stones") }, { translate ("Platinium on striped paving stones") },
@ -1548,7 +1548,7 @@ void CEvent::SetMouseType(int mouseType)
m_mouseType = mouseType; m_mouseType = mouseType;
} }
// Crée le gestionnaire d'événements. // Crée le gestionnaire d'événements.
void CEvent::Create(CPixmap *pPixmap, CDecor *pDecor, void CEvent::Create(CPixmap *pPixmap, CDecor *pDecor,
CSound *pSound, CMovie *pMovie) CSound *pSound, CMovie *pMovie)
@ -1671,7 +1671,7 @@ void CEvent::SetMenu(int button, int menu)
// Restitue le jeu après une activation en mode fullScreen. // Restitue le jeu après une activation en mode fullScreen.
void CEvent::RestoreGame() void CEvent::RestoreGame()
{ {
@ -1698,7 +1698,7 @@ void CEvent::RestoreGame()
} }
// Crée tous les boutons nécessaires à la phase en cours. // Crée tous les boutons nécessaires à la phase en cours.
bool CEvent::CreateButtons() bool CEvent::CreateButtons()
{ {
@ -1764,7 +1764,7 @@ void AddCheatCode(char *pDst, char *pSrc)
pDst[j] = 0; pDst[j] = 0;
} }
// Dessine un texte multi-lignes centré. // Dessine un texte multi-lignes centré.
void CEvent::DrawTextCenter(const char *text, int x, int y, int font) void CEvent::DrawTextCenter(const char *text, int x, int y, int font)
{ {
@ -1948,11 +1948,11 @@ bool CEvent::DrawButtons()
} }
else else
{ {
if ( m_bDemoRec ) // démo en enregistrement ? if ( m_bDemoRec ) // démo en enregistrement ?
{ {
DrawTextCenter(gettext ("REC"), (10+134)/2, 20, FONTRED); DrawTextCenter(gettext ("REC"), (10+134)/2, 20, FONTRED);
} }
if ( m_bDemoPlay ) // démo en restitution ? if ( m_bDemoPlay ) // démo en restitution ?
{ {
DrawTextCenter(gettext ("Demo"), (10+134)/2, 20, FONTRED); DrawTextCenter(gettext ("Demo"), (10+134)/2, 20, FONTRED);
} }
@ -2026,7 +2026,7 @@ bool CEvent::DrawButtons()
m_pPixmap->DrawIcon(-1, CHBUTTON, icon, m_posHelpButton); m_pPixmap->DrawIcon(-1, CHBUTTON, icon, m_posHelpButton);
} }
} }
else // infos cachées ? else // infos cachées ?
{ {
pos.x = POSDRAWX+DIMDRAWX/2-DIMBUTTONX/2; pos.x = POSDRAWX+DIMDRAWX/2-DIMBUTTONX/2;
pos.y = -12; pos.y = -12;
@ -2078,7 +2078,7 @@ bool CEvent::DrawButtons()
} }
} }
// Dessine les réglages pour la fin de la partie. // Dessine les réglages pour la fin de la partie.
if ( m_phase == WM_PHASE_TERM ) if ( m_phase == WM_PHASE_TERM )
{ {
Term* pTerm = m_pDecor->GetTerminated(); Term* pTerm = m_pDecor->GetTerminated();
@ -2108,13 +2108,13 @@ bool CEvent::DrawButtons()
DrawTextCenter(gettext ("Music choice"), (10+134)/2, 20); DrawTextCenter(gettext ("Music choice"), (10+134)/2, 20);
} }
// Dessine les textes pour le choix de la région. // Dessine les textes pour le choix de la région.
if ( m_phase == WM_PHASE_REGION ) if ( m_phase == WM_PHASE_REGION )
{ {
DrawTextCenter(gettext ("Scenery choice"), (10+134)/2, 20); DrawTextCenter(gettext ("Scenery choice"), (10+134)/2, 20);
} }
// Ajoute "Mission numéro". // Ajoute "Mission numéro".
if ( m_phase == WM_PHASE_INFO ) if ( m_phase == WM_PHASE_INFO )
{ {
if (m_bSchool) if (m_bSchool)
@ -2147,7 +2147,7 @@ bool CEvent::DrawButtons()
DrawText(m_pPixmap, pos, text, FONTRED); DrawText(m_pPixmap, pos, text, FONTRED);
} }
// Ajoute le texte "Informations complémentaires". // Ajoute le texte "Informations complémentaires".
if ( m_phase == WM_PHASE_HELP ) if ( m_phase == WM_PHASE_HELP )
{ {
char *text = gettext ("Help number"); char *text = gettext ("Help number");
@ -2160,7 +2160,7 @@ bool CEvent::DrawButtons()
DrawText(m_pPixmap, pos, text, FONTRED); DrawText(m_pPixmap, pos, text, FONTRED);
} }
// Ajoute le numéro du monde. // Ajoute le numéro du monde.
if ( m_phase == WM_PHASE_INFO || if ( m_phase == WM_PHASE_INFO ||
m_phase == WM_PHASE_STOP || m_phase == WM_PHASE_STOP ||
m_phase == WM_PHASE_HELP ) m_phase == WM_PHASE_HELP )
@ -2215,7 +2215,7 @@ bool CEvent::DrawButtons()
} }
} }
// Affiche le libellé de l'énigme. // Affiche le libellé de l'énigme.
if ( m_phase == WM_PHASE_INFO || if ( m_phase == WM_PHASE_INFO ||
m_phase == WM_PHASE_STOP || m_phase == WM_PHASE_STOP ||
m_phase == WM_PHASE_HELP || m_phase == WM_PHASE_HELP ||
@ -2235,7 +2235,7 @@ bool CEvent::DrawButtons()
DrawTextRect(m_pPixmap, pos, m_libelle, pente, FONTSLIM); DrawTextRect(m_pPixmap, pos, m_libelle, pente, FONTSLIM);
} }
// Affiche le texte lorsque c'est raté. // Affiche le texte lorsque c'est raté.
if ( m_phase == WM_PHASE_LOST ) if ( m_phase == WM_PHASE_LOST )
{ {
static char *list[] = { static char *list[] = {
@ -2251,7 +2251,7 @@ bool CEvent::DrawButtons()
DrawText(m_pPixmap, pos, list[GetWorld () % 5]); DrawText(m_pPixmap, pos, list[GetWorld () % 5]);
} }
// Affiche le texte lorsque c'est réussi. // Affiche le texte lorsque c'est réussi.
if ( m_phase == WM_PHASE_WIN ) if ( m_phase == WM_PHASE_WIN )
{ {
static char *list[] = { static char *list[] = {
@ -2284,7 +2284,7 @@ bool CEvent::DrawButtons()
DrawText(m_pPixmap, pos, text); DrawText(m_pPixmap, pos, text);
} }
// Dessine les réglages. // Dessine les réglages.
if ( m_phase == WM_PHASE_SETUP || if ( m_phase == WM_PHASE_SETUP ||
m_phase == WM_PHASE_SETUPp ) m_phase == WM_PHASE_SETUPp )
{ {
@ -2364,7 +2364,7 @@ bool CEvent::DrawButtons()
DrawText(m_pPixmap, pos, text); DrawText(m_pPixmap, pos, text);
} }
// Affiche le texte lorsqu'il faut insérer le CD-Rom. // Affiche le texte lorsqu'il faut insérer le CD-Rom.
if ( m_phase == WM_PHASE_INSERT ) if ( m_phase == WM_PHASE_INSERT )
{ {
DrawTextCenter(gettext ("Insert CD-Rom Planet Blupi and wait a few seconds..."), LXIMAGE/2, 20); DrawTextCenter(gettext ("Insert CD-Rom Planet Blupi and wait a few seconds..."), LXIMAGE/2, 20);
@ -2384,7 +2384,7 @@ bool CEvent::DrawButtons()
return true; return true;
} }
// Retourne le lutin à utiliser à une position donnée. // Retourne le lutin à utiliser à une position donnée.
MouseSprites CEvent::MousePosToSprite(POINT pos) MouseSprites CEvent::MousePosToSprite(POINT pos)
{ {
@ -2454,17 +2454,17 @@ MouseSprites CEvent::MousePosToSprite(POINT pos)
} }
} }
if ( m_bFillMouse && // bidon présent ? if ( m_bFillMouse && // bidon présent ?
pos.x >= POSDRAWX && pos.x <= POSDRAWX+DIMDRAWX && pos.x >= POSDRAWX && pos.x <= POSDRAWX+DIMDRAWX &&
pos.y >= POSDRAWY && pos.y <= POSDRAWY+DIMDRAWY ) pos.y >= POSDRAWY && pos.y <= POSDRAWY+DIMDRAWY )
{ {
sprite = SPRITE_FILL; sprite = SPRITE_FILL;
} }
if ( m_bWaitMouse ) // sablier présent ? if ( m_bWaitMouse ) // sablier présent ?
{ {
sprite = SPRITE_WAIT; sprite = SPRITE_WAIT;
} }
if ( m_bHideMouse ) // souris cachée ? if ( m_bHideMouse ) // souris cachée ?
{ {
sprite = SPRITE_EMPTY; sprite = SPRITE_EMPTY;
} }
@ -2472,7 +2472,7 @@ MouseSprites CEvent::MousePosToSprite(POINT pos)
return sprite; return sprite;
} }
// Gère le lutin de la souris. // Gère le lutin de la souris.
void CEvent::MouseSprite(POINT pos) void CEvent::MouseSprite(POINT pos)
{ {
@ -2480,7 +2480,7 @@ void CEvent::MouseSprite(POINT pos)
m_pPixmap->ChangeSprite(m_mouseSprite); m_pPixmap->ChangeSprite(m_mouseSprite);
} }
// Met ou enlève le sablier de la souris. // Met ou enlève le sablier de la souris.
void CEvent::WaitMouse(bool bWait) void CEvent::WaitMouse(bool bWait)
{ {
@ -2516,14 +2516,14 @@ void CEvent::HideMouse(bool bHide)
m_pPixmap->ChangeSprite(m_mouseSprite); m_pPixmap->ChangeSprite(m_mouseSprite);
} }
// Traite les événements pour tous les boutons. // Traite les événements pour tous les boutons.
bool CEvent::EventButtons(const SDL_Event &event, POINT pos) bool CEvent::EventButtons(const SDL_Event &event, POINT pos)
{ {
POINT test; POINT test;
int lg, oldx, sound; int lg, oldx, sound;
// Cherche le tool tips à utiliser pour la souris. // Cherche le tool tips à utiliser pour la souris.
m_textToolTips[0] = 0; m_textToolTips[0] = 0;
oldx = m_posToolTips.x; oldx = m_posToolTips.x;
m_posToolTips.x = -1; m_posToolTips.x = -1;
@ -2649,7 +2649,7 @@ bool CEvent::EventButtons(const SDL_Event &event, POINT pos)
&& ( event.button.button == SDL_BUTTON_LEFT && ( event.button.button == SDL_BUTTON_LEFT
|| event.button.button == SDL_BUTTON_RIGHT)) || event.button.button == SDL_BUTTON_RIGHT))
{ {
m_pDecor->HideTooltips(true); // plus de tooltips pour décor m_pDecor->HideTooltips(true); // plus de tooltips pour décor
} }
if (event.type == SDL_MOUSEBUTTONUP if (event.type == SDL_MOUSEBUTTONUP
&& ( event.button.button == SDL_BUTTON_LEFT && ( event.button.button == SDL_BUTTON_LEFT
@ -2693,7 +2693,7 @@ bool CEvent::MouseOnButton(POINT pos)
} }
// Retourne l'index dans table pour une phase donnée. // Retourne l'index dans table pour une phase donnée.
int CEvent::SearchPhase(unsigned int phase) int CEvent::SearchPhase(unsigned int phase)
{ {
@ -2708,7 +2708,7 @@ int CEvent::SearchPhase(unsigned int phase)
return -1; return -1;
} }
// Donne le numéro du monde. // Donne le numéro du monde.
int CEvent::GetWorld() int CEvent::GetWorld()
{ {
@ -2717,7 +2717,7 @@ int CEvent::GetWorld()
else return m_mission; else return m_mission;
} }
// Donne le numéro physique du monde. // Donne le numéro physique du monde.
int CEvent::GetPhysicalWorld() int CEvent::GetPhysicalWorld()
{ {
@ -2798,17 +2798,17 @@ bool CEvent::ChangePhase(unsigned int phase)
} }
if ( phase == WM_PHASE_PLAY && if ( phase == WM_PHASE_PLAY &&
!m_bDemoPlay && !m_bDemoPlay &&
GetPhysicalWorld() >= 150 && // mission spéciale démo ? GetPhysicalWorld() >= 150 && // mission spéciale démo ?
GetPhysicalWorld() < 200 ) GetPhysicalWorld() < 200 )
{ {
DemoRecStart(); // début enregistrement DemoRecStart(); // début enregistrement
} }
if ( phase != WM_PHASE_PLAY ) if ( phase != WM_PHASE_PLAY )
{ {
DemoRecStop(); // stoppe l'enregistrement d'une démo DemoRecStop(); // stoppe l'enregistrement d'une démo
} }
m_pDecor->UndoClose(); // libère le buffer undo m_pDecor->UndoClose(); // libère le buffer undo
index = SearchPhase(phase); index = SearchPhase(phase);
if ( index < 0 ) return false; if ( index < 0 ) return false;
@ -2826,7 +2826,7 @@ bool CEvent::ChangePhase(unsigned int phase)
phase == WM_PHASE_INFO ) // quitte construction ? phase == WM_PHASE_INFO ) // quitte construction ?
{ {
m_pDecor->Write(GetPhysicalWorld(), false, m_pDecor->Write(GetPhysicalWorld(), false,
GetPhysicalWorld(), 0, 0); // écrit le monde GetPhysicalWorld(), 0, 0); // écrit le monde
} }
// FIXME: pause is better if the game is not stop but just interrupted // FIXME: pause is better if the game is not stop but just interrupted
@ -2847,10 +2847,10 @@ bool CEvent::ChangePhase(unsigned int phase)
iconDim.y = 0; iconDim.y = 0;
if ( !m_pPixmap->Cache(CHBACK, filename, totalDim, iconDim) ) if ( !m_pPixmap->Cache(CHBACK, filename, totalDim, iconDim) )
{ {
WaitMouse(false); // enlève le sablier WaitMouse(false); // enlève le sablier
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
} }
if ( m_phase == WM_PHASE_READ || if ( m_phase == WM_PHASE_READ ||
@ -2882,7 +2882,7 @@ bool CEvent::ChangePhase(unsigned int phase)
{ {
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
} }
m_pDecor->SetTime(0); m_pDecor->SetTime(0);
m_pDecor->SetTotalTime(0); m_pDecor->SetTotalTime(0);
@ -2934,18 +2934,18 @@ bool CEvent::ChangePhase(unsigned int phase)
{ {
m_tryInsertCount = 40; m_tryInsertCount = 40;
m_tryPhase = m_phase; m_tryPhase = m_phase;
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ... return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
} }
} }
m_jauges[0].SetHide(true); // cache les jauges m_jauges[0].SetHide(true); // cache les jauges
m_jauges[1].SetHide(true); m_jauges[1].SetHide(true);
CreateButtons(); // crée les boutons selon la phase CreateButtons(); // crée les boutons selon la phase
m_bMenu = false; m_bMenu = false;
m_pDecor->HideTooltips(false); m_pDecor->HideTooltips(false);
m_menu.Delete(); m_menu.Delete();
m_pDecor->BlupiSetArrow(0, false); // enlève toutes les flèches m_pDecor->BlupiSetArrow(0, false); // enlève toutes les flèches
m_pDecor->ResetHili(); // enlève les mises en évidence m_pDecor->ResetHili(); // enlève les mises en évidence
if ( m_phase == WM_PHASE_PLAY ) if ( m_phase == WM_PHASE_PLAY )
{ {
@ -3151,7 +3151,7 @@ bool CEvent::ChangePhase(unsigned int phase)
} }
} }
WaitMouse(false); // enlève le sablier WaitMouse(false); // enlève le sablier
return true; return true;
} }
@ -3176,11 +3176,11 @@ void CEvent::TryInsert()
} }
} }
// Fait démarrer un film si nécessaire. // Fait démarrer un film si nécessaire.
void CEvent::MovieToStart() void CEvent::MovieToStart()
{ {
if ( m_movieToStart[0] != 0 ) // y a-t-il un film à démarrer ? if ( m_movieToStart[0] != 0 ) // y a-t-il un film à démarrer ?
{ {
HideMouse(true); // cache la souris HideMouse(true); // cache la souris
@ -3198,7 +3198,7 @@ void CEvent::MovieToStart()
} }
// Décale le décor. // Décale le décor.
void CEvent::DecorShift(int dx, int dy) void CEvent::DecorShift(int dx, int dy)
{ {
@ -3216,7 +3216,7 @@ void CEvent::DecorShift(int dx, int dy)
//? m_pDecor->NextPhase(0); // faudra refaire la carte tout de suite //? m_pDecor->NextPhase(0); // faudra refaire la carte tout de suite
} }
// Décale le décor lorsque la souris touche un bord. // Décale le décor lorsque la souris touche un bord.
void CEvent::DecorAutoShift(POINT pos) void CEvent::DecorAutoShift(POINT pos)
{ {
@ -3235,7 +3235,7 @@ void CEvent::DecorAutoShift(POINT pos)
if ( m_phase == WM_PHASE_PLAY || if ( m_phase == WM_PHASE_PLAY ||
m_phase == WM_PHASE_BUILD ) m_phase == WM_PHASE_BUILD )
{ {
if ( m_shiftPhase == 0 ) // début du shift ? if ( m_shiftPhase == 0 ) // début du shift ?
{ {
m_shiftOffset.x = 0; m_shiftOffset.x = 0;
m_shiftOffset.y = 0; m_shiftOffset.y = 0;
@ -3322,7 +3322,7 @@ void CEvent::DecorAutoShift(POINT pos)
offset.y = m_shiftOffset.y*(max-m_shiftPhase)*(DIMCELY/2/max); offset.y = m_shiftOffset.y*(max-m_shiftPhase)*(DIMCELY/2/max);
m_pDecor->SetShiftOffset(offset); m_pDecor->SetShiftOffset(offset);
if ( m_shiftPhase == 0 ) // dernière phase ? if ( m_shiftPhase == 0 ) // dernière phase ?
{ {
offset.x = 0; offset.x = 0;
offset.y = 0; offset.y = 0;
@ -3341,7 +3341,7 @@ bool CEvent::IsShift()
} }
// Modifie le décor lorsque le bouton de la souris est pressé. // Modifie le décor lorsque le bouton de la souris est pressé.
bool CEvent::PlayDown(POINT pos, const SDL_Event &event) bool CEvent::PlayDown(POINT pos, const SDL_Event &event)
{ {
@ -3350,7 +3350,7 @@ bool CEvent::PlayDown(POINT pos, const SDL_Event &event)
int rank, button, h; int rank, button, h;
POINT cel; POINT cel;
m_pDecor->BlupiSetArrow(0, false); // enlève toutes les flèches m_pDecor->BlupiSetArrow(0, false); // enlève toutes les flèches
m_bMouseDown = false; m_bMouseDown = false;
@ -3418,7 +3418,7 @@ bool CEvent::PlayDown(POINT pos, const SDL_Event &event)
return true; return true;
} }
// Modifie le décor lorsque la souris est déplacée. // Modifie le décor lorsque la souris est déplacée.
bool CEvent::PlayMove(POINT pos, Uint16 mod) bool CEvent::PlayMove(POINT pos, Uint16 mod)
{ {
@ -3435,7 +3435,7 @@ bool CEvent::PlayMove(POINT pos, Uint16 mod)
m_pDecor->StatisticMove(pos); m_pDecor->StatisticMove(pos);
if ( m_bMouseDown ) // bouton souris pressé ? if ( m_bMouseDown ) // bouton souris pressé ?
{ {
if ( m_bHili ) if ( m_bHili )
{ {
@ -3454,7 +3454,7 @@ bool CEvent::PlayMove(POINT pos, Uint16 mod)
return true; return true;
} }
// Modifie le décor lorsque le bouton de la souris est relâché. // Modifie le décor lorsque le bouton de la souris est relâché.
bool CEvent::PlayUp(POINT pos, Uint16 mod) bool CEvent::PlayUp(POINT pos, Uint16 mod)
{ {
@ -3467,7 +3467,7 @@ bool CEvent::PlayUp(POINT pos, Uint16 mod)
m_pDecor->StatisticUp(pos); m_pDecor->StatisticUp(pos);
if ( m_bMouseDown ) // bouton souris pressé ? if ( m_bMouseDown ) // bouton souris pressé ?
{ {
if ( m_bHili ) if ( m_bHili )
{ {
@ -3489,7 +3489,7 @@ bool CEvent::PlayUp(POINT pos, Uint16 mod)
pos, m_menuNb, m_menuButtons, m_menuErrors, pos, m_menuNb, m_menuButtons, m_menuErrors,
m_menuTexts, m_menuPerso); m_menuTexts, m_menuPerso);
m_bMenu = true; m_bMenu = true;
m_pDecor->HideTooltips(true); // plus de tooltips pour décor m_pDecor->HideTooltips(true); // plus de tooltips pour décor
} }
} }
} }
@ -3522,7 +3522,7 @@ void CEvent::ChangeButtons(int message)
state = GetState(message); state = GetState(message);
if ( state == 0 ) state = 1; if ( state == 0 ) state = 1;
else state = 0; else state = 0;
SetState(message, state); // pressé <-> relâché SetState(message, state); // pressé <-> relâché
pButtonExist[message-WM_BUTTON0] = state; pButtonExist[message-WM_BUTTON0] = state;
pButtonExist[BUTTON_DJEEP] = true; pButtonExist[BUTTON_DJEEP] = true;
@ -3545,7 +3545,7 @@ void CEvent::ChangeButtons(int message)
state = GetState(message); state = GetState(message);
if ( state == 0 ) state = 1; if ( state == 0 ) state = 1;
else state = 0; else state = 0;
SetState(message, state); // pressé <-> relâché SetState(message, state); // pressé <-> relâché
if ( message == WM_BUTTON1 ) pTerm->bHachBlupi = state; if ( message == WM_BUTTON1 ) pTerm->bHachBlupi = state;
if ( message == WM_BUTTON2 ) pTerm->bHachPlanche = state; if ( message == WM_BUTTON2 ) pTerm->bHachPlanche = state;
@ -3672,7 +3672,7 @@ void CEvent::ChangeButtons(int message)
// Met un sol si nécessaire sous un objet. // Met un sol si nécessaire sous un objet.
void CEvent::BuildFloor(POINT cel, int insIcon) void CEvent::BuildFloor(POINT cel, int insIcon)
{ {
@ -3693,7 +3693,7 @@ void CEvent::BuildFloor(POINT cel, int insIcon)
insIcon == 113 || // maison ? insIcon == 113 || // maison ?
insIcon == 120 ) // usine ? insIcon == 120 ) // usine ?
{ {
iFloor = 16; // sol brun foncé iFloor = 16; // sol brun foncé
} }
if ( insIcon == 122 ) // mine de fer ? if ( insIcon == 122 ) // mine de fer ?
@ -3705,10 +3705,10 @@ void CEvent::BuildFloor(POINT cel, int insIcon)
insIcon == 100 || // usine ennemie ? insIcon == 100 || // usine ennemie ?
insIcon == 102 || // usine ennemie ? insIcon == 102 || // usine ennemie ?
insIcon == 104 || // usine ennemie ? insIcon == 104 || // usine ennemie ?
(insIcon >= 106 && insIcon <= 112) || // barrière ? (insIcon >= 106 && insIcon <= 112) || // barrière ?
insIcon == 115 || // usine ennemie ? insIcon == 115 || // usine ennemie ?
insIcon == 17 || // usine ennemie ? insIcon == 17 || // usine ennemie ?
insIcon == 12 ) // fusée ? insIcon == 12 ) // fusée ?
{ {
iFloor = 67; // sol bleu ennemi iFloor = 67; // sol bleu ennemi
} }
@ -3723,31 +3723,31 @@ void CEvent::BuildFloor(POINT cel, int insIcon)
} }
} }
// Enlève si nécessaire un objet sur l'eau. // Enlève si nécessaire un objet sur l'eau.
void CEvent::BuildWater(POINT cel, int insIcon) void CEvent::BuildWater(POINT cel, int insIcon)
{ {
int channel, icon; int channel, icon;
if ( insIcon != 14 ) return; // rien à faire si pas eau if ( insIcon != 14 ) return; // rien à faire si pas eau
m_pDecor->GetObject(cel, channel, icon); m_pDecor->GetObject(cel, channel, icon);
if ( channel == CHOBJECT && if ( channel == CHOBJECT &&
icon >= 6 && // objet (pas petite plante) ? icon >= 6 && // objet (pas petite plante) ?
icon != 117 ) // pas bateau ? icon != 117 ) // pas bateau ?
{ {
m_pDecor->PutObject(cel, -1, -1); // enlève l'objet m_pDecor->PutObject(cel, -1, -1); // enlève l'objet
m_pDecor->ArrangeObject(cel); m_pDecor->ArrangeObject(cel);
} }
} }
// Cette table donne les objets à construire en fonction // Cette table donne les objets à construire en fonction
// du choix dans le menu. // du choix dans le menu.
static int tableFloor[] = static int tableFloor[] =
{ {
1,49,50,51,0,0,0,0,0,0, // 0 herbe 1,49,50,51,0,0,0,0,0,0, // 0 herbe
20,66,79,0,0,0,0,0,0,0, // 1 foncé 20,66,79,0,0,0,0,0,0,0, // 1 foncé
33,46,47,48,71,0,0,0,0,0, // 2 terre 33,46,47,48,71,0,0,0,0,0, // 2 terre
14,0,0,0,0,0,0,0,0,0, // 3 mer 14,0,0,0,0,0,0,0,0,0, // 3 mer
15,16,17,18,19,65,67,0,0,0, // 4 dalles 15,16,17,18,19,65,67,0,0,0, // 4 dalles
@ -3756,7 +3756,7 @@ static int tableFloor[] =
static int tableObject[] = static int tableObject[] =
{ {
-1,0,0,0,0,0,0,0,0,0, // 0 détruit -1,0,0,0,0,0,0,0,0,0, // 0 détruit
0,4,1,2,3,5,0,0,0,0, // 1 plantes 0,4,1,2,3,5,0,0,0,0, // 1 plantes
6,7,8,9,10,11,0,0,0,0, // 2 arbres 6,7,8,9,10,11,0,0,0,0, // 2 arbres
81,83,94,0,0,0,0,0,0,0, // 5 fleurs 81,83,94,0,0,0,0,0,0,0, // 5 fleurs
@ -3764,20 +3764,20 @@ static int tableObject[] =
static int tableHome[] = static int tableHome[] =
{ {
-1,0,0,0,0,0,0,0,0,0, // 0 détruit -1,0,0,0,0,0,0,0,0,0, // 0 détruit
113,61,28,120,0,0,0,0,0,0, // 1 maison 113,61,28,120,0,0,0,0,0,0, // 1 maison
27,0,0,0,0,0,0,0,0,0, // 2 tour de protection 27,0,0,0,0,0,0,0,0,0, // 2 tour de protection
122,0,0,0,0,0,0,0,0,0, // 3 mine de fer 122,0,0,0,0,0,0,0,0,0, // 3 mine de fer
99,100,102,104,115,17,12,0,0,0, // 4 ennemi 99,100,102,104,115,17,12,0,0,0, // 4 ennemi
112,0,0,0,0,0,0,0,0,0, // 5 barrière 112,0,0,0,0,0,0,0,0,0, // 5 barrière
26,71,0,0,0,0,0,0,0,0, // 6 palissade 26,71,0,0,0,0,0,0,0,0, // 6 palissade
37,38,39,40,41,42,43,0,0,0, // 7 rochers 37,38,39,40,41,42,43,0,0,0, // 7 rochers
36,44,60,63,80,123,14,0,0,0, // 8 matières 36,44,60,63,80,123,14,0,0,0, // 8 matières
85,125,93,92,0,0,0,0,0,0, // 9 pièges 85,125,93,92,0,0,0,0,0,0, // 9 pièges
117,118,16,0,0,0,0,0,0,0, // 10 véhicules 117,118,16,0,0,0,0,0,0,0, // 10 véhicules
}; };
// Modifie le décor lorsque le bouton de la souris est pressé. // Modifie le décor lorsque le bouton de la souris est pressé.
bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix) bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
{ {
@ -3791,7 +3791,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
if ( bMix ) if ( bMix )
{ {
m_pDecor->UndoCopy(); // copie le décor pour undo év. m_pDecor->UndoCopy(); // copie le décor pour undo év.
} }
if ( GetState(WM_DECOR1) == 1 ) // pose d'un sol if ( GetState(WM_DECOR1) == 1 ) // pose d'un sol
@ -3810,7 +3810,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
} }
} }
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ? if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
{ {
WaitMouse(true); WaitMouse(true);
m_pDecor->ArrangeFill(cel, CHFLOOR, tableFloor[menu*10+m_lastFloor[menu]], true); m_pDecor->ArrangeFill(cel, CHFLOOR, tableFloor[menu*10+m_lastFloor[menu]], true);
@ -3821,7 +3821,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
icon = tableFloor[menu*10+m_lastFloor[menu]]; icon = tableFloor[menu*10+m_lastFloor[menu]];
if ( menu >= 1 ) // met un sol ? if ( menu >= 1 ) // met un sol ?
{ {
BuildWater(cel, icon); // enlève les objets BuildWater(cel, icon); // enlève les objets
} }
m_pDecor->PutFloor(cel, CHFLOOR, icon); m_pDecor->PutFloor(cel, CHFLOOR, icon);
m_pDecor->ArrangeFloor(cel); m_pDecor->ArrangeFloor(cel);
@ -3844,7 +3844,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
} }
} }
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ? if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
{ {
WaitMouse(true); WaitMouse(true);
m_pDecor->ArrangeFill(cel, CHOBJECT, tableObject[menu*10+m_lastObject[menu]], false); m_pDecor->ArrangeFill(cel, CHOBJECT, tableObject[menu*10+m_lastObject[menu]], false);
@ -3853,7 +3853,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
else else
{ {
icon = tableObject[menu*10+m_lastObject[menu]]; icon = tableObject[menu*10+m_lastObject[menu]];
BuildFloor(cel, icon); // met un sol si nécessaire BuildFloor(cel, icon); // met un sol si nécessaire
m_pDecor->PutObject(cel, CHOBJECT, icon); m_pDecor->PutObject(cel, CHOBJECT, icon);
m_pDecor->ArrangeObject(cel); m_pDecor->ArrangeObject(cel);
} }
@ -3875,7 +3875,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
} }
} }
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ? if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
{ {
WaitMouse(true); WaitMouse(true);
m_pDecor->ArrangeFill(cel, CHOBJECT, tableHome[menu*10+m_lastHome[menu]], false); m_pDecor->ArrangeFill(cel, CHOBJECT, tableHome[menu*10+m_lastHome[menu]], false);
@ -3884,7 +3884,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
else else
{ {
icon = tableHome[menu*10+m_lastHome[menu]]; icon = tableHome[menu*10+m_lastHome[menu]];
BuildFloor(cel, icon); // met un sol si nécessaire BuildFloor(cel, icon); // met un sol si nécessaire
m_pDecor->PutObject(cel, CHOBJECT, icon); m_pDecor->PutObject(cel, CHOBJECT, icon);
m_pDecor->ArrangeObject(cel); m_pDecor->ArrangeObject(cel);
} }
@ -3899,11 +3899,11 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
{ {
m_pDecor->BlupiDelete(cel); m_pDecor->BlupiDelete(cel);
} }
if ( menu == 1 ) // ajoute blupi-fatigué ? if ( menu == 1 ) // ajoute blupi-fatigué ?
{ {
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 0, MAXENERGY/4); m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 0, MAXENERGY/4);
} }
if ( menu == 2 ) // ajoute blupi-énergique ? if ( menu == 2 ) // ajoute blupi-énergique ?
{ {
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 0, MAXENERGY); m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 0, MAXENERGY);
} }
@ -3911,7 +3911,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
{ {
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 8, MAXENERGY); m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 8, MAXENERGY);
} }
if ( menu == 4 ) // ajoute araignée ? if ( menu == 4 ) // ajoute araignée ?
{ {
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 1, MAXENERGY); m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 1, MAXENERGY);
} }
@ -3927,7 +3927,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
{ {
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 5, MAXENERGY); m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 5, MAXENERGY);
} }
if ( menu == 8 ) // ajoute électro ? if ( menu == 8 ) // ajoute électro ?
{ {
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 7, MAXENERGY); m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 7, MAXENERGY);
} }
@ -3952,16 +3952,16 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
} }
} }
m_pDecor->ArrangeBlupi(); // supprime les blupi bloqués m_pDecor->ArrangeBlupi(); // supprime les blupi bloqués
return true; return true;
} }
// Modifie le décor lorsque la souris est déplacée. // Modifie le décor lorsque la souris est déplacée.
bool CEvent::BuildMove(POINT pos, Uint16 mod, const SDL_Event &event) bool CEvent::BuildMove(POINT pos, Uint16 mod, const SDL_Event &event)
{ {
if (event.motion.state & SDL_BUTTON (SDL_BUTTON_LEFT)) // bouton souris pressé ? if (event.motion.state & SDL_BUTTON (SDL_BUTTON_LEFT)) // bouton souris pressé ?
{ {
BuildDown(pos, mod, false); BuildDown(pos, mod, false);
} }
@ -3978,7 +3978,7 @@ bool CEvent::BuildMove(POINT pos, Uint16 mod, const SDL_Event &event)
return true; return true;
} }
// Modifie le décor lorsque le bouton de la souris est relâché. // Modifie le décor lorsque le bouton de la souris est relâché.
bool CEvent::BuildUp(POINT pos) bool CEvent::BuildUp(POINT pos)
{ {
@ -3986,7 +3986,7 @@ bool CEvent::BuildUp(POINT pos)
} }
// Démarre un film non interractif. // Démarre un film non interractif.
bool CEvent::StartMovie(const char *pFilename) bool CEvent::StartMovie(const char *pFilename)
{ {
@ -3997,7 +3997,7 @@ bool CEvent::StartMovie(const char *pFilename)
if ( !m_pMovie->IsExist(pFilename) ) return false; if ( !m_pMovie->IsExist(pFilename) ) return false;
rect.left = 1; // mystère: plante avec 0,0,LXIMAGE,LYIMAGE !!! rect.left = 1; // mystère: plante avec 0,0,LXIMAGE,LYIMAGE !!!
rect.top = 1; rect.top = 1;
rect.right = LXIMAGE-2; rect.right = LXIMAGE-2;
rect.bottom = LYIMAGE-2; rect.bottom = LYIMAGE-2;
@ -4070,7 +4070,7 @@ void CEvent::Write(int message)
} }
// Initialise le libellé d'une mission privée. // Initialise le libellé d'une mission privée.
void CEvent::PrivateLibelle() void CEvent::PrivateLibelle()
{ {
@ -4152,7 +4152,7 @@ void CEvent::PrivateLibelle()
m_pDecor->SetInfoHeight(POSDRAWY+h1+10); m_pDecor->SetInfoHeight(POSDRAWY+h1+10);
} }
// Lit le libellé d'un monde. // Lit le libellé d'un monde.
bool CEvent::ReadLibelle(int world, bool bSchool, bool bHelp) bool CEvent::ReadLibelle(int world, bool bSchool, bool bHelp)
{ {
@ -4325,7 +4325,7 @@ bool CEvent::GetPause()
} }
// Début de l'enregistrement d'une démo. // Début de l'enregistrement d'une démo.
void CEvent::DemoRecStart() void CEvent::DemoRecStart()
{ {
@ -4343,7 +4343,7 @@ void CEvent::DemoRecStart()
m_speed = 1; m_speed = 1;
} }
// Fin de l'enregistrement d'une démo. // Fin de l'enregistrement d'une démo.
// Sauve le fichier sur disque. // Sauve le fichier sur disque.
void CEvent::DemoRecStop() void CEvent::DemoRecStop()
@ -4378,7 +4378,7 @@ void CEvent::DemoRecStop()
m_demoTime = 0; m_demoTime = 0;
} }
// Début de la reproduction d'une démo. // Début de la reproduction d'une démo.
// Lit le fichier sur disque. // Lit le fichier sur disque.
bool CEvent::DemoPlayStart() bool CEvent::DemoPlayStart()
@ -4432,7 +4432,7 @@ bool CEvent::DemoPlayStart()
return true; return true;
} }
// Fin de la reproduction d'une démo. // Fin de la reproduction d'une démo.
void CEvent::DemoPlayStop() void CEvent::DemoPlayStop()
{ {
@ -4551,14 +4551,14 @@ void CEvent::DemoStep()
if ( m_phase == WM_PHASE_INIT ) if ( m_phase == WM_PHASE_INIT )
{ {
if ( m_demoTime > DEF_TIME_DEMO ) // ~30 secondes écoulées ? if ( m_demoTime > DEF_TIME_DEMO ) // ~30 secondes écoulées ?
{ {
m_demoNumber = 0; m_demoNumber = 0;
DemoPlayStart(); // démarre une démo automatique DemoPlayStart(); // démarre une démo automatique
} }
} }
if ( m_bDemoPlay && // démo en lecture ? if ( m_bDemoPlay && // démo en lecture ?
m_pDemoBuffer != nullptr ) m_pDemoBuffer != nullptr )
{ {
while ( true ) while ( true )
@ -4583,11 +4583,11 @@ void CEvent::DemoStep()
if ( m_demoIndex >= m_demoEnd ) if ( m_demoIndex >= m_demoEnd )
{ {
m_demoNumber ++; // démo suivante m_demoNumber ++; // démo suivante
if ( !DemoPlayStart() ) // démarre la démo suivante if ( !DemoPlayStart() ) // démarre la démo suivante
{ {
m_demoNumber = 0; // première démo m_demoNumber = 0; // première démo
DemoPlayStart(); // démarre la démo DemoPlayStart(); // démarre la démo
} }
return; return;
} }
@ -4597,7 +4597,7 @@ void CEvent::DemoStep()
m_demoTime ++; m_demoTime ++;
} }
// Mémorise un événement. // Mémorise un événement.
void CEvent::DemoRecEvent(unsigned int message, WPARAM wParam, LPARAM lParam) void CEvent::DemoRecEvent(unsigned int message, WPARAM wParam, LPARAM lParam)
{ {
@ -4635,14 +4635,14 @@ void CEvent::DemoRecEvent(unsigned int message, WPARAM wParam, LPARAM lParam)
} }
// Retourne la dernière position de la souris. // Retourne la dernière position de la souris.
POINT CEvent::GetLastMousePos() POINT CEvent::GetLastMousePos()
{ {
return m_oldMousePos; return m_oldMousePos;
} }
// Traitement d'un événement. // Traitement d'un événement.
bool CEvent::TreatEvent(const SDL_Event &event) bool CEvent::TreatEvent(const SDL_Event &event)
{ {
@ -4663,7 +4663,7 @@ bool CEvent::TreatEvent(const SDL_Event &event)
return TreatEventBase(event); return TreatEventBase(event);
} }
// Traitement d'un événement. // Traitement d'un événement.
bool CEvent::TreatEventBase(const SDL_Event &event) bool CEvent::TreatEventBase(const SDL_Event &event)
{ {
@ -4679,7 +4679,7 @@ bool CEvent::TreatEventBase(const SDL_Event &event)
case SDL_KEYDOWN: case SDL_KEYDOWN:
if ( event.key.keysym.sym >= SDLK_a && event.key.keysym.sym <= SDLK_z ) if ( event.key.keysym.sym >= SDLK_a && event.key.keysym.sym <= SDLK_z )
{ {
if ( m_posCheat == 0 ) // première lettre ? if ( m_posCheat == 0 ) // première lettre ?
{ {
m_rankCheat = -1; m_rankCheat = -1;
for ( i=0 ; i<9 ; i++ ) for ( i=0 ; i<9 ; i++ )
@ -5085,7 +5085,7 @@ bool CEvent::TreatEventBase(const SDL_Event &event)
case WM_PHASE_MISSION: case WM_PHASE_MISSION:
m_bSchool = false; m_bSchool = false;
m_bPrivate = false; m_bPrivate = false;
if ( m_mission == 0 ) // première mission ? if ( m_mission == 0 ) // première mission ?
{ {
if ( ChangePhase(WM_PHASE_H0MOVIE) ) return true; if ( ChangePhase(WM_PHASE_H0MOVIE) ) return true;
} }
@ -5130,7 +5130,7 @@ bool CEvent::TreatEventBase(const SDL_Event &event)
break; break;
case WM_PHASE_UNDO: case WM_PHASE_UNDO:
m_pDecor->UndoBack(); // revient en arrière m_pDecor->UndoBack(); // revient en arrière
break; break;
case WM_PREV: case WM_PREV:

View File

@ -4,8 +4,8 @@
#include "fifo.h" #include "fifo.h"
// gestion d'une pile classée en valeur croissantes // gestion d'une pile classée en valeur croissantes
// typiquement reprend les coordonnées les plus proches // typiquement reprend les coordonnées les plus proches
// du but en premier lieu // du but en premier lieu
CPileTriee::CPileTriee(long taille) CPileTriee::CPileTriee(long taille)
@ -36,10 +36,10 @@ void CPileTriee::put(long pos, long dist)
while (i!=m_max) while (i!=m_max)
{ {
// le point est-il plus proche que celui-là ? // le point est-il plus proche que celui-là ?
if (dist<m_data[i].dist) if (dist<m_data[i].dist)
{ {
// oui, insert et décale le suivant // oui, insert et décale le suivant
p = m_data[i].pos; p = m_data[i].pos;
d = m_data[i].dist; d = m_data[i].dist;
m_data[i].pos = pos; m_data[i].pos = pos;
@ -51,7 +51,7 @@ void CPileTriee::put(long pos, long dist)
if (i>=m_taille) i=0; if (i>=m_taille) i=0;
} }
// ajoute le point éloigné à la suite // ajoute le point éloigné à la suite
m = m_max+1; m = m_max+1;
if (m>=m_taille) m=0; if (m>=m_taille) m=0;
if (m!=m_out) if (m!=m_out)

View File

@ -5,7 +5,7 @@
// stucture pour enpiler des positions // stucture pour enpiler des positions
// en fonction de leur distance à la cible // en fonction de leur distance à la cible
typedef struct typedef struct
{ {
long pos; long pos;
@ -14,7 +14,7 @@ typedef struct
Element; Element;
// traitement d'une pile triée // traitement d'une pile triée
class CPileTriee class CPileTriee
{ {
@ -22,7 +22,7 @@ private:
long m_taille; // nombre de polongs max long m_taille; // nombre de polongs max
long m_max; // position limite long m_max; // position limite
long m_out; // position pour reprendre long m_out; // position pour reprendre
Element* m_data; // données Element* m_data; // données
public: public:
CPileTriee(long taille); CPileTriee(long taille);

View File

@ -3,7 +3,7 @@
#include "decor.h" #include "decor.h"
// Cette table indique les quarts de cases contenant du // Cette table indique les quarts de cases contenant du
// brouillard lorsque la valeur est à un. // brouillard lorsque la valeur est à un.
// 0 1 // 0 1
// 2 3 // 2 3
static char tableFog[15*4] = static char tableFog[15*4] =
@ -44,7 +44,7 @@ bool GetFogBits(int icon, char *pBits)
return true; return true;
} }
// Retourne l'icône correspondant aux bits de brouillard. // Retourne l'icône correspondant aux bits de brouillard.
int GetFogIcon(char *pBits) int GetFogIcon(char *pBits)
{ {
@ -140,7 +140,7 @@ void CDecor::BlupiPushFog(int rank)
for ( i=0 ; i<4 ; i++ ) for ( i=0 ; i<4 ; i++ )
{ {
nBits[i] &= cBits[i]; // "ou" visibilité nBits[i] &= cBits[i]; // "ou" visibilité
} }
m_decor[cel.x/2][cel.y/2].fog = GetFogIcon(nBits); m_decor[cel.x/2][cel.y/2].fog = GetFogIcon(nBits);

View File

@ -31,7 +31,7 @@ CJauge::~CJauge()
} }
// Crée un nouveau bouton. // Crée un nouveau bouton.
bool CJauge::Create(CPixmap *pPixmap, CSound *pSound, bool CJauge::Create(CPixmap *pPixmap, CSound *pSound,
POINT pos, int type, bool bMinimizeRedraw) POINT pos, int type, bool bMinimizeRedraw)
@ -50,7 +50,7 @@ bool CJauge::Create(CPixmap *pPixmap, CSound *pSound,
return true; return true;
} }
// Dessine un bouton dans son état. // Dessine un bouton dans son état.
void CJauge::Draw() void CJauge::Draw()
{ {
@ -60,7 +60,7 @@ void CJauge::Draw()
if ( m_bMinimizeRedraw && !m_bRedraw ) return; if ( m_bMinimizeRedraw && !m_bRedraw ) return;
m_bRedraw = false; m_bRedraw = false;
if ( m_bHide ) // bouton caché ? if ( m_bHide ) // bouton caché ?
{ {
rect.left = m_pos.x; rect.left = m_pos.x;
rect.right = m_pos.x+m_dim.x; rect.right = m_pos.x+m_dim.x;
@ -84,7 +84,7 @@ void CJauge::Draw()
rect.right = 6+part; rect.right = 6+part;
rect.top = DIMJAUGEY*m_type; rect.top = DIMJAUGEY*m_type;
rect.bottom = DIMJAUGEY*(m_type+1); rect.bottom = DIMJAUGEY*(m_type+1);
m_pPixmap->DrawPart(-1, CHJAUGE, m_pos, rect); // partie colorée m_pPixmap->DrawPart(-1, CHJAUGE, m_pos, rect); // partie colorée
} }
} }

View File

@ -32,13 +32,13 @@ protected:
CPixmap* m_pPixmap; CPixmap* m_pPixmap;
CDecor* m_pDecor; CDecor* m_pDecor;
CSound* m_pSound; CSound* m_pSound;
bool m_bHide; // true si bouton caché bool m_bHide; // true si bouton caché
POINT m_pos; // coin sup/gauche POINT m_pos; // coin sup/gauche
POINT m_dim; // dimensions POINT m_dim; // dimensions
int m_type; int m_type;
int m_level; int m_level;
bool m_bMinimizeRedraw; bool m_bMinimizeRedraw;
bool m_bRedraw; // true -> doit être redessiné bool m_bRedraw; // true -> doit être redessiné
}; };
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View File

@ -37,7 +37,7 @@ static const short table_button_icon[] =
35, // build3 (laboratoire) 35, // build3 (laboratoire)
61, // build4 (mine) 61, // build4 (mine)
59, // build5 (usine) 59, // build5 (usine)
101, // build6 (téléporteur) 101, // build6 (téléporteur)
20, // mur 20, // mur
26, // palis 26, // palis
42, // abat n 42, // abat n
@ -138,7 +138,7 @@ CMenu::~CMenu()
} }
// Crée un nouveau bouton. // Crée un nouveau bouton.
bool CMenu::Create(CPixmap *pPixmap, CSound *pSound, bool CMenu::Create(CPixmap *pPixmap, CSound *pSound,
POINT pos, int nb, int *pButtons, int *pErrors, POINT pos, int nb, int *pButtons, int *pErrors,
@ -175,7 +175,7 @@ bool CMenu::Create(CPixmap *pPixmap, CSound *pSound,
return true; return true;
} }
// Met à jour le menu. // Met à jour le menu.
void CMenu::Update(int nb, int *pButtons, int *pErrors, void CMenu::Update(int nb, int *pButtons, int *pErrors,
std::unordered_map<int, const char *> &texts) std::unordered_map<int, const char *> &texts)
@ -200,7 +200,7 @@ void CMenu::Update(int nb, int *pButtons, int *pErrors,
m_texts = texts; m_texts = texts;
} }
// Détruit le menu. // Détruit le menu.
void CMenu::Delete() void CMenu::Delete()
{ {
@ -208,7 +208,7 @@ void CMenu::Delete()
m_selRank = -1; m_selRank = -1;
} }
// Dessine un bouton dans son état. // Dessine un bouton dans son état.
void CMenu::Draw() void CMenu::Draw()
{ {
@ -246,7 +246,7 @@ void CMenu::Draw()
if ( m_perso == 8 ) // disciple ? if ( m_perso == 8 ) // disciple ?
{ {
if ( icon == 30 ) icon = 88; // prend if ( icon == 30 ) icon = 88; // prend
if ( icon == 31 ) icon = 89; // dépose if ( icon == 31 ) icon = 89; // dépose
} }
m_pPixmap->DrawIcon(-1, CHBUTTON, icon+6, pos); m_pPixmap->DrawIcon(-1, CHBUTTON, icon+6, pos);
} }
@ -282,7 +282,7 @@ void CMenu::Draw()
{ {
// if ( bLeft ) // if ( bLeft )
// { // {
pos.x = m_pos.x-4-GetTextWidth(text); // texte à gauche pos.x = m_pos.x-4-GetTextWidth(text); // texte à gauche
// } // }
// else // else
// { // {
@ -293,7 +293,7 @@ void CMenu::Draw()
{ {
// if ( bRight ) // if ( bRight )
// { // {
pos.x = m_pos.x+m_dim.x+4; // texte à droite pos.x = m_pos.x+m_dim.x+4; // texte à droite
// } // }
// else // else
// { // {
@ -321,7 +321,7 @@ void CMenu::Draw()
{ {
// if ( bLeft ) // if ( bLeft )
// { // {
pos.x = m_pos.x-4-GetTextWidth(text); // texte à gauche pos.x = m_pos.x-4-GetTextWidth(text); // texte à gauche
// } // }
// else // else
// { // {
@ -332,7 +332,7 @@ void CMenu::Draw()
{ {
// if ( bRight ) // if ( bRight )
// { // {
pos.x = m_pos.x+m_dim.x+4; // texte à droite pos.x = m_pos.x+m_dim.x+4; // texte à droite
// } // }
// else // else
// { // {
@ -355,7 +355,7 @@ void CMenu::Draw()
m_pPixmap->SetClipping(oldClip); m_pPixmap->SetClipping(oldClip);
} }
// Retourne le bouton sélectionné. // Retourne le bouton sélectionné.
int CMenu::GetSel() int CMenu::GetSel()
{ {
@ -364,14 +364,14 @@ int CMenu::GetSel()
return m_buttons[m_selRank]; return m_buttons[m_selRank];
} }
// Retourne le rang sélectionné. // Retourne le rang sélectionné.
int CMenu::GetRank() int CMenu::GetRank()
{ {
return m_selRank; return m_selRank;
} }
// Retourne true si le bouton sélectionné a une erreur. // Retourne true si le bouton sélectionné a une erreur.
bool CMenu::IsError() bool CMenu::IsError()
{ {
@ -392,7 +392,7 @@ bool CMenu::IsExist()
} }
// Traitement d'un événement. // Traitement d'un événement.
bool CMenu::TreatEvent(const SDL_Event &event) bool CMenu::TreatEvent(const SDL_Event &event)
{ {
@ -434,7 +434,7 @@ bool CMenu::TreatEvent(const SDL_Event &event)
return false; return false;
} }
// Détecte dans quel bouton est la souris. // Détecte dans quel bouton est la souris.
int CMenu::Detect(POINT pos) int CMenu::Detect(POINT pos)
{ {
@ -450,14 +450,14 @@ int CMenu::Detect(POINT pos)
return rank; return rank;
} }
// Bouton de la souris pressé. // Bouton de la souris pressé.
bool CMenu::MouseDown(POINT pos) bool CMenu::MouseDown(POINT pos)
{ {
return false; return false;
} }
// Souris déplacés. // Souris déplacés.
bool CMenu::MouseMove(POINT pos) bool CMenu::MouseMove(POINT pos)
{ {
@ -468,13 +468,13 @@ bool CMenu::MouseMove(POINT pos)
pos.y < m_pos.y-(DIMBUTTONY+MARGMENU) || pos.y < m_pos.y-(DIMBUTTONY+MARGMENU) ||
pos.y > m_pos.y+m_dim.y+(DIMBUTTONY+MARGMENU) ) pos.y > m_pos.y+m_dim.y+(DIMBUTTONY+MARGMENU) )
{ {
Delete(); // enlève le menu si souris trop loin ! Delete(); // enlève le menu si souris trop loin !
} }
return false; return false;
} }
// Bouton de la souris relâché. // Bouton de la souris relâché.
bool CMenu::MouseUp(POINT pos) bool CMenu::MouseUp(POINT pos)
{ {

View File

@ -50,14 +50,14 @@ POINT ConvLongToPos(LPARAM lParam)
} }
// R<EFBFBD>initialise le g<>n<EFBFBD>rateur al<61>atoire. // R�initialise le g�n�rateur al�atoire.
void InitRandom() void InitRandom()
{ {
srand(1); srand(1);
} }
// Retourne un nombre al<EFBFBD>atoire compris entre // Retourne un nombre al�atoire compris entre
// deux bornes (inclues). // deux bornes (inclues).
int Random(int min, int max) int Random(int min, int max)

View File

@ -183,7 +183,7 @@ bool CMovie::Create()
} }
} }
// Retourne l'état de DirectMovie. // Retourne l'état de DirectMovie.
bool CMovie::GetEnable() bool CMovie::GetEnable()
{ {

View File

@ -562,7 +562,7 @@ static char tableObstacleObject[] =
1,1,1,1,1, 1,1,1,1,1,
0,1,1,1,1, 0,1,1,1,1,
0,1,1,1,0, // 12 (fusée) 0,1,1,1,0, // 12 (fusée)
1,1,1,1,1, 1,1,1,1,1,
1,1,1,1,1, 1,1,1,1,1,
1,1,1,1,1, 1,1,1,1,1,
@ -574,7 +574,7 @@ static char tableObstacleObject[] =
0,0,0,0,0, 0,0,0,0,0,
0,0,0,0,0, 0,0,0,0,0,
0,0,0,0,0, // 14 (métal) 0,0,0,0,0, // 14 (métal)
0,0,0,0,0, 0,0,0,0,0,
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
@ -604,7 +604,7 @@ static char tableObstacleObject[] =
1,0,0,0,0, 1,0,0,0,0,
1,1,1,1,1, 1,1,1,1,1,
0,0,0,0,0, // 19 (électro piégé) 0,0,0,0,0, // 19 (électro piégé)
0,0,0,0,0, 0,0,0,0,0,
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
@ -1053,7 +1053,7 @@ static char tableObstacleObject[] =
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
0,0,0,0,0, // 93 (piège) 0,0,0,0,0, // 93 (piège)
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,0,1,0,
@ -1071,19 +1071,19 @@ static char tableObstacleObject[] =
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
0,0,0,0,0, // 96 (araignée dans piège) 0,0,0,0,0, // 96 (araignée dans piège)
0,0,0,0,0, 0,0,0,0,0,
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
0,0,0,0,0, // 97 (tracks dans piège) 0,0,0,0,0, // 97 (tracks dans piège)
0,0,0,0,0, 0,0,0,0,0,
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
0,0,0,0,0, // 98 (robot dans piège) 0,0,0,0,0, // 98 (robot dans piège)
0,0,0,0,0, 0,0,0,0,0,
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
@ -1131,7 +1131,7 @@ static char tableObstacleObject[] =
1,0,0,0,0, 1,0,0,0,0,
1,1,1,1,1, 1,1,1,1,1,
1,1,1,1,1, // 106 (barrière) 1,1,1,1,1, // 106 (barrière)
1,1,1,1,1, 1,1,1,1,1,
1,1,1,1,1, 1,1,1,1,1,
1,1,1,1,1, 1,1,1,1,1,
@ -1179,7 +1179,7 @@ static char tableObstacleObject[] =
1,1,1,0,0, 1,1,1,0,0,
1,1,1,1,1, 1,1,1,1,1,
0,0,0,0,0, // 114 (bombe dans piège) 0,0,0,0,0, // 114 (bombe dans piège)
0,0,0,0,0, 0,0,0,0,0,
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
@ -1251,7 +1251,7 @@ static char tableObstacleObject[] =
0,0,1,1,1, 0,0,1,1,1,
0,0,1,1,1, 0,0,1,1,1,
0,0,0,0,0, // 126 (mine de fer, échaffaudage) 0,0,0,0,0, // 126 (mine de fer, échaffaudage)
0,0,0,0,0, 0,0,0,0,0,
0,0,0,0,0, 0,0,0,0,0,
0,0,0,0,0, 0,0,0,0,0,
@ -1404,12 +1404,12 @@ void CDecor::AjustFloor(int rank, int icon, POINT cel, int *pBits)
lock: lock:
for ( i=0 ; i<9 ; i++ ) for ( i=0 ; i<9 ; i++ )
{ {
*pBits++ = 1; // bloqué *pBits++ = 1; // bloqué
} }
return; return;
} }
// (*) Blupi est passe muraille lorsqu'il embarque ou débarque // (*) Blupi est passe muraille lorsqu'il embarque ou débarque
// du bateau. Dans ce cas, tous les sols (rivages) doivent // du bateau. Dans ce cas, tous les sols (rivages) doivent
// permettre de passer. En revanche, pas les obstacles ! // permettre de passer. En revanche, pas les obstacles !
@ -1423,7 +1423,7 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
if ( m_blupi[rank].perso == 0 ) // blupi ? if ( m_blupi[rank].perso == 0 ) // blupi ?
{ {
if ( m_blupi[rank].vehicule != 0 && // pas à pied ? if ( m_blupi[rank].vehicule != 0 && // pas à pied ?
cel.x%2 == 1 && cel.y%2 == 1 && cel.x%2 == 1 && cel.y%2 == 1 &&
m_decor[cel.x/2][cel.y/2].objectIcon == 117 ) // bateau ? m_decor[cel.x/2][cel.y/2].objectIcon == 117 ) // bateau ?
{ {
@ -1455,12 +1455,12 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
return; return;
} }
if ( m_blupi[rank].perso == 1 ) // araignée ? if ( m_blupi[rank].perso == 1 ) // araignée ?
{ {
// if ( cel.x%2 != 0 && cel.y%2 != 0 && // if ( cel.x%2 != 0 && cel.y%2 != 0 &&
if ( IsSpiderObject(icon) ) // tomate ou poison ? if ( IsSpiderObject(icon) ) // tomate ou poison ?
{ {
goto pass; // l'araignée peut aller dans les tomates goto pass; // l'araignée peut aller dans les tomates
} }
return; return;
} }
@ -1469,8 +1469,8 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
{ {
if ( icon == 81 || if ( icon == 81 ||
icon == 83 || icon == 83 ||
icon == 94 || // fleurs non-coupées ? icon == 94 || // fleurs non-coupées ?
(icon >= 106 && icon <= 112) ) // barrières ennemies ? (icon >= 106 && icon <= 112) ) // barrières ennemies ?
{ {
goto pass; // le virus peut aller goto pass; // le virus peut aller
} }
@ -1495,7 +1495,7 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
if ( m_blupi[rank].perso == 4 ) // robot ? if ( m_blupi[rank].perso == 4 ) // robot ?
{ {
if ( IsRobotObject(icon) ) // piège ou dynamite ? if ( IsRobotObject(icon) ) // piège ou dynamite ?
{ {
goto pass; // le robot peut aller goto pass; // le robot peut aller
} }
@ -1504,25 +1504,25 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
if ( m_blupi[rank].perso == 5 ) // bombe ? if ( m_blupi[rank].perso == 5 ) // bombe ?
{ {
if ( icon == 93 ) // piège ? if ( icon == 93 ) // piège ?
{ {
goto pass; // la bombe peut aller goto pass; // la bombe peut aller
} }
return; return;
} }
if ( m_blupi[rank].perso == 7 ) // électro ? if ( m_blupi[rank].perso == 7 ) // électro ?
{ {
if ( icon == 93 ) // piège ? if ( icon == 93 ) // piège ?
{ {
goto pass; // l'électro peut aller goto pass; // l'électro peut aller
} }
if ( icon == 113 || // maison ? if ( icon == 113 || // maison ?
icon == 28 || icon == 29 || // laboratoire ? icon == 28 || icon == 29 || // laboratoire ?
icon == 119 || icon == 120 || // usine ? icon == 119 || icon == 120 || // usine ?
icon == 121 || icon == 122 ) // mine de fer ? icon == 121 || icon == 122 ) // mine de fer ?
{ {
goto lock; // l'électro ne peut pas aller dans la maison goto lock; // l'électro ne peut pas aller dans la maison
} }
return; return;
} }
@ -1560,7 +1560,7 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
lock: lock:
for ( i=0 ; i<9 ; i++ ) for ( i=0 ; i<9 ; i++ )
{ {
*pBits++ = 1; // bloqué *pBits++ = 1; // bloqué
} }
return; return;
} }
@ -1580,7 +1580,7 @@ void Copy33To99(int *pSrc33, int *pDst99, int dx, int dy)
} }
} }
// Indique s'il est possible d'avancer dans une direction donnée. // Indique s'il est possible d'avancer dans une direction donnée.
bool CDecor::IsFreeDirect(POINT cel, int direct, int rank) bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
{ {
@ -1596,14 +1596,14 @@ bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
if ( m_decor[test.x/2][test.y/2].fire > 0 && if ( m_decor[test.x/2][test.y/2].fire > 0 &&
m_decor[test.x/2][test.y/2].fire < MoveMaxFire() ) return false; m_decor[test.x/2][test.y/2].fire < MoveMaxFire() ) return false;
// Cellule bloquée (un blupi travaille ici) ? // Cellule bloquée (un blupi travaille ici) ?
if ( m_blupi[rank].perso != 3 ) // pas tracks ? if ( m_blupi[rank].perso != 3 ) // pas tracks ?
{ {
workBlupi = m_decor[test.x/2][test.y/2].workBlupi; workBlupi = m_decor[test.x/2][test.y/2].workBlupi;
if ( workBlupi >= 0 && workBlupi != rank ) return false; if ( workBlupi >= 0 && workBlupi != rank ) return false;
} }
// Déplacement possible par-rapport au sol ? // Déplacement possible par-rapport au sol ?
// icon = m_decor[cel.x/2][cel.y/2].floorIcon; // icon = m_decor[cel.x/2][cel.y/2].floorIcon;
// SearchFloor(rank, icon, cel, bits); // SearchFloor(rank, icon, cel, bits);
// AjustFloor(rank, icon, cel, bits); // AjustFloor(rank, icon, cel, bits);
@ -1615,7 +1615,7 @@ bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
if ( bits[1+1*3] == 1 ) return false; if ( bits[1+1*3] == 1 ) return false;
if ( bits[(1-vector.x)+(1-vector.y)*3] == 1 ) return false; if ( bits[(1-vector.x)+(1-vector.y)*3] == 1 ) return false;
// Déplacement possible par-rapport aux obstacles ? // Déplacement possible par-rapport aux obstacles ?
icon = m_decor[cel.x/2][cel.y/2].objectIcon; icon = m_decor[cel.x/2][cel.y/2].objectIcon;
SearchObject(rank, icon, cel, bits); SearchObject(rank, icon, cel, bits);
AjustObject(rank, icon, cel, bits); AjustObject(rank, icon, cel, bits);
@ -1627,7 +1627,7 @@ bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
if ( bits[(1-vector.x)+(1-vector.y)*3] == 1 ) return false; if ( bits[(1-vector.x)+(1-vector.y)*3] == 1 ) return false;
if ( bits[1+1*3] == 1 ) return false; if ( bits[1+1*3] == 1 ) return false;
if ( vector.x != 0 && vector.y != 0 ) // déplacement diagonal ? if ( vector.x != 0 && vector.y != 0 ) // déplacement diagonal ?
{ {
test.x = cel.x; test.x = cel.x;
test.y = cel.y+vector.y; test.y = cel.y+vector.y;
@ -1651,7 +1651,7 @@ bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
} }
// Indique si une cellule contient un objet. // Indique si une cellule contient un objet.
// Est utilisé lors du dessin (BuildPutBlupi), pour savoir // Est utilisé lors du dessin (BuildPutBlupi), pour savoir
// si blupi est devant un objet. // si blupi est devant un objet.
bool CDecor::IsFreeCelObstacle(POINT cel) bool CDecor::IsFreeCelObstacle(POINT cel)
@ -1675,7 +1675,7 @@ bool CDecor::IsFreeCelObstacle(POINT cel)
} }
// Indique si une cellule contient un sol. // Indique si une cellule contient un sol.
// Est utilisé pour savoir si blupi peut aller sur une cellule // Est utilisé pour savoir si blupi peut aller sur une cellule
// en tenant compte uniquement des sols. // en tenant compte uniquement des sols.
// Retourne true si blupi peut y aller ! // Retourne true si blupi peut y aller !
@ -1698,8 +1698,8 @@ bool CDecor::IsFreeCelFloor(POINT cel, int rank)
} }
// Indique si une cellule est libre. // Indique si une cellule est libre.
// Est utilisé pour savoir si blupi peut venir ici // Est utilisé pour savoir si blupi peut venir ici
// débarquer en bateau ou monter dans sa jeep. // débarquer en bateau ou monter dans sa jeep.
bool CDecor::IsFreeCelGo(POINT cel, int rank) bool CDecor::IsFreeCelGo(POINT cel, int rank)
{ {
@ -1739,7 +1739,7 @@ bool CDecor::IsFreeCelGo(POINT cel, int rank)
if ( bOK ) return true; if ( bOK ) return true;
if ( !m_blupi[rank].bMalade && if ( !m_blupi[rank].bMalade &&
m_blupi[rank].vehicule == 0 && // à pied ? m_blupi[rank].vehicule == 0 && // à pied ?
m_blupi[rank].perso != 8 && // pas le disciple ? m_blupi[rank].perso != 8 && // pas le disciple ?
channel == CHOBJECT && channel == CHOBJECT &&
icon == 118 ) // jeep ? icon == 118 ) // jeep ?
@ -1748,7 +1748,7 @@ bool CDecor::IsFreeCelGo(POINT cel, int rank)
} }
if ( !m_blupi[rank].bMalade && if ( !m_blupi[rank].bMalade &&
m_blupi[rank].vehicule == 0 && // à pied ? m_blupi[rank].vehicule == 0 && // à pied ?
m_blupi[rank].perso != 8 && // pas le disciple ? m_blupi[rank].perso != 8 && // pas le disciple ?
m_blupi[rank].energy > MAXENERGY/4 && // fort ? m_blupi[rank].energy > MAXENERGY/4 && // fort ?
m_blupi[rank].takeChannel == -1 && // porte rien ? m_blupi[rank].takeChannel == -1 && // porte rien ?
@ -1762,8 +1762,8 @@ bool CDecor::IsFreeCelGo(POINT cel, int rank)
} }
// Indique si on peut faire qq chose sur une cellule. // Indique si on peut faire qq chose sur une cellule.
// Est utilisé pour savoir comment est la mise en évidence (hili) // Est utilisé pour savoir comment est la mise en évidence (hili)
// à cet endroit. // à cet endroit.
bool CDecor::IsFreeCelHili(POINT cel, int rank) bool CDecor::IsFreeCelHili(POINT cel, int rank)
{ {
@ -1780,9 +1780,9 @@ bool CDecor::IsFreeCelHili(POINT cel, int rank)
icon = m_decor[cel.x/2][cel.y/2].objectIcon; icon = m_decor[cel.x/2][cel.y/2].objectIcon;
if ( channel == CHOBJECT && if ( channel == CHOBJECT &&
(icon == 12 || // fusée ? (icon == 12 || // fusée ?
(icon >= 20 && icon <= 26) || // mur ? (icon >= 20 && icon <= 26) || // mur ?
(icon >= 106 && icon <= 112) || // barrière ? (icon >= 106 && icon <= 112) || // barrière ?
(icon >= 99 && icon <= 105) || // batiment ennemi ? (icon >= 99 && icon <= 105) || // batiment ennemi ?
(icon >= 115 && icon <= 116) || // idem ? (icon >= 115 && icon <= 116) || // idem ?
(icon >= 17 && icon <= 18)) ) // idem ? (icon >= 17 && icon <= 18)) ) // idem ?
@ -1806,7 +1806,7 @@ bool CDecor::IsFreeCelHili(POINT cel, int rank)
} }
// Indique si une cellule est libre. // Indique si une cellule est libre.
// Est utilisé pour savoir si blupi peut venir ici. // Est utilisé pour savoir si blupi peut venir ici.
bool CDecor::IsFreeCel(POINT cel, int rank) bool CDecor::IsFreeCel(POINT cel, int rank)
{ {
@ -1818,7 +1818,7 @@ bool CDecor::IsFreeCel(POINT cel, int rank)
if ( m_decor[cel.x/2][cel.y/2].fire > 0 && if ( m_decor[cel.x/2][cel.y/2].fire > 0 &&
m_decor[cel.x/2][cel.y/2].fire < MoveMaxFire() ) return false; m_decor[cel.x/2][cel.y/2].fire < MoveMaxFire() ) return false;
// Cellule bloquée (un blupi travaille ici) ? // Cellule bloquée (un blupi travaille ici) ?
if ( rank != -1 && m_blupi[rank].perso != 3 ) // pas tracks ? if ( rank != -1 && m_blupi[rank].perso != 3 ) // pas tracks ?
{ {
workBlupi = m_decor[cel.x/2][cel.y/2].workBlupi; workBlupi = m_decor[cel.x/2][cel.y/2].workBlupi;
@ -1838,7 +1838,7 @@ bool CDecor::IsFreeCel(POINT cel, int rank)
return true; // pas d'obstacle return true; // pas d'obstacle
} }
// Indique si blupi peut déposer un objet ici. // Indique si blupi peut déposer un objet ici.
bool CDecor::IsFreeCelDepose(POINT cel, int rank) bool CDecor::IsFreeCelDepose(POINT cel, int rank)
{ {
@ -1847,14 +1847,14 @@ bool CDecor::IsFreeCelDepose(POINT cel, int rank)
if ( !IsFreeCel(cel, rank) ) return false; if ( !IsFreeCel(cel, rank) ) return false;
icon = m_decor[cel.x/2][cel.y/2].objectIcon; icon = m_decor[cel.x/2][cel.y/2].objectIcon;
if ( icon == 10000 || icon == 10001 || // éclairs entre tours ? if ( icon == 10000 || icon == 10001 || // éclairs entre tours ?
icon == 18 ) // dalle glissante ? icon == 18 ) // dalle glissante ?
{ {
return false; return false;
} }
icon = m_decor[cel.x/2][cel.y/2].floorIcon; icon = m_decor[cel.x/2][cel.y/2].floorIcon;
if ( icon == 80 ) // téléporteur ? if ( icon == 80 ) // téléporteur ?
{ {
return false; return false;
} }
@ -1863,7 +1863,7 @@ bool CDecor::IsFreeCelDepose(POINT cel, int rank)
} }
// Indique s'il est possible d'embarquer ici. // Indique s'il est possible d'embarquer ici.
// Le point retourné dans "limit" indique jusqu'où il est // Le point retourné dans "limit" indique jusqu'où il est
// possible de marcher normalement (sans passe muraille). // possible de marcher normalement (sans passe muraille).
bool CDecor::IsFreeCelEmbarque(POINT cel, int rank, bool CDecor::IsFreeCelEmbarque(POINT cel, int rank,
@ -1872,12 +1872,12 @@ bool CDecor::IsFreeCelEmbarque(POINT cel, int rank,
bool bOK; bool bOK;
int channel, icon; int channel, icon;
// Impossible si blupi n'est pas à pied, // Impossible si blupi n'est pas à pied,
// ou s'il s'agit d'un disciple. // ou s'il s'agit d'un disciple.
if ( rank == -1 || m_blupi[rank].vehicule != 0 || if ( rank == -1 || m_blupi[rank].vehicule != 0 ||
m_blupi[rank].perso == 8 ) return false; m_blupi[rank].perso == 8 ) return false;
// A-t-on cliqué sur un bateau ? // A-t-on cliqué sur un bateau ?
if ( cel.x%2 != 1 || cel.y%2 != 1 ) return false; if ( cel.x%2 != 1 || cel.y%2 != 1 ) return false;
GetObject(cel, channel, icon); GetObject(cel, channel, icon);
if ( channel != CHOBJECT || icon != 117 ) return false; if ( channel != CHOBJECT || icon != 117 ) return false;
@ -1941,8 +1941,8 @@ bool CDecor::IsFreeCelEmbarque(POINT cel, int rank,
return false; return false;
} }
// Indique s'il est possible de débarquer ici. // Indique s'il est possible de débarquer ici.
// Le point retourné dans "limit" indique jusqu'où il est // Le point retourné dans "limit" indique jusqu'où il est
// possible de naviguer normalement (sans passe muraille). // possible de naviguer normalement (sans passe muraille).
bool CDecor::IsFreeCelDebarque(POINT cel, int rank, bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
@ -1956,14 +1956,14 @@ bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
if ( rank == -1 || m_blupi[rank].vehicule != 1 ) return false; if ( rank == -1 || m_blupi[rank].vehicule != 1 ) return false;
m_blupi[rank].vehicule = 0; m_blupi[rank].vehicule = 0;
bOK = IsFreeCel(cel, rank); // libre (à pied) ? bOK = IsFreeCel(cel, rank); // libre (à pied) ?
m_blupi[rank].vehicule = 1; m_blupi[rank].vehicule = 1;
if ( !bOK ) return false; if ( !bOK ) return false;
GetFloor(GetCel(cel,+2,0), channel1, icon1); GetFloor(GetCel(cel,+2,0), channel1, icon1);
GetObject(GetCel(cel,+2,0), channel2, icon2); GetObject(GetCel(cel,+2,0), channel2, icon2);
if ( channel1 == CHFLOOR && icon1 == 2 && // rive ? if ( channel1 == CHFLOOR && icon1 == 2 && // rive ?
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ? channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
cel.x%2 == 1 && cel.y%2 == 1 ) cel.x%2 == 1 && cel.y%2 == 1 )
{ {
limit = GetCel(cel,+3,0); limit = GetCel(cel,+3,0);
@ -1974,7 +1974,7 @@ bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
GetFloor(GetCel(cel,0,+2), channel1, icon1); GetFloor(GetCel(cel,0,+2), channel1, icon1);
GetObject(GetCel(cel,0,+2), channel2, icon2); GetObject(GetCel(cel,0,+2), channel2, icon2);
if ( channel1 == CHFLOOR && icon1 == 3 && // rive ? if ( channel1 == CHFLOOR && icon1 == 3 && // rive ?
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ? channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
cel.x%2 == 1 && cel.y%2 == 1 ) cel.x%2 == 1 && cel.y%2 == 1 )
{ {
limit = GetCel(cel,0,+3); limit = GetCel(cel,0,+3);
@ -1985,7 +1985,7 @@ bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
GetFloor(GetCel(cel,-2,0), channel1, icon1); GetFloor(GetCel(cel,-2,0), channel1, icon1);
GetObject(GetCel(cel,-2,0), channel2, icon2); GetObject(GetCel(cel,-2,0), channel2, icon2);
if ( channel1 == CHFLOOR && icon1 == 4 && // rive ? if ( channel1 == CHFLOOR && icon1 == 4 && // rive ?
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ? channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
cel.x%2 == 0 && cel.y%2 == 1 ) cel.x%2 == 0 && cel.y%2 == 1 )
{ {
limit = GetCel(cel,-2,0); limit = GetCel(cel,-2,0);
@ -1996,7 +1996,7 @@ bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
GetFloor(GetCel(cel,0,-2), channel1, icon1); GetFloor(GetCel(cel,0,-2), channel1, icon1);
GetObject(GetCel(cel,0,-2), channel2, icon2); GetObject(GetCel(cel,0,-2), channel2, icon2);
if ( channel1 == CHFLOOR && icon1 == 5 && // rive ? if ( channel1 == CHFLOOR && icon1 == 5 && // rive ?
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ? channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
cel.x%2 == 1 && cel.y%2 == 0 ) cel.x%2 == 1 && cel.y%2 == 0 )
{ {
limit = GetCel(cel,0,-2); limit = GetCel(cel,0,-2);
@ -2015,13 +2015,13 @@ bool CDecor::IsFreeJump(POINT cel, int direct, int rank, int &action)
int i, icon; int i, icon;
int bits[3*3]; int bits[3*3];
// Refuse de sauter si blupi n'est pas à pied ! // Refuse de sauter si blupi n'est pas à pied !
if ( m_blupi[rank].vehicule != 0 ) return false; if ( m_blupi[rank].vehicule != 0 ) return false;
// Refuse de sauter dans les directions se, so, no, ne. // Refuse de sauter dans les directions se, so, no, ne.
if ( (direct/16)%2 != 0 ) return false; if ( (direct/16)%2 != 0 ) return false;
// Refuse de sauter si peu d'énergie ou si porte qq chose. // Refuse de sauter si peu d'énergie ou si porte qq chose.
if ( m_blupi[rank].perso != 0 || if ( m_blupi[rank].perso != 0 ||
m_blupi[rank].energy <= MAXENERGY/4 || m_blupi[rank].energy <= MAXENERGY/4 ||
m_blupi[rank].takeChannel != -1 ) return false; m_blupi[rank].takeChannel != -1 ) return false;
@ -2041,13 +2041,13 @@ bool CDecor::IsFreeJump(POINT cel, int direct, int rank, int &action)
} }
if ( i == 0 ) return false; if ( i == 0 ) return false;
// Départ possible par-rapport aux obstacles ? // Départ possible par-rapport aux obstacles ?
icon = m_decor[depart.x/2][depart.y/2].objectIcon; icon = m_decor[depart.x/2][depart.y/2].objectIcon;
SearchObject(rank, icon, depart, bits); SearchObject(rank, icon, depart, bits);
AjustObject(rank, icon, depart, bits); AjustObject(rank, icon, depart, bits);
if ( bits[(1+vector.x)+(1+vector.y)*3] == 1 ) return false; if ( bits[(1+vector.x)+(1+vector.y)*3] == 1 ) return false;
// Arrivée possible par-rapport aux obstacles ? // Arrivée possible par-rapport aux obstacles ?
icon = m_decor[cel.x/2][cel.y/2].objectIcon; icon = m_decor[cel.x/2][cel.y/2].objectIcon;
SearchObject(rank, icon, cel, bits); SearchObject(rank, icon, cel, bits);
AjustObject(rank, icon, cel, bits); AjustObject(rank, icon, cel, bits);
@ -2083,7 +2083,7 @@ bool CDecor::IsFreeGlisse(POINT cel, int direct, int rank, int &action)
// Cherche la meilleure direction pour atteindre un but. // Cherche la meilleure direction pour atteindre un but.
// Retourne -1 si on est déjà sur le but. // Retourne -1 si on est déjà sur le but.
int CDecor::DirectSearch(POINT cel, POINT goal) int CDecor::DirectSearch(POINT cel, POINT goal)
{ {
@ -2120,7 +2120,7 @@ int CDecor::DirectSearch(POINT cel, POINT goal)
} }
#endif #endif
// Cherche le huitième de cadrant correspondant à // Cherche le huitième de cadrant correspondant à
// la direction. // la direction.
// 41 = 100*tan(22.5) // 41 = 100*tan(22.5)
// 241 = 100*tan(67.5) // 241 = 100*tan(67.5)
@ -2169,7 +2169,7 @@ int CDecor::DirectSearch(POINT cel, POINT goal)
} }
// Vide les positions déjà essayées. // Vide les positions déjà essayées.
void CDecor::FlushUsed(int rank) void CDecor::FlushUsed(int rank)
{ {
@ -2177,16 +2177,16 @@ void CDecor::FlushUsed(int rank)
m_blupi[rank].nextRankUsed = 0; m_blupi[rank].nextRankUsed = 0;
} }
// Ajoute une position déjà été essayée. // Ajoute une position déjà été essayée.
void CDecor::AddUsedPos(int rank, POINT pos) void CDecor::AddUsedPos(int rank, POINT pos)
{ {
int i, j, old; int i, j, old;
// Un virus est bête. // Un virus est bête.
if ( m_blupi[rank].perso == 2 ) return; if ( m_blupi[rank].perso == 2 ) return;
// Déjà dans la liste ? // Déjà dans la liste ?
for ( i=0 ; i<m_blupi[rank].nbUsed ; i++ ) for ( i=0 ; i<m_blupi[rank].nbUsed ; i++ )
{ {
if ( pos.x == m_blupi[rank].posUsed[i].x && if ( pos.x == m_blupi[rank].posUsed[i].x &&
@ -2217,7 +2217,7 @@ void CDecor::AddUsedPos(int rank, POINT pos)
return; return;
} }
// Ajoute à la suite de la liste. // Ajoute à la suite de la liste.
i = m_blupi[rank].nbUsed; i = m_blupi[rank].nbUsed;
m_blupi[rank].posUsed[i] = pos; m_blupi[rank].posUsed[i] = pos;
@ -2227,7 +2227,7 @@ void CDecor::AddUsedPos(int rank, POINT pos)
return; return;
} }
// Cherche si une position a déjà été essayée. // Cherche si une position a déjà été essayée.
bool CDecor::IsUsedPos(int rank, POINT pos) bool CDecor::IsUsedPos(int rank, POINT pos)
{ {
@ -2302,7 +2302,7 @@ bool CDecor::SearchBestBase(int rank, int &action, POINT &newCel, int &direct)
if ( m_blupi[rank].perso == 3 ) // tracks ? if ( m_blupi[rank].perso == 3 ) // tracks ?
{ {
// Le tracks peut aller sur les blupi // Le tracks peut aller sur les blupi
// pour les écraser ! // pour les écraser !
if ( IsTracksHere(newCel, false) ) if ( IsTracksHere(newCel, false) )
{ {
continue; continue;
@ -2348,10 +2348,10 @@ bool CDecor::SearchBestPass(int rank, int &action)
POINT iCel, lCel, cel; POINT iCel, lCel, cel;
if ( m_blupi[rank].perso == 0 || // blupi ? if ( m_blupi[rank].perso == 0 || // blupi ?
m_blupi[rank].perso == 7 || // électro ? m_blupi[rank].perso == 7 || // électro ?
m_blupi[rank].perso == 8 || // disciple ? m_blupi[rank].perso == 8 || // disciple ?
(m_blupi[rank].perso == 4 && // robot ? (m_blupi[rank].perso == 4 && // robot ?
m_term.bHachRobot ) ) // robot sur dalles hachurées ? m_term.bHachRobot ) ) // robot sur dalles hachurées ?
{ {
if ( m_blupi[rank].busyDelay > 0 ) if ( m_blupi[rank].busyDelay > 0 )
{ {
@ -2363,20 +2363,20 @@ bool CDecor::SearchBestPass(int rank, int &action)
} }
return false; return false;
} }
if ( CheminCherche(rank, action) ) // recherche futée selon DD ... if ( CheminCherche(rank, action) ) // recherche futée selon DD ...
{ {
return true; return true;
} }
else else
{ {
// Si la destination est occupée pendant une répétition, // Si la destination est occupée pendant une répétition,
// il faut attendre à l'infini ! // il faut attendre à l'infini !
if ( m_blupi[rank].repeatLevel != -1 && if ( m_blupi[rank].repeatLevel != -1 &&
IsBlupiHereEx(m_blupi[rank].goalCel, rank, false) ) IsBlupiHereEx(m_blupi[rank].goalCel, rank, false) )
{ {
m_blupi[rank].busyCount ++; m_blupi[rank].busyCount ++;
} }
m_blupi[rank].busyDelay = Random(8,12); // délai avant réessai m_blupi[rank].busyDelay = Random(8,12); // délai avant réessai
return false; return false;
} }
} }
@ -2404,8 +2404,8 @@ bool CDecor::SearchBestPass(int rank, int &action)
m_blupi[rank].cel = cel; m_blupi[rank].cel = cel;
lCel = cel; lCel = cel;
// Est-on revenu juste à côté de la position // Est-on revenu juste à côté de la position
// de départ ? Si oui, simplifie le mouvement. // de départ ? Si oui, simplifie le mouvement.
if ( i > 1 && if ( i > 1 &&
abs(m_blupi[rank].cel.x-iCel.x) <= 1 && abs(m_blupi[rank].cel.x-iCel.x) <= 1 &&
abs(m_blupi[rank].cel.y-iCel.y) <= 1 ) abs(m_blupi[rank].cel.y-iCel.y) <= 1 )
@ -2450,9 +2450,9 @@ bool CDecor::SearchBestPass(int rank, int &action)
} }
// Vérifie si un objet est utilisable pour travailler dessus. // Vérifie si un objet est utilisable pour travailler dessus.
// Le sol doit permettre d'aller aux 4 coins, et il ne doit // Le sol doit permettre d'aller aux 4 coins, et il ne doit
// pas y avoir un autre blupi que soi-même. // pas y avoir un autre blupi que soi-même.
bool CDecor::IsWorkableObject(POINT cel, int rank) bool CDecor::IsWorkableObject(POINT cel, int rank)
{ {
@ -2621,7 +2621,7 @@ bool CDecor::SearchOtherDrapeau(int rank, POINT initCel, int distMax,
if ( m_decor[x/2][y/2].objectIcon == -1 && if ( m_decor[x/2][y/2].objectIcon == -1 &&
((icon >= 33 && icon <= 48) || // terre ? ((icon >= 33 && icon <= 48) || // terre ?
icon == 71 ) && icon == 71 ) &&
!TestDrapeau(GetCel(x,y)) ) // pas encore sondé ? !TestDrapeau(GetCel(x,y)) ) // pas encore sondé ?
{ {
cel.x = x; cel.x = x;
cel.y = y; cel.y = y;
@ -2644,7 +2644,7 @@ bool CDecor::SearchOtherDrapeau(int rank, POINT initCel, int distMax,
return true; return true;
} }
// Cherche un autre sol permettant de déposer du bois // Cherche un autre sol permettant de déposer du bois
// pour construire un bateau. // pour construire un bateau.
bool CDecor::SearchOtherBateau(int rank, POINT initCel, int distMax, bool CDecor::SearchOtherBateau(int rank, POINT initCel, int distMax,
@ -2686,16 +2686,16 @@ bool CDecor::SearchOtherBateau(int rank, POINT initCel, int distMax,
} }
// Vérifie si l'objet peut être détruit par l'araignée. // Vérifie si l'objet peut être détruit par l'araignée.
bool CDecor::IsSpiderObject(int icon) bool CDecor::IsSpiderObject(int icon)
{ {
return ( icon == 60 || // tomates ? return ( icon == 60 || // tomates ?
icon == 92 || // poison ? icon == 92 || // poison ?
icon == 93 ); // piège ? icon == 93 ); // piège ?
} }
// Cherche un autre objet pour l'araignée. // Cherche un autre objet pour l'araignée.
bool CDecor::SearchSpiderObject(int rank, POINT initCel, int distMax, bool CDecor::SearchSpiderObject(int rank, POINT initCel, int distMax,
POINT &foundCel, int &foundIcon) POINT &foundCel, int &foundIcon)
@ -2727,8 +2727,8 @@ bool CDecor::SearchSpiderObject(int rank, POINT initCel, int distMax,
dist = abs(initCel.x-x) + abs(initCel.y-y); dist = abs(initCel.x-x) + abs(initCel.y-y);
if ( m_decor[x/2][y/2].objectIcon == 93 && //piège ? if ( m_decor[x/2][y/2].objectIcon == 93 && //piège ?
dist > 4 ) continue; // si piège loin -> ignore dist > 4 ) continue; // si piège loin -> ignore
if ( dist <= min ) if ( dist <= min )
{ {
@ -2747,7 +2747,7 @@ bool CDecor::SearchSpiderObject(int rank, POINT initCel, int distMax,
} }
// Vérifie si l'objet peut être détruit par le tracks. // Vérifie si l'objet peut être détruit par le tracks.
bool CDecor::IsTracksObject(int icon) bool CDecor::IsTracksObject(int icon)
{ {
@ -2758,8 +2758,8 @@ bool CDecor::IsTracksObject(int icon)
icon == 80 || // bouteille ? icon == 80 || // bouteille ?
icon == 85 || // dynamite ? icon == 85 || // dynamite ?
icon == 92 || // poison ? icon == 92 || // poison ?
icon == 93 || // piège ? icon == 93 || // piège ?
icon == 123 || // piège ? icon == 123 || // piège ?
icon == 125 || // mine ? icon == 125 || // mine ?
icon == 127 || // mine ? icon == 127 || // mine ?
(icon >= 81 && icon <= 84) || // fleurs ? (icon >= 81 && icon <= 84) || // fleurs ?
@ -2809,12 +2809,12 @@ bool CDecor::SearchTracksObject(int rank, POINT initCel, int distMax,
} }
} }
// Le tracks peut écraser blupi. // Le tracks peut écraser blupi.
for ( rank=0 ; rank<MAXBLUPI ; rank++ ) for ( rank=0 ; rank<MAXBLUPI ; rank++ )
{ {
if ( m_blupi[rank].bExist && if ( m_blupi[rank].bExist &&
m_blupi[rank].perso == 0 && // blupi ? m_blupi[rank].perso == 0 && // blupi ?
m_blupi[rank].vehicule == 0 ) // à pied ? m_blupi[rank].vehicule == 0 ) // à pied ?
{ {
//? if ( BlupiIsGoalUsed(m_blupi[rank].cel) ) continue; //? if ( BlupiIsGoalUsed(m_blupi[rank].cel) ) continue;
@ -2847,12 +2847,12 @@ bool CDecor::SearchTracksObject(int rank, POINT initCel, int distMax,
} }
// Vérifie si l'objet peut être détruit par le robot. // Vérifie si l'objet peut être détruit par le robot.
bool CDecor::IsRobotObject(int icon) bool CDecor::IsRobotObject(int icon)
{ {
return ( icon == 85 || // dynamite ? return ( icon == 85 || // dynamite ?
icon == 93 || // piège ? icon == 93 || // piège ?
icon == 125 || // mine ? icon == 125 || // mine ?
icon == 127 ); // mine ? icon == 127 ); // mine ?
} }
@ -2871,7 +2871,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
int nbPerso[10]; int nbPerso[10];
int i, r, d, dd, icon, index, nb; int i, r, d, dd, icon, index, nb;
if ( m_term.bHachRobot ) // robot sur dalles hachurées ? if ( m_term.bHachRobot ) // robot sur dalles hachurées ?
{ {
foundAction = WM_ACTION_GO; foundAction = WM_ACTION_GO;
return SearchOtherObject(rank, initCel, WM_ACTION_GO, return SearchOtherObject(rank, initCel, WM_ACTION_GO,
@ -2880,7 +2880,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
} }
initCel.x = (initCel.x/2)*2; initCel.x = (initCel.x/2)*2;
initCel.y = (initCel.y/2)*2; // bâtiments très espacés ! initCel.y = (initCel.y/2)*2; // bâtiments très espacés !
startx = ((initCel.x-distMax/2)/2)*2; startx = ((initCel.x-distMax/2)/2)*2;
endx = ((initCel.x+distMax/2)/2)*2; endx = ((initCel.x+distMax/2)/2)*2;
@ -2905,15 +2905,15 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
if ( icon == 99 ) nbUsine[0] ++; // recharge ? if ( icon == 99 ) nbUsine[0] ++; // recharge ?
if ( icon == 104 ) nbUsine[1] ++; // usine tracks ? if ( icon == 104 ) nbUsine[1] ++; // usine tracks ?
if ( icon == 100 ) nbUsine[2] ++; // usine araignée ? if ( icon == 100 ) nbUsine[2] ++; // usine araignée ?
if ( icon == 102 ) nbUsine[3] ++; // usine virus ? if ( icon == 102 ) nbUsine[3] ++; // usine virus ?
if ( icon == 115 ) nbUsine[4] ++; // usine bombe ? if ( icon == 115 ) nbUsine[4] ++; // usine bombe ?
if ( icon == 17 ) nbUsine[5] ++; // usine électro ? if ( icon == 17 ) nbUsine[5] ++; // usine électro ?
dist = abs(initCel.x-x) + abs(initCel.y-y); dist = abs(initCel.x-x) + abs(initCel.y-y);
if ( IsRobotObject(icon) && // piège/dynamite ? if ( IsRobotObject(icon) && // piège/dynamite ?
dist <= 4 ) // très proche ? dist <= 4 ) // très proche ?
{ {
if ( dist <= min ) if ( dist <= min )
{ {
@ -2928,7 +2928,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
if ( min < distMax ) if ( min < distMax )
{ {
foundAction = -1; // robot passe tout prèt d'un piège/dynamite foundAction = -1; // robot passe tout prèt d'un piège/dynamite
return true; return true;
} }
@ -2956,7 +2956,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
//? goto search; //? goto search;
//? } //? }
if ( min == 0 ) // encore une usine à construire ? if ( min == 0 ) // encore une usine à construire ?
{ {
// Libre juste ici ? // Libre juste ici ?
if ( IsUsineBuild(rank, initCel) ) if ( IsUsineBuild(rank, initCel) )
@ -2965,10 +2965,10 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
build: build:
if ( index == 0 ) foundAction = WM_ACTION_R_BUILD1; // recharge if ( index == 0 ) foundAction = WM_ACTION_R_BUILD1; // recharge
if ( index == 1 ) foundAction = WM_ACTION_R_BUILD4; // tracks if ( index == 1 ) foundAction = WM_ACTION_R_BUILD4; // tracks
if ( index == 2 ) foundAction = WM_ACTION_R_BUILD2; // araignée if ( index == 2 ) foundAction = WM_ACTION_R_BUILD2; // araignée
if ( index == 3 ) foundAction = WM_ACTION_R_BUILD3; // virus if ( index == 3 ) foundAction = WM_ACTION_R_BUILD3; // virus
if ( index == 4 ) foundAction = WM_ACTION_R_BUILD5; // bombe if ( index == 4 ) foundAction = WM_ACTION_R_BUILD5; // bombe
if ( index == 5 ) foundAction = WM_ACTION_R_BUILD6; // électro if ( index == 5 ) foundAction = WM_ACTION_R_BUILD6; // électro
return true; return true;
} }
// Cherche un emplacement libre. // Cherche un emplacement libre.
@ -2980,9 +2980,9 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
{ {
for ( dd=0 ; dd<=d ; dd++ ) for ( dd=0 ; dd<=d ; dd++ )
{ {
if ( i == 0 ) x -= 6; // à gauche if ( i == 0 ) x -= 6; // à gauche
if ( i == 1 ) y += 6; // descend if ( i == 1 ) y += 6; // descend
if ( i == 2 ) x += 6; // à droite if ( i == 2 ) x += 6; // à droite
if ( i == 3 ) y -= 6; // monte if ( i == 3 ) y -= 6; // monte
if ( IsUsineBuild(rank, GetCel(x,y)) ) if ( IsUsineBuild(rank, GetCel(x,y)) )
@ -2996,7 +2996,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
} }
} }
// Cherche l'ennemi le moins répandu. // Cherche l'ennemi le moins répandu.
for ( i=0 ; i<10 ; i++ ) for ( i=0 ; i<10 ; i++ )
{ {
nbPerso[i] = 0; nbPerso[i] = 0;
@ -3011,7 +3011,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
{ {
nbPerso[0] += 1; nbPerso[0] += 1;
} }
if ( m_blupi[r].perso == 1 ) // araignée ? if ( m_blupi[r].perso == 1 ) // araignée ?
{ {
nbPerso[1] += 1; nbPerso[1] += 1;
} }
@ -3023,14 +3023,14 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
{ {
nbPerso[3] += 2; nbPerso[3] += 2;
} }
if ( m_blupi[r].perso == 7 ) // électro ? if ( m_blupi[r].perso == 7 ) // électro ?
{ {
nbPerso[4] += 2; nbPerso[4] += 2;
} }
} }
} }
if ( nb > MAXBLUPI-10 ) return false; // rien si trop peuplé ! if ( nb > MAXBLUPI-10 ) return false; // rien si trop peuplé !
// Cherche l'ennemi le moins répandu. // Cherche l'ennemi le moins répandu.
min = 999; min = 999;
index = 0; index = 0;
for ( i=0 ; i<5 ; i++ ) for ( i=0 ; i<5 ; i++ )
@ -3047,12 +3047,12 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
index = 0; // station de recharge index = 0; // station de recharge
} }
if ( m_skill >= 1 ) maxUsine *= 2; // 2 ennemis par batiment if ( m_skill >= 1 ) maxUsine *= 2; // 2 ennemis par batiment
if ( min >= maxUsine ) // assez peuplé ? if ( min >= maxUsine ) // assez peuplé ?
{ {
index = 0; // station de recharge index = 0; // station de recharge
} }
// Cherche l'usine pour fabriquer l'ennemi le moins rédandu. // Cherche l'usine pour fabriquer l'ennemi le moins rédandu.
//? search: //? search:
min = distMax; min = distMax;
for ( y=starty ; y<endy ; y+=2 ) for ( y=starty ; y<endy ; y+=2 )
@ -3063,10 +3063,10 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
if ( (index == 0 && icon == 99) || // recharge ? if ( (index == 0 && icon == 99) || // recharge ?
(index == 1 && icon == 104) || // tracks ? (index == 1 && icon == 104) || // tracks ?
(index == 2 && icon == 100) || // araignée ? (index == 2 && icon == 100) || // araignée ?
(index == 3 && icon == 102) || // virus ? (index == 3 && icon == 102) || // virus ?
(index == 4 && icon == 115) || // bombe ? (index == 4 && icon == 115) || // bombe ?
(index == 5 && icon == 17) ) // électro ? (index == 5 && icon == 17) ) // électro ?
{ {
if ( IsUsineFree(rank, GetCel(x,y)) ) if ( IsUsineFree(rank, GetCel(x,y)) )
{ {
@ -3086,10 +3086,10 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
{ {
if ( index == 0 ) foundAction = WM_ACTION_R_MAKE1; // recharge if ( index == 0 ) foundAction = WM_ACTION_R_MAKE1; // recharge
if ( index == 1 ) foundAction = WM_ACTION_R_MAKE4; // tracks if ( index == 1 ) foundAction = WM_ACTION_R_MAKE4; // tracks
if ( index == 2 ) foundAction = WM_ACTION_R_MAKE2; // araignée if ( index == 2 ) foundAction = WM_ACTION_R_MAKE2; // araignée
if ( index == 3 ) foundAction = WM_ACTION_R_MAKE3; // virus if ( index == 3 ) foundAction = WM_ACTION_R_MAKE3; // virus
if ( index == 4 ) foundAction = WM_ACTION_R_MAKE5; // bombe if ( index == 4 ) foundAction = WM_ACTION_R_MAKE5; // bombe
if ( index == 5 ) foundAction = WM_ACTION_R_MAKE6; // électro if ( index == 5 ) foundAction = WM_ACTION_R_MAKE6; // électro
return true; return true;
} }
@ -3101,11 +3101,11 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
{ {
icon = m_decor[x/2][y/2].objectIcon; icon = m_decor[x/2][y/2].objectIcon;
if ( (icon == 100 && nbPerso[1] <= maxUsine) || // araignée ? if ( (icon == 100 && nbPerso[1] <= maxUsine) || // araignée ?
(icon == 102 && nbPerso[2] <= maxUsine) || // virus ? (icon == 102 && nbPerso[2] <= maxUsine) || // virus ?
(icon == 104 && nbPerso[0] <= maxUsine) || // tracks ? (icon == 104 && nbPerso[0] <= maxUsine) || // tracks ?
(icon == 115 && nbPerso[3] <= maxUsine) || // bombe ? (icon == 115 && nbPerso[3] <= maxUsine) || // bombe ?
(icon == 17 && nbPerso[4] <= maxUsine) ) // électro ? (icon == 17 && nbPerso[4] <= maxUsine) ) // électro ?
{ {
if ( IsUsineFree(rank, GetCel(x,y)) ) if ( IsUsineFree(rank, GetCel(x,y)) )
{ {
@ -3123,25 +3123,25 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
} }
if ( min < distMax ) if ( min < distMax )
{ {
if ( foundIcon == 100 ) foundAction = WM_ACTION_R_MAKE2; // araignée if ( foundIcon == 100 ) foundAction = WM_ACTION_R_MAKE2; // araignée
if ( foundIcon == 102 ) foundAction = WM_ACTION_R_MAKE3; // virus if ( foundIcon == 102 ) foundAction = WM_ACTION_R_MAKE3; // virus
if ( foundIcon == 104 ) foundAction = WM_ACTION_R_MAKE4; // tracks if ( foundIcon == 104 ) foundAction = WM_ACTION_R_MAKE4; // tracks
if ( foundIcon == 115 ) foundAction = WM_ACTION_R_MAKE5; // bombe if ( foundIcon == 115 ) foundAction = WM_ACTION_R_MAKE5; // bombe
if ( foundIcon == 17 ) foundAction = WM_ACTION_R_MAKE6; // électro if ( foundIcon == 17 ) foundAction = WM_ACTION_R_MAKE6; // électro
return true; return true;
} }
return false; return false;
} }
// Teste si un emplacement est ok pour bâtir une usine. // Teste si un emplacement est ok pour bâtir une usine.
bool CDecor::IsUsineBuild(int rank, POINT cel) bool CDecor::IsUsineBuild(int rank, POINT cel)
{ {
int icon, channel; int icon, channel;
int x, y; int x, y;
// Pas sur les dalles hachurées ! // Pas sur les dalles hachurées !
GetFloor(cel, channel, icon); GetFloor(cel, channel, icon);
if ( channel == CHFLOOR && if ( channel == CHFLOOR &&
(icon < 65 || icon > 67) ) return false; (icon < 65 || icon > 67) ) return false;
@ -3162,7 +3162,7 @@ bool CDecor::IsUsineBuild(int rank, POINT cel)
} }
// Teste s'il est possible d'entrer dans une usine. // Teste s'il est possible d'entrer dans une usine.
// L'usine doit être libre devant (lieu de stationnement // L'usine doit être libre devant (lieu de stationnement
// pour l'ennemi qui sera construit). // pour l'ennemi qui sera construit).
bool CDecor::IsUsineFree(int rank, POINT cel) bool CDecor::IsUsineFree(int rank, POINT cel)
@ -3171,7 +3171,7 @@ bool CDecor::IsUsineFree(int rank, POINT cel)
GetObject(cel, channel, icon); GetObject(cel, channel, icon);
if ( channel == CHOBJECT && icon == 115 ) // usine à bombes ? if ( channel == CHOBJECT && icon == 115 ) // usine à bombes ?
{ {
return ( !IsBlupiHereEx(GetCel(cel,0,1), rank, false) && return ( !IsBlupiHereEx(GetCel(cel,0,1), rank, false) &&
!IsBlupiHereEx(GetCel(cel,1,1), rank, false) && !IsBlupiHereEx(GetCel(cel,1,1), rank, false) &&
@ -3188,7 +3188,7 @@ bool CDecor::IsUsineFree(int rank, POINT cel)
} }
// Vérifie si l'objet peut être détruit par une bombe. // Vérifie si l'objet peut être détruit par une bombe.
bool CDecor::IsBombeObject(int icon) bool CDecor::IsBombeObject(int icon)
{ {
@ -3196,7 +3196,7 @@ bool CDecor::IsBombeObject(int icon)
icon == 61 || // cabane ? icon == 61 || // cabane ?
icon == 121 || icon == 122 || // mine de fer ? icon == 121 || icon == 122 || // mine de fer ?
(icon >= 65 && icon <= 71) || // palissade ? (icon >= 65 && icon <= 71) || // palissade ?
icon == 93 || // piège ? icon == 93 || // piège ?
icon == 117 ); // bateau ? icon == 117 ); // bateau ?
} }
@ -3232,8 +3232,8 @@ bool CDecor::SearchBombeObject(int rank, POINT initCel, int distMax,
dist = abs(initCel.x-x) + abs(initCel.y-y); dist = abs(initCel.x-x) + abs(initCel.y-y);
if ( m_decor[x/2][y/2].objectIcon == 93 && //piège ? if ( m_decor[x/2][y/2].objectIcon == 93 && //piège ?
dist > 8 ) continue; // si piège loin -> ignore dist > 8 ) continue; // si piège loin -> ignore
if ( dist <= min ) if ( dist <= min )
{ {
@ -3251,7 +3251,7 @@ bool CDecor::SearchBombeObject(int rank, POINT initCel, int distMax,
return true; return true;
} }
// Cherche un autre objet pour un électro. // Cherche un autre objet pour un électro.
bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax, bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax,
POINT &foundCel, int &foundIcon) POINT &foundCel, int &foundIcon)
@ -3275,7 +3275,7 @@ bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax,
{ {
for ( x=startx ; x<endx ; x+=2 ) for ( x=startx ; x<endx ; x+=2 )
{ {
if ( m_decor[x/2][y/2].objectIcon == 93 ) // piège ? if ( m_decor[x/2][y/2].objectIcon == 93 ) // piège ?
{ {
cel.x = x; cel.x = x;
cel.y = y; cel.y = y;
@ -3327,9 +3327,9 @@ bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax,
{ {
for ( dd=0 ; dd<=d ; dd++ ) for ( dd=0 ; dd<=d ; dd++ )
{ {
if ( i == 0 ) x -= 1; // à gauche if ( i == 0 ) x -= 1; // à gauche
if ( i == 1 ) y += 1; // descend if ( i == 1 ) y += 1; // descend
if ( i == 2 ) x += 1; // à droite if ( i == 2 ) x += 1; // à droite
if ( i == 3 ) y -= 1; // monte if ( i == 3 ) y -= 1; // monte
if ( IsFreeCel(GetCel(x,y), rank) && if ( IsFreeCel(GetCel(x,y), rank) &&
@ -3347,7 +3347,7 @@ bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax,
} }
// Teste si une position est très proche du feu. // Teste si une position est très proche du feu.
// Si oui, retourne true. // Si oui, retourne true.
bool CDecor::IsFireCel(POINT cel) bool CDecor::IsFireCel(POINT cel)
@ -3375,7 +3375,7 @@ bool CDecor::IsFireCel(POINT cel)
return false; return false;
} }
// Teste si une position est très proche d'un virus. // Teste si une position est très proche d'un virus.
// Si oui, retourne true. // Si oui, retourne true.
bool CDecor::IsVirusCel(POINT cel) bool CDecor::IsVirusCel(POINT cel)
@ -3398,8 +3398,8 @@ bool CDecor::IsVirusCel(POINT cel)
} }
// Regarde s'il est possible de construire un pont à partir // Regarde s'il est possible de construire un pont à partir
// d'une cellule donnée (cel). // d'une cellule donnée (cel).
// Retourne 0 si c'est possible, ou une erreur autrement ! // Retourne 0 si c'est possible, ou une erreur autrement !
int CDecor::IsBuildPont(POINT &cel, int &iconBuild) int CDecor::IsBuildPont(POINT &cel, int &iconBuild)
@ -3497,7 +3497,7 @@ int CDecor::IsBuildPont(POINT &cel, int &iconBuild)
if ( nb == 1 ) iconBuild = p1; if ( nb == 1 ) iconBuild = p1;
else iconBuild = p2; else iconBuild = p2;
// Avance jusqu'à la rive opposée. // Avance jusqu'à la rive opposée.
rest = 0; rest = 0;
do do
{ {
@ -3528,8 +3528,8 @@ int CDecor::IsBuildPont(POINT &cel, int &iconBuild)
return error; return error;
} }
// Regarde s'il est possible de construire un bateau à partir // Regarde s'il est possible de construire un bateau à partir
// d'une cellule donnée (cel). // d'une cellule donnée (cel).
bool CDecor::IsBuildBateau(POINT cel, int &direct) bool CDecor::IsBuildBateau(POINT cel, int &direct)
{ {
@ -3577,7 +3577,7 @@ bool CDecor::IsBuildBateau(POINT cel, int &direct)
} }
// Vide toutes les positions visitées. // Vide toutes les positions visitées.
void CDecor::InitDrapeau() void CDecor::InitDrapeau()
{ {
@ -3590,13 +3590,13 @@ void CDecor::InitDrapeau()
} }
} }
// Mémorise une cellule visitée (ne contenant pas de fer). // Mémorise une cellule visitée (ne contenant pas de fer).
void CDecor::AddDrapeau(POINT cel) void CDecor::AddDrapeau(POINT cel)
{ {
int i; int i;
if ( TestDrapeau(cel) ) return; // déjà dans la liste if ( TestDrapeau(cel) ) return; // déjà dans la liste
for ( i=MAXLASTDRAPEAU-1 ; i>0 ; i-- ) for ( i=MAXLASTDRAPEAU-1 ; i>0 ; i-- )
{ {
@ -3606,7 +3606,7 @@ void CDecor::AddDrapeau(POINT cel)
m_lastDrapeau[0] = cel; m_lastDrapeau[0] = cel;
} }
// Supprime une cellule visitée (ne contenant pas de fer). // Supprime une cellule visitée (ne contenant pas de fer).
void CDecor::SubDrapeau(POINT cel) void CDecor::SubDrapeau(POINT cel)
{ {
@ -3623,7 +3623,7 @@ void CDecor::SubDrapeau(POINT cel)
} }
} }
// Teste si une cellule a déjà été visitée. // Teste si une cellule a déjà été visitée.
bool CDecor::TestDrapeau(POINT cel) bool CDecor::TestDrapeau(POINT cel)
{ {

View File

@ -72,7 +72,7 @@ CPixmap::~CPixmap()
} }
} }
// Cr<EFBFBD>e l'objet DirectDraw principal. // Cr�e l'objet DirectDraw principal.
// Retourne false en cas d'erreur. // Retourne false en cas d'erreur.
bool CPixmap::Create(POINT dim, bool CPixmap::Create(POINT dim,
@ -90,7 +90,7 @@ bool CPixmap::Create(POINT dim,
return true; return true;
} }
// Lib<EFBFBD>re les bitmaps. // Lib�re les bitmaps.
bool CPixmap::Flush() bool CPixmap::Flush()
{ {
@ -101,7 +101,7 @@ bool CPixmap::Flush()
void CPixmap::Fill(RECT rect, COLORREF color) void CPixmap::Fill(RECT rect, COLORREF color)
{ {
// <EFBFBD> faire si n<>cessaire ... // � faire si n�cessaire ...
} }
// Effectue un appel BltFast. // Effectue un appel BltFast.
@ -192,7 +192,7 @@ int CPixmap::BltFast(SDL_Texture *lpSDL, int channel, POINT dst, RECT rcRect)
return res; return res;
} }
// Cache une image contenant des ic<EFBFBD>nes. // Cache une image contenant des ic�nes.
bool CPixmap::Cache(int channel, const char *pFilename, POINT totalDim, POINT iconDim) bool CPixmap::Cache(int channel, const char *pFilename, POINT totalDim, POINT iconDim)
{ {
@ -284,14 +284,14 @@ bool CPixmap::Cache(int channel, SDL_Surface *surface, POINT totalDim)
return true; return true;
} }
// Modifie la r<EFBFBD>gion de clipping. // Modifie la r�gion de clipping.
void CPixmap::SetClipping(RECT clip) void CPixmap::SetClipping(RECT clip)
{ {
m_clipRect = clip; m_clipRect = clip;
} }
// Retourne la r<EFBFBD>gion de clipping. // Retourne la r�gion de clipping.
RECT CPixmap::GetClipping() RECT CPixmap::GetClipping()
{ {
@ -299,7 +299,7 @@ RECT CPixmap::GetClipping()
} }
// Teste si un point fait partie d'une ic<EFBFBD>ne. // Teste si un point fait partie d'une ic�ne.
bool CPixmap::IsIconPixel(int channel, int rank, POINT pos) bool CPixmap::IsIconPixel(int channel, int rank, POINT pos)
{ {
@ -427,7 +427,7 @@ bool CPixmap::DrawIconPart(int chDst, int channel, int rank, POINT pos,
return !BltFast (chDst, channel, pos, rect); return !BltFast (chDst, channel, pos, rect);
} }
// Dessine une partie d'image n'importe o<EFBFBD>. // Dessine une partie d'image n'importe o�.
bool CPixmap::DrawPart(int chDst, int channel, POINT dest, RECT rect, bool bMask) bool CPixmap::DrawPart(int chDst, int channel, POINT dest, RECT rect, bool bMask)
{ {
@ -464,7 +464,7 @@ bool CPixmap::DrawImage(int chDst, int channel, RECT rect)
} }
// Construit une ic<EFBFBD>ne en utilisant un masque. // Construit une ic�ne en utilisant un masque.
bool CPixmap::BuildIconMask(int channelMask, int rankMask, bool CPixmap::BuildIconMask(int channelMask, int rankMask,
int channel, int rankSrc, int rankDst) int channel, int rankSrc, int rankDst)
@ -514,7 +514,7 @@ bool CPixmap::BuildIconMask(int channelMask, int rankMask,
} }
// Affiche le pixmap <EFBFBD> l'<27>cran. // Affiche le pixmap � l'�cran.
// Retourne false en cas d'erreur. // Retourne false en cas d'erreur.
bool CPixmap::Display() bool CPixmap::Display()

View File

@ -70,7 +70,7 @@ protected:
char m_filename[MAXIMAGE][20]; char m_filename[MAXIMAGE][20];
POINT m_totalDim[MAXIMAGE]; // dimensions totale image POINT m_totalDim[MAXIMAGE]; // dimensions totale image
POINT m_iconDim[MAXIMAGE]; // dimensions d'une ic<EFBFBD>ne POINT m_iconDim[MAXIMAGE]; // dimensions d'une ic�ne
}; };
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View File

@ -84,7 +84,7 @@ bool CSound::Create()
} }
// Retourne l'<EFBFBD>tat de DirectSound. // Retourne l'�tat de DirectSound.
bool CSound::GetEnable() bool CSound::GetEnable()
{ {
@ -92,7 +92,7 @@ bool CSound::GetEnable()
} }
// Enclenche ou d<EFBFBD>clenche le son. // Enclenche ou d�clenche le son.
void CSound::SetState(bool bState) void CSound::SetState(bool bState)
{ {
@ -163,7 +163,7 @@ bool CSound::Cache(int channel, const char *pFilename)
return true; return true;
} }
// D<EFBFBD>charge un son. // D�charge un son.
void CSound::Flush(int channel) void CSound::Flush(int channel)
{ {
@ -206,7 +206,7 @@ bool CSound::Play(int channel, int volume, Uint8 panLeft, Uint8 panRight)
// Fait entendre un son dans une image. // Fait entendre un son dans une image.
// Si rank != -1, il indique le rang du blupi dont il faudra // Si rank != -1, il indique le rang du blupi dont il faudra
// <EFBFBD>ventuellement stopper le dernier son en cours ! // �ventuellement stopper le dernier son en cours !
bool CSound::PlayImage(int channel, POINT pos, int rank) bool CSound::PlayImage(int channel, POINT pos, int rank)
{ {
@ -347,7 +347,7 @@ bool CSound::IsStoppedOnDemand ()
return m_bStopped; return m_bStopped;
} }
// Adapte le volume de la musique en cours, si n<EFBFBD>cessaire. // Adapte le volume de la musique en cours, si n�cessaire.
void CSound::AdaptVolumeMusic() void CSound::AdaptVolumeMusic()
{ {
@ -358,7 +358,7 @@ void CSound::AdaptVolumeMusic()
} }
} }
// Indique le nombre de suspend <EFBFBD> sauter. // Indique le nombre de suspend � sauter.
void CSound::SetSuspendSkip(int nb) void CSound::SetSuspendSkip(int nb)
{ {

View File

@ -10,7 +10,7 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Retourne l'offset pour un caractère donné. // Retourne l'offset pour un caractère donné.
int GetOffset(char c) int GetOffset(char c)
{ {
@ -29,12 +29,12 @@ int GetOffset(char c)
return 15+i; return 15+i;
} }
} }
if ( c<0 || c>128 ) return 1; // carré if ( c<0 || c>128 ) return 1; // carré
return c; return c;
} }
// Retourne la longueur d'un caractère. // Retourne la longueur d'un caractère.
int GetCharWidth(char c, int font) int GetCharWidth(char c, int font)
{ {
@ -101,7 +101,7 @@ void DrawText(CPixmap *pPixmap, POINT pos, const char *pText, int font)
} }
} }
// Affiche un texte penché. // Affiche un texte penché.
void DrawTextPente(CPixmap *pPixmap, POINT pos, char *pText, void DrawTextPente(CPixmap *pPixmap, POINT pos, char *pText,
int pente, int font) int pente, int font)
@ -123,8 +123,8 @@ void DrawTextPente(CPixmap *pPixmap, POINT pos, char *pText,
} }
} }
// Affiche un pavé de texte. // Affiche un pavé de texte.
// Une ligne vide est affichée avec un demi interligne ! // Une ligne vide est affichée avec un demi interligne !
// Si part != -1, n'affiche que les lignes qui commencent // Si part != -1, n'affiche que les lignes qui commencent
// par "n|", avec n=part. // par "n|", avec n=part.
@ -175,13 +175,13 @@ void DrawTextRect(CPixmap *pPixmap, POINT pos, char *pText,
} }
else else
{ {
pos.y += itl; // passe à la ligne suivante pos.y += itl; // passe à la ligne suivante
} }
} }
} }
// Affiche un texte centré pouvant éventuellement // Affiche un texte centré pouvant éventuellement
// contenir plusieurs lignes séparées par des '\n'. // contenir plusieurs lignes séparées par des '\n'.
void DrawTextCenter(CPixmap *pPixmap, POINT pos, const char *pText, int font) void DrawTextCenter(CPixmap *pPixmap, POINT pos, const char *pText, int font)
{ {
@ -215,7 +215,7 @@ void DrawTextCenter(CPixmap *pPixmap, POINT pos, const char *pText, int font)
} }
else else
{ {
pos.y += itl; // passe à la ligne suivante pos.y += itl; // passe à la ligne suivante
} }
} }
} }
@ -260,7 +260,7 @@ int GetTextHeight(char *pText, int font, int part)
} }
else else
{ {
h += itl; // passe à la ligne suivante h += itl; // passe à la ligne suivante
} }
} }