2017-01-21 17:27:46 +01:00
|
|
|
// Decor.h
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-02-09 18:28:00 +01:00
|
|
|
#include <unordered_map>
|
2017-02-11 21:43:47 +01:00
|
|
|
#include "def.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include "pixmap.h"
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#define MAXENERGY 4000
|
|
|
|
#define MAXFIRE 400
|
|
|
|
|
|
|
|
#define ICON_HILI_STAT 112
|
|
|
|
#define ICON_HILI_SEL 113
|
|
|
|
#define ICON_HILI_ANY 114
|
|
|
|
#define ICON_HILI_OP 115
|
|
|
|
#define ICON_HILI_GO 117
|
|
|
|
#define ICON_HILI_BUILD 118
|
|
|
|
#define ICON_HILI_ERR 119
|
|
|
|
|
2017-02-12 00:44:46 +01:00
|
|
|
// Descripteur d'une cellule du décor.
|
2017-01-21 17:27:46 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 floorChannel;
|
|
|
|
Sint16 floorIcon;
|
|
|
|
Sint16 objectChannel;
|
|
|
|
Sint16 objectIcon;
|
|
|
|
Sint16 fog; // brouillard
|
|
|
|
Sint16 rankMove; // rang dans m_move
|
|
|
|
Sint16 workBlupi; // rang du blupi travaillant ici
|
|
|
|
Sint16 fire;
|
2017-01-21 17:27:46 +01:00
|
|
|
}
|
|
|
|
Cellule;
|
2017-02-12 00:44:46 +01:00
|
|
|
// Cette structure doit être la plus petite possible, car
|
2017-01-21 17:27:46 +01:00
|
|
|
// il en existe un tableau de 100x100 = 10'000 cellules !
|
|
|
|
|
2017-02-12 00:44:46 +01:00
|
|
|
// Descripteur d'un blupi animé.
|
2017-01-21 17:27:46 +01:00
|
|
|
#define MAXBLUPI 100
|
|
|
|
#define MAXUSED 50
|
|
|
|
#define MAXLIST 10
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 bExist; // true -> utilisé
|
|
|
|
Sint32 bHili; // true -> sélectionné
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 perso; // personnage, voir (*)
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 goalAction; // action (Sint32 terme)
|
|
|
|
Sint16 goalPhase; // phase (Sint32 terme)
|
|
|
|
POINT goalCel; // cellule visée (Sint32 terme)
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT passCel; // cellule tranversante
|
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 energy; // énergie restante
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
POINT cel; // cellule actuelle
|
|
|
|
POINT destCel; // cellule destination
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 action; // action en cours
|
|
|
|
Sint16 aDirect; // direction actuelle
|
|
|
|
Sint16 sDirect; // direction souhaitée
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:44:46 +01:00
|
|
|
POINT pos; // position relative à partir de la cellule
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 posZ; // déplacement z
|
|
|
|
Sint16 channel;
|
|
|
|
Sint16 lastIcon;
|
|
|
|
Sint16 icon;
|
|
|
|
Sint16 phase; // phase dans l'action
|
|
|
|
Sint16 step; // pas global
|
|
|
|
Sint16 interrupt; // 0=prioritaire, 1=normal, 2=misc
|
|
|
|
Sint16 clipLeft;
|
|
|
|
|
|
|
|
Sint32 nbUsed; // nb de points déjà visités
|
2017-01-21 17:27:46 +01:00
|
|
|
char nextRankUsed;
|
|
|
|
POINT posUsed[MAXUSED];
|
|
|
|
char rankUsed[MAXUSED];
|
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 takeChannel; // objet transporté
|
|
|
|
Sint16 takeIcon;
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
POINT fix; // point fixe (cultive, pont)
|
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 jaugePhase;
|
|
|
|
Sint16 jaugeMax;
|
|
|
|
Sint16 stop; // 1 -> devra stopper
|
|
|
|
Sint16 bArrow; // true -> flèche en dessus de blupi
|
|
|
|
Sint16 bRepeat; // true -> répète l'action
|
|
|
|
Sint16 nLoop; // nb de boucles pour GOAL_OTHERLOOP
|
|
|
|
Sint16 cLoop; // boucle en cours
|
|
|
|
Sint16 vIcon; // icône variable
|
2017-02-12 00:44:46 +01:00
|
|
|
POINT goalHili; // but visé
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 bMalade; // true -> blupi malade
|
|
|
|
Sint16 bCache; // true -> caché (pas dessiné)
|
|
|
|
Sint16 vehicule; // véhicule utilisé par blupi, voir (**)
|
2017-01-21 17:27:46 +01:00
|
|
|
char busyCount;
|
|
|
|
char busyDelay;
|
|
|
|
char clicCount;
|
|
|
|
char clicDelay;
|
|
|
|
char reserve2[2];
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 listButton[MAXLIST];
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT listCel[MAXLIST];
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 listParam[MAXLIST];
|
|
|
|
Sint16 repeatLevelHope;
|
|
|
|
Sint16 repeatLevel;
|
|
|
|
Sint16 reserve3[88];
|
2017-01-21 17:27:46 +01:00
|
|
|
}
|
|
|
|
Blupi;
|
|
|
|
|
|
|
|
// (*) Personnages :
|
|
|
|
// 0 -> blupi
|
2017-02-12 00:44:46 +01:00
|
|
|
// 1 -> araignée
|
2017-01-21 17:27:46 +01:00
|
|
|
// 2 -> virus
|
|
|
|
// 3 -> tracks
|
|
|
|
// 4 -> robot
|
|
|
|
// 5 -> bombe
|
2017-02-12 00:44:46 +01:00
|
|
|
// 6 -> détonnateur de mine (invisible)
|
|
|
|
// 7 -> électro
|
2017-01-21 17:27:46 +01:00
|
|
|
// 8 -> disciple (robot2)
|
|
|
|
|
2017-02-12 00:44:46 +01:00
|
|
|
// (**) Véhicule :
|
|
|
|
// 0 -> à pied
|
2017-01-21 17:27:46 +01:00
|
|
|
// 1 -> en bateau
|
|
|
|
// 2 -> en jeep
|
|
|
|
// 3 -> armure
|
|
|
|
|
|
|
|
|
2017-02-12 00:44:46 +01:00
|
|
|
// Descripteur d'un décor animé.
|
2017-01-21 17:27:46 +01:00
|
|
|
#define MAXMOVE 100
|
|
|
|
#define MOVEICONNB 1000
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 bExist; // true -> utilisé
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:44:46 +01:00
|
|
|
POINT cel; // cellule du décor
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 rankBlupi; // blupi travaillant ici
|
|
|
|
|
|
|
|
Sint32 bFloor; // true -> floor, false -> object
|
|
|
|
Sint16 channel;
|
|
|
|
Sint16 icon;
|
|
|
|
Sint16 maskChannel;
|
|
|
|
Sint16 maskIcon;
|
|
|
|
Sint16 phase; // phase pour pMoves ou pIcon
|
|
|
|
Sint16 rankMoves; // *nb,dx,dy,...
|
|
|
|
Sint16 rankIcons; // *nb,i,i,...
|
|
|
|
|
|
|
|
Sint16 total; // nb total d'étapes
|
|
|
|
Sint16 delai; // délai entre deux pas
|
|
|
|
Sint16 stepY; // pas vertical *100
|
|
|
|
|
|
|
|
Sint16 cTotal;
|
|
|
|
Sint16 cDelai;
|
2017-01-21 17:27:46 +01:00
|
|
|
}
|
|
|
|
Move;
|
|
|
|
|
|
|
|
|
|
|
|
#define MAXLASTDRAPEAU 50
|
|
|
|
|
|
|
|
class CDecor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CDecor();
|
|
|
|
~CDecor();
|
|
|
|
|
|
|
|
// Arrange.cpp
|
|
|
|
void ArrangeFloor(POINT cel);
|
2017-02-12 00:51:38 +01:00
|
|
|
void ArrangeMur(POINT cel, Sint32 &icon, Sint32 index);
|
|
|
|
void ArrangeBuild(POINT cel, Sint32 &channel, Sint32 &icon);
|
2017-01-21 17:27:46 +01:00
|
|
|
void ArrangeObject(POINT cel);
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
bool ArrangeFillTestFloor(POINT cel1, POINT cel2);
|
|
|
|
bool ArrangeFillTest(POINT pos);
|
2017-02-12 00:51:38 +01:00
|
|
|
void ArrangeFillPut(POINT pos, Sint32 channel, Sint32 icon);
|
2017-01-21 17:27:46 +01:00
|
|
|
void ArrangeFillSearch(POINT pos);
|
2017-02-12 00:51:38 +01:00
|
|
|
void ArrangeFill(POINT pos, Sint32 channel, Sint32 icon, bool bFloor);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
void ArrangeBlupi();
|
|
|
|
|
|
|
|
// Obstacle.cpp
|
2017-02-12 00:51:38 +01:00
|
|
|
void SearchFloor(Sint32 rank, Sint32 icon, POINT cel, Sint32 *pBits);
|
|
|
|
void SearchObject(Sint32 rank, Sint32 icon, POINT cel, Sint32 *pBits);
|
|
|
|
void AjustFloor(Sint32 rank, Sint32 icon, POINT cel, Sint32 *pBits);
|
|
|
|
void AjustObject(Sint32 rank, Sint32 icon, POINT cel, Sint32 *pBits);
|
|
|
|
bool IsFreeDirect(POINT cel, Sint32 direct, Sint32 rank);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool IsFreeCelObstacle(POINT cel);
|
2017-02-12 00:51:38 +01:00
|
|
|
bool IsFreeCelFloor(POINT cel, Sint32 rank);
|
|
|
|
bool IsFreeCelGo(POINT cel, Sint32 rank);
|
|
|
|
bool IsFreeCelHili(POINT cel, Sint32 rank);
|
|
|
|
bool IsFreeCel(POINT cel, Sint32 rank);
|
|
|
|
bool IsFreeCelDepose(POINT cel, Sint32 rank);
|
|
|
|
bool IsFreeCelEmbarque(POINT cel, Sint32 rank, Sint32 &action, POINT &limit);
|
|
|
|
bool IsFreeCelDebarque(POINT cel, Sint32 rank, Sint32 &action, POINT &limit);
|
|
|
|
bool IsFreeJump(POINT cel, Sint32 direct, Sint32 rank, Sint32 &action);
|
|
|
|
bool IsFreeGlisse(POINT cel, Sint32 direct, Sint32 rank, Sint32 &action);
|
|
|
|
Sint32 DirectSearch(POINT cel, POINT goal);
|
|
|
|
void FlushUsed(Sint32 rank);
|
|
|
|
void AddUsedPos(Sint32 rank, POINT pos);
|
|
|
|
bool IsUsedPos(Sint32 rank, POINT pos);
|
|
|
|
bool SearchBestBase(Sint32 rank, Sint32 &action, POINT &newCel, Sint32 &direct);
|
|
|
|
bool SearchBestPass(Sint32 rank, Sint32 &action);
|
|
|
|
bool IsWorkableObject(POINT cel, Sint32 rank);
|
|
|
|
bool SearchOtherObject(Sint32 rank, POINT initCel, Sint32 action,
|
|
|
|
Sint32 distMax, Sint32 channel,
|
|
|
|
Sint32 firstIcon1, Sint32 lastIcon1,
|
|
|
|
Sint32 firstIcon2, Sint32 lastIcon2,
|
|
|
|
POINT &foundCel, Sint32 &foundIcon);
|
|
|
|
bool SearchOtherDrapeau(Sint32 rank, POINT initCel, Sint32 distMax,
|
|
|
|
POINT &foundCel, Sint32 &foundIcon);
|
|
|
|
bool SearchOtherBateau(Sint32 rank, POINT initCel, Sint32 distMax,
|
|
|
|
POINT &foundCel, Sint32 &foundIcon);
|
|
|
|
bool IsSpiderObject(Sint32 icon);
|
|
|
|
bool SearchSpiderObject(Sint32 rank, POINT initCel, Sint32 distMax,
|
|
|
|
POINT &foundCel, Sint32 &foundIcon);
|
|
|
|
bool IsTracksObject(Sint32 icon);
|
|
|
|
bool SearchTracksObject(Sint32 rank, POINT initCel, Sint32 distMax,
|
|
|
|
POINT &foundCel, Sint32 &foundIcon);
|
|
|
|
bool IsRobotObject(Sint32 icon);
|
|
|
|
bool SearchRobotObject(Sint32 rank, POINT initCel, Sint32 distMax,
|
|
|
|
POINT &foundCel, Sint32 &foundIcon,
|
|
|
|
Sint32 &foundAction);
|
|
|
|
bool IsBombeObject(Sint32 icon);
|
|
|
|
bool SearchBombeObject(Sint32 rank, POINT initCel, Sint32 distMax,
|
|
|
|
POINT &foundCel, Sint32 &foundIcon);
|
|
|
|
bool SearchElectroObject(Sint32 rank, POINT initCel, Sint32 distMax,
|
|
|
|
POINT &foundCel, Sint32 &foundIcon);
|
|
|
|
bool IsUsineBuild(Sint32 rank, POINT cel);
|
|
|
|
bool IsUsineFree(Sint32 rank, POINT cel);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool IsFireCel(POINT cel);
|
|
|
|
bool IsVirusCel(POINT cel);
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 IsBuildPont(POINT &cel, Sint32 &iconBuild);
|
|
|
|
bool IsBuildBateau(POINT cel, Sint32 &direct);
|
2017-01-21 17:27:46 +01:00
|
|
|
void InitDrapeau();
|
|
|
|
void AddDrapeau(POINT cel);
|
|
|
|
void SubDrapeau(POINT cel);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool TestDrapeau(POINT cel);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
// DecBlupi.cpp
|
|
|
|
void BlupiFlush();
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 BlupiCreate(POINT cel, Sint32 action, Sint32 direct,
|
|
|
|
Sint32 perso, Sint32 energy);
|
|
|
|
bool BlupiDelete(POINT cel, Sint32 perso=-1);
|
|
|
|
void BlupiDelete(Sint32 rank);
|
|
|
|
void BlupiKill(Sint32 exRank, POINT cel, Sint32 type);
|
|
|
|
bool BlupiIfExist(Sint32 rank);
|
|
|
|
void BlupiCheat(Sint32 cheat);
|
|
|
|
void BlupiActualise(Sint32 rank);
|
|
|
|
void BlupiAdaptIcon(Sint32 rank);
|
|
|
|
void BlupiPushFog(Sint32 rank);
|
|
|
|
void BlupiSound(Sint32 rank, Sint32 sound, POINT pos, bool bStop=false);
|
|
|
|
void BlupiInitAction(Sint32 rank, Sint32 action, Sint32 direct=-1);
|
|
|
|
void BlupiChangeAction(Sint32 rank, Sint32 action, Sint32 direct=-1);
|
|
|
|
void ListFlush(Sint32 rank);
|
|
|
|
Sint32 ListGetParam(Sint32 rank, Sint32 button, POINT cel);
|
|
|
|
bool ListPut(Sint32 rank, Sint32 button, POINT cel, POINT cMem);
|
|
|
|
void ListRemove(Sint32 rank);
|
|
|
|
Sint32 ListSearch(Sint32 rank, Sint32 button, POINT cel, const char *&textForButton);
|
|
|
|
bool RepeatAdjust(Sint32 rank, Sint32 button, POINT &cel, POINT &cMem,
|
|
|
|
Sint32 param, Sint32 list);
|
|
|
|
void GoalStart(Sint32 rank, Sint32 action, POINT cel);
|
|
|
|
bool GoalNextPhase(Sint32 rank);
|
|
|
|
void SetTotalTime(Sint32 total);
|
|
|
|
Sint32 GetTotalTime();
|
|
|
|
void GoalInitJauge(Sint32 rank);
|
|
|
|
void GoalInitPassCel(Sint32 rank);
|
|
|
|
void GoalAdjustCel(Sint32 rank, Sint32 &x, Sint32 &y);
|
|
|
|
bool GoalNextOp(Sint32 rank, Sint16 *pTable);
|
|
|
|
void GoalUnwork(Sint32 rank);
|
|
|
|
void GoalStop(Sint32 rank, bool bError=false, bool bSound=true);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool BlupiIsGoalUsed(POINT cel);
|
2017-02-12 00:51:38 +01:00
|
|
|
void BlupiStartStopRayon(Sint32 rank, POINT startCel, POINT endCel);
|
|
|
|
bool BlupiRotate(Sint32 rank);
|
|
|
|
bool BlupiNextAction(Sint32 rank);
|
|
|
|
void BlupiNextGoal(Sint32 rank);
|
2017-01-22 00:10:12 +01:00
|
|
|
void BlupiStep(bool bFirst);
|
2017-02-12 00:51:38 +01:00
|
|
|
void BlupiGetRect(Sint32 rank, RECT &rect);
|
|
|
|
Sint32 GetTargetBlupi(POINT pos);
|
2017-01-21 17:27:46 +01:00
|
|
|
void BlupiDeselect();
|
2017-02-12 00:51:38 +01:00
|
|
|
void BlupiDeselect(Sint32 rank);
|
|
|
|
void BlupiSetArrow(Sint32 rank, bool bArrow);
|
2017-01-21 17:27:46 +01:00
|
|
|
void InitOutlineRect();
|
2017-01-22 00:10:12 +01:00
|
|
|
void BlupiHiliDown(POINT pos, bool bAdd=false);
|
|
|
|
void BlupiHiliMove(POINT pos, bool bAdd=false);
|
|
|
|
void BlupiHiliUp(POINT pos, bool bAdd=false);
|
2017-01-21 17:27:46 +01:00
|
|
|
void BlupiDrawHili();
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 GetDefButton(POINT cel);
|
|
|
|
bool BlupiGoal(Sint32 rank, Sint32 button, POINT cel, POINT cMem);
|
|
|
|
void BlupiGoal(POINT cel, Sint32 button);
|
|
|
|
void BlupiDestCel(Sint32 rank);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool IsTracksHere(POINT cel, bool bSkipInMove);
|
2017-02-12 00:51:38 +01:00
|
|
|
bool IsBlupiHereEx(POINT cel1, POINT cel2, Sint32 exRank, bool bSkipInMove);
|
|
|
|
bool IsBlupiHereEx(POINT cel, Sint32 exRank, bool bSkipInMove);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool IsBlupiHere(POINT cel, bool bSkipInMove);
|
2017-02-12 00:51:38 +01:00
|
|
|
bool IsBlupiHere(POINT cel, Sint32 direct, bool bSkipInMove);
|
|
|
|
void GetLevelJauge(Sint32 *pLevels, Sint32 *pTypes);
|
|
|
|
bool IsWorkBlupi(Sint32 rank);
|
|
|
|
void BlupiGetButtons(POINT pos, Sint32 &nb, Sint32 *pButtons, Sint32 *pErrors,
|
|
|
|
std::unordered_map<Sint32, const char *> &texts, Sint32 &perso);
|
2017-01-21 17:27:46 +01:00
|
|
|
void TerminatedInit();
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 IsTerminated();
|
2017-01-21 17:27:46 +01:00
|
|
|
Term* GetTerminated();
|
|
|
|
|
|
|
|
// DecMove.cpp
|
|
|
|
void MoveFlush();
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 MoveMaxFire();
|
2017-01-21 17:27:46 +01:00
|
|
|
void MoveFixInit();
|
2017-02-12 00:51:38 +01:00
|
|
|
bool MoveCreate(POINT cel, Sint32 rankBlupi, bool bFloor,
|
|
|
|
Sint32 channel, Sint32 icon,
|
|
|
|
Sint32 maskChannel, Sint32 maskIcon,
|
|
|
|
Sint32 total, Sint32 delai, Sint32 stepY,
|
2017-01-22 00:10:12 +01:00
|
|
|
bool bMisc=false, bool bNotIfExist=false);
|
2017-02-12 00:51:38 +01:00
|
|
|
bool MoveAddMoves(POINT cel, Sint32 rankMoves);
|
|
|
|
bool MoveAddIcons(POINT cel, Sint32 rankIcons, bool bContinue=false);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool MoveStartFire(POINT cel);
|
2017-01-21 17:27:46 +01:00
|
|
|
void MoveProxiFire(POINT cel);
|
2017-02-12 00:51:38 +01:00
|
|
|
void MoveFire(Sint32 rank);
|
2017-01-22 00:10:12 +01:00
|
|
|
void MoveStep(bool bFirst);
|
2017-01-21 17:27:46 +01:00
|
|
|
void MoveFinish(POINT cel);
|
2017-02-12 00:51:38 +01:00
|
|
|
void MoveFinish(Sint32 rankBlupi);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool MoveIsUsed(POINT cel);
|
2017-02-12 00:51:38 +01:00
|
|
|
bool MoveGetObject(POINT cel, Sint32 &channel, Sint32 &icon);
|
|
|
|
bool MovePutObject(POINT cel, Sint32 channel, Sint32 icon);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
// DecIO.cpp
|
2017-02-12 00:51:38 +01:00
|
|
|
bool Write(Sint32 rank, bool bUser, Sint32 world, Sint32 time, Sint32 total);
|
|
|
|
bool Read(Sint32 rank, bool bUser, Sint32 &world, Sint32 &time, Sint32 &total);
|
|
|
|
bool FileExist(Sint32 rank, bool bUser, Sint32 &world, Sint32 &time, Sint32 &total);
|
2017-01-21 17:27:46 +01:00
|
|
|
void Flush();
|
|
|
|
|
|
|
|
// DecMap.cpp
|
|
|
|
void MapInitColors();
|
|
|
|
POINT ConvCelToMap(POINT cel);
|
|
|
|
POINT ConvMapToCel(POINT pos);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool MapMove(POINT pos);
|
2017-01-21 17:27:46 +01:00
|
|
|
void MapPutCel(POINT pos);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool GenerateMap();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
// DecStat.cpp
|
|
|
|
void StatisticInit();
|
|
|
|
void StatisticUpdate();
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 StatisticGetBlupi();
|
|
|
|
Sint32 StatisticGetFire();
|
2017-01-21 17:27:46 +01:00
|
|
|
void StatisticDraw();
|
|
|
|
void GenerateStatictic();
|
2017-01-28 23:34:02 +01:00
|
|
|
bool StatisticDown(POINT pos);
|
|
|
|
bool StatisticMove(POINT pos);
|
|
|
|
bool StatisticUp(POINT pos);
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 StatisticDetect(POINT pos);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
// Chemin.cpp
|
2017-02-12 00:51:38 +01:00
|
|
|
void CheminMemPos(Sint32 exRank);
|
|
|
|
bool CheminTestPos(POINT pos, Sint32 &rank);
|
|
|
|
Sint32 CheminARebours(Sint32 rank);
|
|
|
|
void CheminFillTerrain(Sint32 rank);
|
|
|
|
bool CheminTestDirection(Sint32 rank, Sint32 pos, Sint32 dir,
|
|
|
|
Sint32 &next, Sint32 &li,
|
|
|
|
Sint32 &cout, Sint32 &action);
|
|
|
|
bool CheminCherche(Sint32 rank, Sint32 &action);
|
|
|
|
bool IsCheminFree(Sint32 rank, POINT dest, Sint32 button);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
// Decor.cpp
|
|
|
|
void SetShiftOffset(POINT offset);
|
|
|
|
POINT ConvCelToPos(POINT cel);
|
2017-01-22 00:10:12 +01:00
|
|
|
POINT ConvPosToCel(POINT pos, bool bMap=false);
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT ConvPosToCel2(POINT pos);
|
|
|
|
|
2017-02-05 09:15:08 +01:00
|
|
|
void Create(CSound *pSound, CPixmap *pPixmap);
|
2017-02-12 00:51:38 +01:00
|
|
|
void Init(Sint32 channel, Sint32 icon);
|
2017-01-21 17:27:46 +01:00
|
|
|
void InitAfterBuild();
|
|
|
|
void ResetHili();
|
2017-01-22 00:10:12 +01:00
|
|
|
bool LoadImages();
|
2017-01-21 17:27:46 +01:00
|
|
|
void ClearFog();
|
|
|
|
void ClearFire();
|
2017-01-22 00:10:12 +01:00
|
|
|
void SetBuild(bool bBuild);
|
|
|
|
void EnableFog(bool bEnable);
|
|
|
|
bool GetInvincible();
|
|
|
|
void SetInvincible(bool bInvincible);
|
|
|
|
bool GetSuper();
|
|
|
|
void SetSuper(bool bSuper);
|
2017-01-21 17:27:46 +01:00
|
|
|
void FlipOutline();
|
2017-02-12 00:51:38 +01:00
|
|
|
bool PutFloor(POINT cel, Sint32 channel, Sint32 icon);
|
|
|
|
bool PutObject(POINT cel, Sint32 channel, Sint32 icon);
|
|
|
|
bool GetFloor(POINT cel, Sint32 &channel, Sint32 &icon);
|
|
|
|
bool GetObject(POINT cel, Sint32 &channel, Sint32 &icon);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool SetFire(POINT cel, bool bFire);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
void SetCoin(POINT coin, bool bCenter=false);
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT GetCoin();
|
|
|
|
POINT GetHome();
|
2017-02-12 00:51:38 +01:00
|
|
|
void MemoPos(Sint32 rank, bool bRecord);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
void SetTime(Sint32 time);
|
|
|
|
Sint32 GetTime();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
void SetMusic(Sint32 music);
|
|
|
|
Sint32 GetMusic();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
void SetSkill(Sint32 skill);
|
|
|
|
Sint32 GetSkill();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
void SetRegion(Sint32 region);
|
|
|
|
Sint32 GetRegion();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
void SetInfoMode(bool bInfo);
|
|
|
|
bool GetInfoMode();
|
2017-02-12 00:51:38 +01:00
|
|
|
void SetInfoHeight(Sint32 height);
|
|
|
|
Sint32 GetInfoHeight();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
char* GetButtonExist();
|
|
|
|
|
|
|
|
void BuildPutBlupi();
|
2017-02-12 00:51:38 +01:00
|
|
|
void BuildMoveFloor(Sint32 x, Sint32 y, POINT pos, Sint32 rank);
|
|
|
|
void BuildMoveObject(Sint32 x, Sint32 y, POINT pos, Sint32 rank);
|
2017-01-21 17:27:46 +01:00
|
|
|
void BuildGround(RECT clip);
|
|
|
|
void Build(RECT clip, POINT posMouse);
|
2017-02-12 00:51:38 +01:00
|
|
|
void NextPhase(Sint32 mode);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 CountFloor(Sint32 channel, Sint32 icon);
|
|
|
|
Sint32 CelOkForAction(POINT cel, Sint32 action, Sint32 rank,
|
|
|
|
Sint32 icons[4][4],
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT &celOutline1,
|
|
|
|
POINT &celOutline2);
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 CelOkForAction(POINT cel, Sint32 action, Sint32 rank);
|
|
|
|
Sint32 GetHiliRankBlupi(Sint32 nb);
|
|
|
|
void CelHili(POINT pos, Sint32 action);
|
|
|
|
void CelHiliButton(POINT cel, Sint32 button);
|
|
|
|
void CelHiliRepeat(Sint32 list);
|
2017-02-07 19:42:34 +01:00
|
|
|
const char *GetResHili(POINT posMouse);
|
2017-01-22 00:10:12 +01:00
|
|
|
void HideTooltips(bool bHide);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
void UndoOpen();
|
|
|
|
void UndoClose();
|
|
|
|
void UndoCopy();
|
|
|
|
void UndoBack();
|
2017-01-22 00:10:12 +01:00
|
|
|
bool IsUndo();
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
protected:
|
2017-02-12 00:51:38 +01:00
|
|
|
bool GetSeeBits(POINT cel, char *pBits, Sint32 index);
|
|
|
|
Sint32 GetSeeIcon(char *pBits, Sint32 index);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
CSound* m_pSound;
|
|
|
|
CPixmap* m_pPixmap;
|
|
|
|
Cellule* m_pUndoDecor;
|
|
|
|
Cellule m_decor[MAXCELX/2][MAXCELY/2];
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint16 m_rankBlupi[MAXCELX][MAXCELY];
|
2017-01-21 17:27:46 +01:00
|
|
|
Blupi m_blupi[MAXBLUPI];
|
|
|
|
Move m_move[MAXMOVE];
|
|
|
|
POINT m_celCoin; // cellule sup/gauche
|
|
|
|
POINT m_celHome; // pour touche Home
|
|
|
|
POINT m_celHili;
|
|
|
|
POINT m_celOutline1;
|
|
|
|
POINT m_celOutline2;
|
|
|
|
POINT m_shiftOffset;
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_iconHili[4][4];
|
|
|
|
Sint32 m_rankHili; // rang du blupi visé
|
2017-01-22 00:10:12 +01:00
|
|
|
bool m_bHiliRect;
|
2017-02-12 00:44:46 +01:00
|
|
|
POINT m_p1Hili; // coins rectangle de sélection
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT m_p2Hili;
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_shiftHili;
|
|
|
|
Sint32 m_nbBlupiHili; // nb de blupi sélectionnés
|
|
|
|
Sint32 m_rankBlupiHili; // rang blupi sélectionné
|
2017-01-22 00:10:12 +01:00
|
|
|
bool m_bFog; // true -> brouillard (jeu)
|
|
|
|
bool m_bBuild; // true -> construction
|
|
|
|
bool m_bInvincible; // true -> cheat code
|
|
|
|
bool m_bSuper; // true -> cheat code
|
2017-01-29 19:18:18 +01:00
|
|
|
Uint32 m_colors[100];
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_time; // temps relatif global
|
|
|
|
Sint32 m_timeConst; // temps relatif global constant
|
|
|
|
Sint32 m_timeFlipOutline; // temps quand basculer mode outline
|
|
|
|
Sint32 m_totalTime; // temps total passé sur une partie
|
|
|
|
Sint32 m_phase; // phase pour la carte
|
2017-02-12 00:44:46 +01:00
|
|
|
POINT m_celArrow; // cellule avec flèche
|
2017-01-22 00:10:12 +01:00
|
|
|
bool m_bOutline;
|
|
|
|
bool m_bGroundRedraw;
|
2017-01-21 17:27:46 +01:00
|
|
|
char m_buttonExist[MAXBUTTON];
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_statNb; // nb de statistiques
|
|
|
|
Sint32 m_statFirst; // première statistique visible
|
|
|
|
Sint32 m_bStatUp; // flèche up statistique
|
|
|
|
Sint32 m_bStatDown; // flèche down statistique
|
|
|
|
Sint32 m_statHili; // statistique survolée
|
2017-01-22 00:10:12 +01:00
|
|
|
bool m_bStatRecalc; // true -> recalcule les statistiques
|
|
|
|
bool m_bStatRedraw; // true -> redessine les statistiques
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_nbStatHach; // nb de hachures
|
|
|
|
Sint32 m_nbStatHachBlupi; // hachures occupées par blupi
|
|
|
|
Sint32 m_nbStatHachPlanche;// hachures occupées par planches
|
|
|
|
Sint32 m_nbStatHachTomate; // hachures occupées par tomates
|
|
|
|
Sint32 m_nbStatHachMetal; // hachures occupées par métal
|
|
|
|
Sint32 m_nbStatHachRobot; // hachures occupées par robot
|
|
|
|
Sint32 m_nbStatHome; // nb de maisons
|
|
|
|
Sint32 m_nbStatHomeBlupi; // maisons occupées par blupi
|
|
|
|
Sint32 m_nbStatRobots; // nb d'ennemis
|
2017-01-21 17:27:46 +01:00
|
|
|
Term m_term; // conditions pour gagner
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_winCount; // compteur avant gagné
|
|
|
|
Sint32 m_winLastHachBlupi; // dernier nombre atteint
|
|
|
|
Sint32 m_winLastHachPlanche;// dernier nombre atteint
|
|
|
|
Sint32 m_winLastHachTomate;// dernier nombre atteint
|
|
|
|
Sint32 m_winLastHachMetal; // dernier nombre atteint
|
|
|
|
Sint32 m_winLastHachRobot; // dernier nombre atteint
|
|
|
|
Sint32 m_winLastHome; // dernier nombre atteint
|
|
|
|
Sint32 m_winLastHomeBlupi; // dernier nombre atteint
|
|
|
|
Sint32 m_winLastRobots; // dernier nombre atteint
|
|
|
|
Sint32 m_music; // numéro musique
|
|
|
|
Sint32 m_region; // numéro région (*)
|
|
|
|
Sint32 m_lastRegion; // numéro dernière région
|
|
|
|
Sint32 m_blupiHere;
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT m_lastDrapeau[MAXLASTDRAPEAU];
|
2017-02-12 00:44:46 +01:00
|
|
|
bool m_bHideTooltips; // true -> menu présent
|
2017-01-21 17:27:46 +01:00
|
|
|
char m_text[50];
|
|
|
|
POINT m_textLastPos;
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_textCount;
|
|
|
|
Sint32 m_skill;
|
2017-01-22 00:10:12 +01:00
|
|
|
bool m_bInfo;
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_infoHeight;
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT m_memoPos[4];
|
|
|
|
|
2017-02-10 00:14:28 +01:00
|
|
|
Uint8 m_cheminWork[MAXCELX*MAXCELY];
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_cheminNbPos;
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT m_cheminPos[MAXBLUPI*2];
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_cheminRank[MAXBLUPI*2];
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
bool m_bFillFloor;
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_fillSearchChannel;
|
|
|
|
Sint32 m_fillSearchIcon;
|
|
|
|
Sint32 m_fillPutChannel;
|
|
|
|
Sint32 m_fillPutIcon;
|
2017-01-21 17:27:46 +01:00
|
|
|
char* m_pFillMap;
|
|
|
|
};
|
|
|
|
|
2017-02-12 00:44:46 +01:00
|
|
|
// (*) Régions :
|
2017-01-21 17:27:46 +01:00
|
|
|
// 0 -> normal
|
|
|
|
// 1 -> palmier
|
|
|
|
// 2 -> hiver
|
|
|
|
// 3 -> sapin
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-02-12 00:51:38 +01:00
|
|
|
POINT GetCel (Sint32 x, Sint32 y);
|
|
|
|
POINT GetCel (POINT cel, Sint32 x, Sint32 y);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool IsValid (POINT cel);
|
2017-02-12 00:51:38 +01:00
|
|
|
POINT GetVector (Sint32 direct);
|
|
|
|
extern Sint32 table_multi_goal[];
|
|
|
|
extern Sint16 table_actions[];
|