asteroids.h

asteroids.h · 2.4 KB

From the archive Asteroids.zip

Download the archive   « Back to the archive contents

/*
 * Asteroid Header File
 * By: Odis
 *
 * Last Updated: 4/23/04
 */
#ifdef ORE
#include "ore.h"
#endif

#define AST_DIR	"../asteroids/"		/* Asteroid folder			*/
#define AST_LIST	"asteroid.lst"	/* List of asteroids		*/

typedef	struct	asteroid_data		ASTEROID_DATA;

struct  asteroid_data
{
	  ASTEROID_DATA	*			next;
	  ASTEROID_DATA	*			prev;
	  ASTEROID_DATA	*			next_in_system;
	  ASTEROID_DATA *			prev_in_system;
	  SPACE_DATA	*			starsystem;
	  AREA_DATA 	*			area;
	  float					x;
	  float					y;
	  float					z;
	  char	*				home_system;
	  char	*				name;
	  char	*				filename;
	  sh_int				type;	// 0 = unknown, 1 = small, 2 = medium, 3 = large
	  sh_int				stype;	// 0 = unknown, 1 = ice, 2 = rock
	  sh_int				timer;
#ifdef ORE
	  sh_int				ore1;
	  sh_int				ore2;
	  sh_int				ore1ammount;
	  sh_int				ore2ammount;
#endif
	  long					exp;	// exp reward
	  int					hp;     // hit points of the asteroid 
	  int					maxhp;  // max hit points of the asteroid
	  int					speed;
	  int					collision;
	  int					flags;
};

// Global Variables
extern		ASTEROID_DATA	*	first_asteroid;
extern		ASTEROID_DATA	*	last_asteroid;

//Global Table (used by Ores)
extern		char * const ast_flags	[];

// New Functions
DECLARE_DO_FUN( do_showasteroid );
DECLARE_DO_FUN( do_resetasteroid );
DECLARE_DO_FUN( do_makeasteroid );
DECLARE_DO_FUN( do_setasteroid );
DECLARE_DO_FUN( do_copyasteroid );

// Global Functions
void	load_asteroids			args( ( void ) );
void	save_asteroid			args( ( ASTEROID_DATA *asteroid ) );
void	update_asteroids		args( ( void ) );
void	generate_coordinates		args( ( int num, ASTEROID_DATA *asteroid ) );
void	echo_to_asystem			args( ( int color , ASTEROID_DATA *asteroid , char *argument ) );
void	asteroid_to_system		args( ( ASTEROID_DATA *asteroid, SPACE_DATA *starsystem ) );
void	reset_asteroid			args( ( char *name, sh_int type, sh_int stype, long experience, bool save) );
void	damage_asteroid			args( ( ASTEROID_DATA *asteroid, int min, int max ) );
void	damage_asteroid_ch		args( ( ASTEROID_DATA *asteroid, int min, int max, CHAR_DATA *ch ) );
int	generate_hp			args( ( sh_int type, sh_int stype ) );
int	get_astflag			args( ( char *flag ) );
bool	extract_asteroid		args( ( ASTEROID_DATA *asteroid ) );
ASTEROID_DATA	*get_asteroid		args( ( char *name ) );
ASTEROID_DATA   *get_asteroid_here	args( ( char *name, SPACE_DATA *starsystem ) );
ASTEROID_DATA   *get_asteroid_area	args( ( CHAR_DATA *ch ) );

Site Stats

Snippets: 1791
Codebases: 571