]> git.mxchange.org Git - quix0rs-blobwars.git/blob - src/CMap.h
Don't link pak tool with SDL.
[quix0rs-blobwars.git] / src / CMap.h
1 /*
2 Copyright (C) 2004-2011 Parallel Realities
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 class Map {
22
23         private:
24                 
25                 Entity *allowableEnemy[10];
26                 int maxAllowableEnemies;
27
28         public:
29
30                 char name[255];
31
32                 unsigned char data[MAPWIDTH][MAPHEIGHT];
33
34                 int offsetX, offsetY;
35                 int limitLeft, limitRight, limitUp, limitDown;
36
37                 int foundItems, totalItems;
38                 int foundMIAs, totalMIAs;
39                 int requiredMIAs;
40                 
41                 // time limit for extreme setting
42                 int remainingMinutes;
43                 int remainingSeconds;
44                 
45                 // special for ice levels
46                 bool isIceLevel;
47                 
48                 // special for flooded tunnel #4
49                 float waterLevel;
50                 int requiredWaterLevel;
51                 
52                 // special for arctic wastes
53                 bool isBlizzardLevel;
54                 int windChangeTime;
55                 float windPower;
56                 
57                 // air/water decoration
58                 bool isCavesTileset;
59                 bool isGrasslandsTileset;
60
61                 // Boss Stuff
62                 bool fightingGaldov;
63                 bool isBossMission;
64                 unsigned int bossNextThink;
65                 void (*doBossLevelAction) (void);
66                 Boss *boss[10];
67                 Boss *mainBossPart;
68                 float bossEnergyMeterBit;
69                 
70                 List persistantList;
71
72                 List trainList;
73                 List itemList;
74                 List bulletList;
75                 List enemyList;
76                 List miaList;
77                 List obstacleList;
78                 List particleList;
79                 List switchList;
80                 List spawnList;
81                 List effectList;
82                 List objectiveList;
83                 List teleportList;
84                 List lineList;
85                 List trapList;
86
87         Map();
88         
89         void clear();
90         void destroy();
91         
92         bool isPracticeMission();
93         bool isSolid(int x, int y);
94         bool isBreakable(int x, int y);
95         bool isNoReset(int x, int y);
96         bool isLiquid(int x, int y);
97         bool isTopLayer(int x, int y);
98         
99         Persistant *getPersistant(const char *name);
100         Persistant *createPersistant(const char *name);
101         void destroyPersistant(const char *name);
102         
103         void setName(const char *name);
104         void setClipping(int limitLeft, int limitRight, int limitUp, int limitDown);
105         void addTrain(const char *name, int startX, int startY, int endX, int endY, int pause, bool atStart, bool active);
106         void addDoor(const char *name, int type, int startX, int startY, int endX, int endY, bool active);
107         void addSwitch(const char *name, const char *linkName, const char *requiredObjectName, const char *activateMessage, int type, int x, int y, bool activated);
108         void addItem(Entity *item);
109         void addBullet(Entity *bullet);
110         void addParticle(float x, float y, float dx, float dy, int health, int color, Sprite *sprite, int flags);
111         void addEnemy(Entity *enemy);
112         void addMIA(Entity *mia);
113         void addObstacle(Entity *obstacle);
114         void addSpawnPoint(const char *name, int x, int y, int type, int subtype, int min, int max, bool active);
115         void addEffect(Effect *effect);
116         void addObjective(const char *description, const char *target, int targetValue, bool required);
117         void addTeleporter(Teleporter *teleporter);
118         void addLineDef(LineDef *lineDef);
119         void addTrap(Trap *trap);
120         void evalTileset(const char *baseDir);
121         
122         void killAllEnemies();
123         
124         void setAllowableEnemy(Entity *enemy);
125         char *getSpawnableEnemy();
126         char *getSpawnableEnemy(int i);
127         
128         void getRandomEntityPosition(int *x, int *y);
129         void setMainBossPart(Boss *boss);
130 };