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.
bomberclone/src/basic.h

151 lines
3.3 KiB

/* basic types which we need everywhere */
#ifndef _BC_BASIC_H_
#define _BC_BASIC_H_
#define SUB_VERSION 6
#define GAME_SPECIAL_ITEMBOMB 10
#define GAME_SPECIAL_ITEMFIRE 10
#define GAME_SPECIAL_ITEMSHOE 15
#define GAME_SPECIAL_ITEMDEATH 25
#define PKG_RESENDCACHE_SIZE (64*1024)
#define PKG_IN_INDEX_NUM 256
#define RESENDCACHE_TIMEOUT 500
#define RESENDCACHE_RETRY 10
#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_UPDATERECTS 2048
#define MAX_CONNECTS 16 /* maximal number of connection data */
#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 21
#define MIN_FIELDSIZE_Y 13
#define ANI_FIRETIMEOUT 20
#define ANI_BOMBTIMEOUT 1
#define ANI_PLAYERTIMEOUT 1
#define ANI_PLAYERILLTIMEOUT 1
#define ANI_STONETIMEOUT 10
#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 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
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 _fieldtype {
FT_nothing = 0, // Nothing in here
FT_stone, // Stones you can bomb away
FT_block, // Stones which can't bomb away
FT_death, // The bad Powerup
FT_fire, // Special Field for the fire
FT_bomb,
FT_shoe,
FT_max // just to know how many types there are
};
enum _playerillnestype {
PI_keys = 0,
PI_range,
PI_slow,
PI_bomb,
PI_max // just to know what is the last number
};
enum _bombstate {
BS_off = 0,
BS_ticking,
BS_exploding
};
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) & (PSFM_alife + PSF_net)) == (PSF_net + PSFM_alife))
#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
};
struct __point {
short int x;
short int y;
} typedef _point;
#endif