source splitting.. the bomberclone.h file needed to cut into peaces.. the whole source was always compiled if i just made a small change.
parent
11def691f9
commit
4357930b24
@ -0,0 +1,58 @@
|
|||||||
|
/* $Id: bomb.h,v 1.1 2004/04/03 14:48:42 stpohle Exp $
|
||||||
|
* bomb include file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _BOMB_H_
|
||||||
|
#define _BOMB_H_
|
||||||
|
|
||||||
|
|
||||||
|
enum _bombstate {
|
||||||
|
BS_off = 0,
|
||||||
|
BS_ticking,
|
||||||
|
BS_exploding,
|
||||||
|
BS_trigger
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
enum _bombmode {
|
||||||
|
BM_normal = 0,
|
||||||
|
BM_pushed,
|
||||||
|
BM_moving,
|
||||||
|
BM_liquid,
|
||||||
|
BM_kicked
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct {
|
||||||
|
_pointf pos; // lower byte = _X Higher Byte = FX
|
||||||
|
struct __bomb_id { // save the bomb id
|
||||||
|
signed char p; // playernumber of this bomb
|
||||||
|
signed char b; // bombnumber of this bomb
|
||||||
|
} id;
|
||||||
|
int firer[4]; // range of the fire for the fire for each direction
|
||||||
|
int firerst[4]; /* just save here where the direction was going to stop (-1)
|
||||||
|
if the exp is still growing */
|
||||||
|
float to; // timeout in ms after dropping the bomb. (loops * 0.0005sec)
|
||||||
|
float frame; // frame of the animation
|
||||||
|
unsigned char r; // range of the bomb
|
||||||
|
unsigned char state; // state of the bomb BS_*
|
||||||
|
unsigned char mode; // mode of the bomb BM_*
|
||||||
|
int ex_nr; // explosion number
|
||||||
|
_point dest; // destination to move the bomb to
|
||||||
|
float speed; // bomb moving speed
|
||||||
|
} typedef _bomb;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// for the bomb..
|
||||||
|
extern int bomb_loop ();
|
||||||
|
extern void bomb_explode (_bomb *bomb, int net);
|
||||||
|
extern inline void bomb_action (_bomb *bomb);
|
||||||
|
extern void bomb_move (_bomb *bomb);
|
||||||
|
extern void get_bomb_on (float x, float y, _point bombs[]);
|
||||||
|
extern void do_explosion (_bomb *bomb);
|
||||||
|
extern void restore_explosion (_bomb * bomb);
|
||||||
|
extern int explosion_check_field (int x, int y, _bomb *bomb);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,146 @@
|
|||||||
|
/* $Id: player.h,v 1.1 2004/04/03 14:48:42 stpohle Exp $
|
||||||
|
* playerinclude file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _PLAYER_H_
|
||||||
|
#define _PLAYER_H_
|
||||||
|
|
||||||
|
#include "bomb.h"
|
||||||
|
|
||||||
|
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_kick, // kick bombs
|
||||||
|
|
||||||
|
SP_max, // just to know how many types there are
|
||||||
|
SP_clear // needed to let the server know we removed the special
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 _playerstateflags { // not Set | Set
|
||||||
|
PSF_used = 1, // Player Unused | Player Used
|
||||||
|
PSF_net = 2, // Local Player | 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
|
||||||
|
PSF_ai = 16, // | AI Player
|
||||||
|
PSF_respawn = 32 // | Player is Respawning
|
||||||
|
};
|
||||||
|
|
||||||
|
#define PSFM_used (PSF_used + PSF_playing)
|
||||||
|
#define PSFM_alife (PSF_used + PSF_alife + PSF_playing)
|
||||||
|
#define PS_IS_dead(__ps) (((__ps) & (PSFM_alife + PSF_respawn)) == (PSFM_used))
|
||||||
|
#define PS_IS_respawn(__ps) (((__ps) & (PSFM_alife + PSF_respawn)) == (PSFM_used + PSF_respawn))
|
||||||
|
#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)
|
||||||
|
#define PS_IS_aiplayer(__ps) ((((__ps) & (PSFM_used)) != 0) && (((__ps) & (PSF_ai)) == PSF_ai))
|
||||||
|
|
||||||
|
|
||||||
|
struct {
|
||||||
|
float to; // if (to > 0) the ilness is still working
|
||||||
|
int datai; // hold a integer data (like number of something..)
|
||||||
|
float dataf; // hold a float data (speed and so on)
|
||||||
|
} typedef _playerilness;
|
||||||
|
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int type; // type of the special
|
||||||
|
float to; // timeout
|
||||||
|
int numuse; // num of uses left
|
||||||
|
int use; /* currently used set by special_use
|
||||||
|
and deleted in special_loop */
|
||||||
|
} typedef _special;
|
||||||
|
|
||||||
|
|
||||||
|
struct {
|
||||||
|
_gfxplayer *gfx; // pointer to the gfx information
|
||||||
|
int gfx_nr; // number of the player GFX
|
||||||
|
|
||||||
|
float frame; // step of the animation (only integer part will shown)
|
||||||
|
float illframe;
|
||||||
|
|
||||||
|
_pointf pos; // position on the field
|
||||||
|
_pointf old; // the old position
|
||||||
|
float tunnelto; /* timeout for dont show and move player
|
||||||
|
needed on the tunnel effect */
|
||||||
|
|
||||||
|
signed char d; // direction
|
||||||
|
signed char m; // player is moving ?
|
||||||
|
signed char old_m; // to save the old state..
|
||||||
|
signed char keyf_bomb; // flag for the bomb key
|
||||||
|
signed char keyf_special; // flag for the special key
|
||||||
|
|
||||||
|
int bombs_n; // maximal number of bombs for the player
|
||||||
|
int bomb_lastex; // number of the bomb which explode the last time
|
||||||
|
_bomb bombs[MAX_BOMBS]; // number of bombs who are ticking.
|
||||||
|
int range; // range of the bombs
|
||||||
|
float speed; // how fast we can go (0 = slow, 1 = normal... 3 = fastest)
|
||||||
|
float stepsleft; // distance to walk on the next stepmove_player
|
||||||
|
int collect_shoes;
|
||||||
|
_playerilness ill[PI_max]; // all possible types
|
||||||
|
_special special; // special the player has
|
||||||
|
|
||||||
|
char name[LEN_PLAYERNAME]; // name oder name[0] == 0
|
||||||
|
unsigned char state; // status of the player
|
||||||
|
signed char in_nr; // number of the connected player entry
|
||||||
|
|
||||||
|
int points; // points
|
||||||
|
int wins; // wins
|
||||||
|
signed char dead_by; // player who killed this player
|
||||||
|
|
||||||
|
_net_player net; // holds all important network data
|
||||||
|
} typedef _player;
|
||||||
|
|
||||||
|
// everything what is declared in players.c
|
||||||
|
extern _player *players;
|
||||||
|
|
||||||
|
extern void dead_playerani ();
|
||||||
|
extern void draw_player (_player * player);
|
||||||
|
extern void restore_players_screen ();
|
||||||
|
extern void player_move (int pl_nr);
|
||||||
|
extern float stepmove_player (int pl_nr);
|
||||||
|
extern void player_drop_bomb (int pl_nr);
|
||||||
|
extern void get_player_on (float x, float y, int pl_nr[]);
|
||||||
|
extern void player_died (_player * player, signed char dead_by);
|
||||||
|
extern void draw_players ();
|
||||||
|
extern void player_animation (_player * player);
|
||||||
|
extern int check_field (short int x, short int y);
|
||||||
|
extern int check_exfield (short int x, short int y);
|
||||||
|
extern void player_calcpos ();
|
||||||
|
extern void player_set_ilness (_player * p, int t, float new_to);
|
||||||
|
extern void player_clear_ilness (_player *p, int type);
|
||||||
|
extern void player_ilness_loop (int plnr);
|
||||||
|
extern void player_check_powerup (int p_nr);
|
||||||
|
extern void player_set_gfx (_player *p, signed char gfx_nr);
|
||||||
|
extern int player_findfreebomb (_player *player);
|
||||||
|
extern int player_checkpos (int x, int y);
|
||||||
|
extern void player_checkdeath (int pnr);
|
||||||
|
extern void player_check (int pl_nr);
|
||||||
|
|
||||||
|
// for the playerinput handling
|
||||||
|
extern void playerinput_loop (int pl_nr);
|
||||||
|
extern void playerinput_keyb_loop (int pl_nr);
|
||||||
|
extern inline void playerinput_keyb_read (int pk_offset, int pl_nr);
|
||||||
|
|
||||||
|
/* playermenu.c */
|
||||||
|
extern void player_menu ();
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,20 @@
|
|||||||
|
/* $Id: single.h,v 1.1 2004/04/03 14:48:42 stpohle Exp $
|
||||||
|
* single player */
|
||||||
|
|
||||||
|
// single.c
|
||||||
|
extern void single_game_new ();
|
||||||
|
extern void single_create_ai (int num_players);
|
||||||
|
extern void single_delete_ai (int num_players);
|
||||||
|
extern void single_loop();
|
||||||
|
extern void single_playergame ();
|
||||||
|
extern void single_menu ();
|
||||||
|
extern int single_select_player ();
|
||||||
|
extern int ai_choosedir (int dir, int nearbomb, int oldpos);
|
||||||
|
extern inline int ai_invertdir (int dir);
|
||||||
|
extern inline int ai_checkpos (_player * pl, _point * pos);
|
||||||
|
extern int ai_findnearbombs (_point pos);
|
||||||
|
extern int ai_findbestbombdir (_point pos, int dir, int range);
|
||||||
|
extern int ai_bombpoints (_point pos, int range);
|
||||||
|
extern _airunaway ai_runawayfrom (_point p, int nearbomb, signed char norecursive);
|
||||||
|
extern int ai_checkfield (int x, int y);
|
||||||
|
extern int ai_easyrunaway (_point p);
|
Loading…
Reference in new issue