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

206 lines
5.0 KiB

/* basic types which we need everywhere */
#ifndef _BC_BASIC_H_
#define _BC_BASIC_H_
#define GAME_SPECIAL_ITEMBOMB 10
#define GAME_SPECIAL_ITEMFIRE 10
#define GAME_SPECIAL_ITEMSHOE 10
#define GAME_SPECIAL_ITEMDEATH 25
#define GAME_SPECIAL_ITEMMIXED 10
#define GAME_SPECIAL_ITEMSTRIGGER 2
#define GAME_SPECIAL_ITEMSROW 2
#define GAME_SPECIAL_ITEMSPUSH 2
#define GAME_SPECIAL_ITEMSKICK 0
#define GAME_SPECIAL_ITEMSLIQUID 0
#define GAME_SPECIAL_ITEMSDESTROY 0
#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 SPECIAL_KICK_NUMUSE 8
#define SPECIAL_LIQUID_NUMUSE 8
#define SPECIAL_DESTROY_NUMUSE 5
#define SPECIAL_8WAY_NUMUSE 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_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_FILEDANIMATION 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 256
#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
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 _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, // 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_kick, // The kick-boms special
FT_max // just to know how many types there are
};
enum _poweruptypes {
PWUP_good = 0,
PWUP_bad,
PWUP_special,
PWUP_max
};
enum _special {
SP_nothing=0, // player has no special
SP_trigger, // triggered bomb
SP_row, // bomb row
SP_push, // push bombs
SP_kick, // kick 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 _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
};
struct __point {
short int x;
short int y;
} typedef _point;
#endif