You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
246 lines
6.0 KiB
246 lines
6.0 KiB
/* $Id: basic.h,v 1.4 2003/09/23 20:28:24 stpohle Exp $ */
|
|
/* basic types which we need everywhere */
|
|
|
|
#ifndef _BC_BASIC_H_
|
|
|
|
#define _BC_BASIC_H_
|
|
|
|
#define GAME_SPECIAL_ITEMBOMB 20
|
|
#define GAME_SPECIAL_ITEMFIRE 20
|
|
#define GAME_SPECIAL_ITEMSHOE 20
|
|
#define GAME_SPECIAL_ITEMDEATH 40
|
|
#define GAME_SPECIAL_ITEMMIXED 20
|
|
#define GAME_SPECIAL_ITEMSTRIGGER 3
|
|
#define GAME_SPECIAL_ITEMSROW 3
|
|
#define GAME_SPECIAL_ITEMSPUSH 2
|
|
#define GAME_MAX_TUNNELS 4 // number of tunnel entrys
|
|
#define GAME_TIMEOUT 30000 // game timeout 10min)
|
|
#define GAME_TIMEOUTHURRY 3000 // game timeout for hurry and dropping mode (1min)
|
|
#define GAME_TUNNEL_TO 50 /* wait 5 game cycls before move and show
|
|
player again */
|
|
|
|
#define EXPLOSION_SAVE_DISTANCE 64
|
|
#define SPECIAL_TRIGGER_TIMEOUT 15
|
|
#define SPECIAL_TRIGGER_NUMUSE 5 // 0=unlimited
|
|
#define SPECIAL_TRIGGER_TIME 25
|
|
#define SPECIAL_ROW_TIME 30
|
|
#define SPECIAL_PUSH_TIME 50
|
|
|
|
#define START_BOMBS 1
|
|
#define START_RANGE 2
|
|
#define START_SPEED 16
|
|
#define SPEEDMUL 1.2
|
|
|
|
#define MAX_PLAYERS 8
|
|
#define MAX_BOMBS 12
|
|
#define MAX_RANGE 10
|
|
#define MAX_SPEED 40
|
|
#define MAX_BLITRECTS 4096
|
|
#define MAX_STONESTODRAW 2048
|
|
#define MAX_SERVERENTRYS 8 /* number of entrys in the server tab */
|
|
#define MAX_GAMESRVENTRYS 255 /* number of entry which can be get */
|
|
#define MAX_FIELDSIZE_X 51
|
|
#define MAX_FIELDSIZE_Y 31
|
|
#define MIN_FIELDSIZE_X 15
|
|
#define MIN_FIELDSIZE_Y 9
|
|
#define MAX_FIELDANIMATION 2048 /* number of points on the field to be animated exploding
|
|
stoned or powerups*/
|
|
|
|
#define EXPLOSIONTIMEOUT 20
|
|
#define ANI_FIRETIMEOUT 2
|
|
#define ANI_BOMBTIMEOUT 1
|
|
#define ANI_PLAYERTIMEOUT 1
|
|
#define ANI_PLAYERILLTIMEOUT 1
|
|
#define ANI_STONETIMEOUT 5
|
|
|
|
#define TIME_FACTOR 50
|
|
#define BOMB_TIMEOUT 5
|
|
#define IL_TIMEOUT 20
|
|
|
|
#define LEN_PLAYERNAME 10
|
|
#define LEN_SERVERNAME 41
|
|
#define LEN_PORT 6
|
|
#define LEN_GAMENAME 32
|
|
#define LEN_PATHFILENAME 512
|
|
#define LEN_FILENAME 64
|
|
#define LEN_TILESETNAME 32
|
|
|
|
#define DEFAULT_UDPPORT 11000
|
|
#define DEFAULT_GMUDPPORT "11100"
|
|
#define DEFAULT_GAMEMASTER "x.yz.to:11100"
|
|
#define GAMESRV_TIMEOUT 2000 /* Timeout of the GameSrv_GetEntry */
|
|
|
|
#define UDP_TIMEOUT 15000
|
|
#define BUF_SIZE 1024
|
|
|
|
#define MENU_BG_SHADE_DARK -64
|
|
#define MENU_BG_SHADE_BRIGHT 64
|
|
|
|
#define MW_IS_GFX_SELECT(__gfx_nr,__result) for (__result = (MAX_PLAYERS-1); (bman.players[__result].gfx_nr != __gfx_nr) && (__result >= 0); __result--);
|
|
|
|
#include <SDL.h>
|
|
|
|
enum _networkflags {
|
|
NETF_firewall = 1
|
|
};
|
|
|
|
|
|
enum _backgound { // to load some diffrent logos..
|
|
BG_start = 0,
|
|
BG_net,
|
|
BG_conf
|
|
};
|
|
|
|
|
|
enum _gametype {
|
|
GT_single = 0,
|
|
GT_multi
|
|
};
|
|
|
|
|
|
enum _multitype {
|
|
MT_ptpm, // udp ptp master
|
|
MT_ptps // udp ptp client
|
|
};
|
|
|
|
|
|
enum _gamestate {
|
|
GS_startup = 0,
|
|
GS_quit,
|
|
GS_wait, // waiting for players to join
|
|
GS_update,
|
|
GS_ready,
|
|
GS_running
|
|
};
|
|
|
|
|
|
enum _maptype {
|
|
MAPT_random = -1, // random map
|
|
MAPT_normal = 0, // a normal map
|
|
MAPT_tunnel, // a map with tunnels
|
|
|
|
MAPT_max
|
|
};
|
|
|
|
|
|
enum _fieldtype {
|
|
FT_nothing = 0, // Nothing in here
|
|
FT_stone, // Stones you can bomb away
|
|
FT_block, // Stones which can't bomb away
|
|
FT_tunnel, // the tunnel item
|
|
FT_death, // The bad Powerup
|
|
FT_fire, // The fire Powerup
|
|
FT_bomb, // The bomb Powerup
|
|
FT_shoe, // The shoe Powerup
|
|
FT_mixed, // The mixed Powerup
|
|
FT_sp_trigger, // The Triggered bomb Special
|
|
FT_sp_row, // The bomb-row special
|
|
FT_sp_push, // The push-boms special
|
|
FT_sp_moved, // The moved-boms special
|
|
FT_sp_liquid, // The liquid-bomb special
|
|
FT_max // just to know how many types there are
|
|
};
|
|
|
|
|
|
enum _poweruptypes {
|
|
PWUP_good = 0,
|
|
PWUP_bad,
|
|
PWUP_special,
|
|
PWUP_max
|
|
};
|
|
|
|
|
|
enum _specials {
|
|
SP_nothing=0, // player has no special
|
|
SP_trigger, // triggered bomb
|
|
SP_row, // bomb row
|
|
SP_push, // push bombs
|
|
SP_moved, // moved bombs
|
|
SP_liquid, // liquid bombs
|
|
|
|
SP_max // just to know how many types there are
|
|
};
|
|
|
|
|
|
|
|
enum _playerillnestype {
|
|
PI_keys = 0, // switch keys
|
|
PI_range, // set exploding range to 1
|
|
PI_slow, // sets speed to 6
|
|
PI_fast, // sets speed to 150
|
|
PI_bomb, // player is dropping bombs permanently
|
|
PI_nobomb, // player cannot drop a bomb or only 1 bomb
|
|
|
|
PI_max // just to know what is the last number
|
|
};
|
|
|
|
|
|
enum _bombstate {
|
|
BS_off = 0,
|
|
BS_ticking,
|
|
BS_exploding,
|
|
BS_trigger
|
|
};
|
|
|
|
|
|
enum _bombmode {
|
|
BM_normal = 0,
|
|
BM_pushed,
|
|
BM_moving,
|
|
BM_liquid,
|
|
BM_kicked
|
|
};
|
|
|
|
|
|
enum _playerstateflags {
|
|
PSF_used = 1, // Player Unused | Player Used
|
|
PSF_net = 2, // Local Player | AI / Network Player
|
|
PSF_alife = 4, // Player is Dead | Player is Alife
|
|
PSF_playing = 8, // Watching Player | Playing Player -- as long as one don't delete
|
|
};
|
|
|
|
#define PSFM_used (PSF_used + PSF_playing)
|
|
#define PSFM_alife (PSF_used + PSF_alife + PSF_playing)
|
|
#define PS_IS_dead(__ps) (((__ps) & (PSFM_alife)) == (PSFM_used))
|
|
#define PS_IS_alife(__ps) (((__ps) & (PSFM_alife)) == (PSFM_alife))
|
|
#define PS_IS_netplayer(__ps) (((__ps) & (PSF_net)) != 0)
|
|
#define PS_IS_playing(__ps) (((__ps) & (PSFM_used)) == (PSFM_used))
|
|
#define PS_IS_used(__ps) (((__ps) & (PSFM_used)) != 0)
|
|
|
|
enum _direction { // to handle directions better
|
|
left = 0,
|
|
right,
|
|
up,
|
|
down
|
|
};
|
|
|
|
enum _dirbitmask { // bit mask for the directions
|
|
DIRM_left = 1,
|
|
DIRM_right = 2,
|
|
DIRM_up = 4,
|
|
DIRM_down = 8,
|
|
DIRM_under = 16
|
|
};
|
|
|
|
enum _mapselection {
|
|
MAPS_select = 0,
|
|
MAPS_randmap,
|
|
MAPS_randgen
|
|
};
|
|
|
|
enum _mstatus {
|
|
MS_normal = 0,
|
|
MS_hurrywarn,
|
|
MS_hurry, // mapsize will go down
|
|
MS_dropitems, // alot of items will be droppen randomly into the game
|
|
|
|
MS_max
|
|
};
|
|
|
|
struct {
|
|
Sint16 x;
|
|
Sint16 y;
|
|
} typedef _point;
|
|
|
|
#endif
|