1 /* $Id: basic.h,v 1.39 2010-12-11 20:55:37 steffen Exp $ */ 2 /* basic types which we need everywhere */ 3 4 #ifndef _BC_BASIC_H_ 5 6 #define _BC_BASIC_H_ 7 8 #define GAME_SPECIAL_ITEMBOMB 20 9 #define GAME_SPECIAL_ITEMFIRE 20 10 #define GAME_SPECIAL_ITEMSHOE 20 11 #define GAME_SPECIAL_ITEMDEATH 40 12 #define GAME_SPECIAL_ITEMMIXED 20 13 #define GAME_SPECIAL_ITEMSTRIGGER 3 14 #define GAME_SPECIAL_ITEMSROW 3 15 #define GAME_SPECIAL_ITEMSPUSH 3 16 #define GAME_SPECIAL_ITEMSKICK 3 17 #define GAME_MAX_TUNNELS 4 // number of tunnel entrys 18 #define GAME_TIMEOUT 600.0 // game timeout 10min) 19 #define GAME_OVERTIMEOUT 5.0 // second of remaining the last player 20 #define GAME_TUNNEL_TO 0.5 // wait 0.5 seconds 21 #define HURRYWARN_TO_BLINKING 0.10 22 23 #define EXPLOSION_SAVE_DISTANCE 0.25 24 #define EXPLOSION_GROW_SPEED 0.75f 25 #define SPECIAL_TRIGGER_TIMEOUT 15 26 #define SPECIAL_TRIGGER_NUMUSE 5 // 0=unlimited 27 #define SPECIAL_TRIGGER_TIME 25 28 #define SPECIAL_ROW_TIME 30 29 #define SPECIAL_PUSH_TIME 50 30 #define SPECIAL_KICK_TIME 30 31 #define SPECIAL_KICK_MAXDIST 8 // maximum distance allowed 32 33 #define START_BOMBS 1 34 #define START_RANGE 2 35 #define START_SPEED 0.07 36 #define SPEEDMUL 1.2 37 38 #define MAX_PLAYERS 16 39 #define MAX_TEAMS 4 40 #define MAX_BOMBS 12 41 #define MAX_RANGE 10 42 #define MAX_SPEED 0.4 43 #define MAX_STONESTODRAW 2048 44 #define MAX_SERVERENTRYS 8 /* number of entrys in the server tab */ 45 #define MAX_GAMESRVENTRYS 255 /* number of entry which can be get */ 46 #define MAX_FIELDSIZE_X 51 47 #define MAX_FIELDSIZE_Y 31 48 #define MIN_FIELDSIZE_X 15 49 #define MIN_FIELDSIZE_Y 9 50 #define MAX_FIELDANIMATION 2048 /* number of points on the field to be animated exploding 51 stoned or powerups */ 52 53 #define EXPLOSIONTIMEOUT 0.5 54 #define ANI_FIRETIMEOUT 2 55 #define ANI_BOMBTIMEOUT 1 56 #define ANI_PLAYERTIMEOUT 0.66 57 #define ANI_PLAYERILLTIMEOUT 1.0 58 59 #define BOMB_TIMEOUT 4.0 60 #define ILL_TIMEOUT 20 61 #define ILL_SLOWSPEED 0.03 62 #define ILL_FASTSPEED 0.5 63 64 #define LEN_PLAYERNAME 16 65 #define LEN_SERVERNAME 41 66 #define LEN_PORT 6 67 #define LEN_GAMENAME 32 68 #define LEN_PATHFILENAME 512 69 #define LEN_FILENAME 64 70 #define LEN_TILESETNAME 32 71 #define LEN_CHARENTRY 256 72 #define LEN_PASSWORD 16 73 #define LEN_VERSION 20 74 75 #define DEFAULT_UDPPORT 11000 76 #define DEFAULT_GAMECACHEPORT "11111" 77 #define DEFAULT_GAMECACHE "ogc.gulpe.de:11111" 78 #define GAMESRV_TIMEOUT 2000 /* Timeout of the GameSrv_GetEntry */ 79 80 #define UDP_TIMEOUT 15000 81 #define BUF_SIZE 1024 82 83 #define AUTOSTART 20 /* server autostart */ 84 85 #define MW_IS_GFX_SELECT(__gfx_nr,__result) for (__result = (MAX_PLAYERS-1); (__result >= 0) && (players[__result].gfx_nr != __gfx_nr); __result--); 86 87 #define CUTINT(__x) (__x-floorf(__x)) // cut the integer part off 88 #define postofield(__x) ((int)(rintf(__x))) // position to int with rounding 89 90 #define UINT16_HALF 32767 91 92 #include <SDL.h> 93 94 enum _backgound { // to load some diffrent logos.. 95 BG_start = 0, 96 BG_net, 97 BG_conf 98 }; 99 100 101 enum _gametype { 102 GT_bomberman = 0, 103 GT_deathmatch, 104 GT_team 105 }; 106 107 108 enum _gamestate { 109 GS_startup = 0, 110 GS_quit, 111 GS_wait, // waiting for players to join 112 GS_update, 113 GS_ready, 114 GS_running 115 }; 116 117 118 enum _maptype { 119 MAPT_random = -1, // random map 120 MAPT_normal = 0, // a normal map 121 MAPT_tunnel, // a map with tunnels 122 123 MAPT_max 124 }; 125 126 127 enum _fieldtype { 128 FT_nothing = 0, // Nothing in here 129 FT_stone, // Stones you can bomb away 130 FT_block, // Stones which can't bomb away 131 FT_tunnel, // the tunnel item 132 FT_death, // The bad Powerup 133 FT_fire, // The fire Powerup 134 FT_bomb, // The bomb Powerup 135 FT_shoe, // The shoe Powerup 136 FT_mixed, // The mixed Powerup 137 FT_sp_trigger, // The Triggered bomb Special 138 FT_sp_row, // The bomb-row special 139 FT_sp_push, // The push-boms special 140 FT_sp_moved, // The moved-boms special 141 FT_sp_liquid, // The liquid-bomb special 142 FT_sp_kick, // The kick-bomb special 143 FT_max // just to know how many types there are 144 }; 145 146 147 extern const char *ft_filenames[]; // declared in tileset.c 148 149 enum _poweruptypes { 150 PWUP_good = 0, 151 PWUP_bad, 152 PWUP_special, 153 PWUP_max 154 }; 155 156 157 enum _direction { // to handle directions better 158 left = 0, 159 right, 160 up, 161 down 162 }; 163 164 enum _mapselection { 165 MAPS_select = 0, 166 MAPS_randmap, 167 MAPS_randgen, 168 MAPS_morerand 169 }; 170 171 enum _mstatus { 172 MS_normal = 0, 173 MS_hurrywarn, 174 MS_hurry, // mapsize will go down 175 MS_dropitems, // alot of items will be droppen randomly into the game 176 177 MS_max 178 }; 179 180 enum _help_page { 181 HP_howto0 = 0, 182 HP_powerup0, 183 HP_powerup1, 184 HP_powerup2, 185 HP_keyboard0, 186 HP_credit0, 187 HP_credit1, 188 HP_max 189 }; 190 191 192 struct { 193 Sint16 x; 194 Sint16 y; 195 } __attribute__((packed)) typedef _point; 196 197 198 struct { 199 float x; 200 float y; 201 } typedef _pointf; 202 203 204 struct __charlist { 205 char text[LEN_CHARENTRY]; 206 struct __charlist *next; 207 } typedef _charlist; 208 209 extern _point dir_change[]; 210 211 #endif 212