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