📄 defines.h
字号:
/*============================================================================*/
/* PROJECT NUCLEUS. (c) RocSoft, 1995. */
/* v1.0 18 Jan 95. */
/*============================================================================*/
/*==============================[ Constants ]=================================*/
#define ANGLE_INC 5
#define ANGLE_START 10
#define BEAM_TOON_BASE_PRI 90
#define CONTROL_PANEL_COLOUR 22
#define COUNTER_TOON_BASE_PRI 100
#define DEMO_TOON_BASE_PRI 200
#define FRACTAL_COLOUR_REG_1 32
#define FRACTAL_CYCLE_COLOUR_1 96 /* Colour 32 (start) */
#define FRACTAL_CYCLE_COLOUR_2 138 /* Colour 46 (start) */
#define FRACTAL_CYCLE_COUNT 42 /* Cycle n-1 colours */
#define LOGO_DELAY 9
#define LOGO_BL_X 55
#define LOGO_BL_Y 151
#define LOGO_TL_X 55
#define LOGO_TL_Y 17
#define MAX_BEAMS 5
#define MAX_NUCLEI 10
#define MAX_OBJECTS 256
#define MAX_PARTICLES 15
#define MAX_ROGUE_PARTICLES 5
#define MAX_SHIELDS 5
#define MAX_SQUARE 3600
#define MIN_BREAK_SPEED 5
#define MIN_SPEED 1
#define NLD_ID 0x1a444c4eL
#define NUCLEUS_HIT_TOLERANCE 6
#define NUM_OF_BEAMS 6
#define NUM_OF_PARTICLES 3
#define NUM_OF_POWERUPS 16
#define NUM_OF_ROGUE_PARTICLES 8
#define NUM_OF_SHIELDS 8
#define PANEL_YBASE 6
#define PANEL_XBASE 20
#define PANEL_XBASE1 134
#define PANEL_XBASE2 232
#define PARTICLE_TOON_BASE_PRI 10
#define POWER_UP_FRAME_DELAY 4
#define POWER_UP_TOON_BASE_PRI 150
#define ROGUE_FRAME_DELAY 4
#define ROGUE_TOON_BASE_PRI 50
#define SAMPLE_RATE 144
#define SHIELD_GROWTH_REPS 2
#define SHIELD_TOON_BASE_PRI 140
#define SOUND_QUEUE_SIZE 1024
#define SPEED_MASK_1 0x03
#define SPEED_MASK_2 0x07
#define SPEED_UP_TIME 19
#define SPLIT_SCREEN_HEIGHT 32
#define START_X_LOGO (VS.mx>>1) /* Logo start position */
#define START_Y_LOGO (VS.my+1)
#define SYRINGE_FRAMES 5
#define SYRINGE_THRESHOLD 20
#define SYRINGE_TOON_BASE_PRI 190
#define VX_MIN 8 /* Viewport dimensions */
#define VX_MAX 311
#define VY_MIN 8
#define VY_MAX 159
/*===============================[ Macros ]===================================*/
#define CONSUME_KEYS while(inkey(0))
#define COPY_PAGE(f,t) copyvid(0,0,VS.mx,VS.my,(f),(t))
/*==========================[ Defined Datatypes ]=============================*/
typedef enum
{
ERR_MALLOC,
ERR_REGNAG,
ERR_NOMOUSE,
ERR_NODATA,
ERR_NLD,
NUM_OF_ERRS
} ERROR_TYPE;
typedef enum
{
OPTIONS_HDG_1,
NO_SOUND_OPTIONS_TOKEN,
EFFECTS_OPTIONS_TOKEN,
MUSIC_OPTIONS_TOKEN
} GAME_OPTION_TOKENS;
typedef enum
{
NEW_GAME_OPTION,
LOAD_GAME_OPTION,
SAVE_GAME_OPTION,
HELP_OPTION,
HIGH_SCORES_OPTION,
REGISTER_OPTION,
OPTIONS_OPTION,
BACK_TO_GAME_OPTION,
DEMO_OPTION,
EXIT_OPTION
} MENU_OPTION_TOKENS;
typedef struct
{
int cx, cy; /* Centre of Nucleus */
int mass; /* Nucleus mass */
int speed; /* Angular speed of rotation */
int cframe; /* Toon frame of counter */
int n_fired, s_fired; /* Fired flags for demo mode */
} NUCLEUS;
typedef struct
{
int active; /* Is particle in nucleus */
int nucleus; /* Index of nucleus */
int r; /* Radius of rotation */
int type; /* Particle image index */
int vx, vy; /* X & Y velocities */
int x, y; /* X & Y position of centre */
int angle; /* Current angle of rotation */
int rogue; /* TRUE if particle is rogue */
int frame; /* For rogue particles only */
int delay; /* Frame delay for rogue only */
int time; /* Time left (secs) for rogue */
} PARTICLE;
typedef struct
{
BYTE active; /* TRUE if shield is active */
int x, y; /* Centre of shield */
int rx, ry; /* Radii of shield (x & y) */
int frame; /* Frame index for animation */
int time; /* Time left (secs) */
int reps; /* Rep count for growth */
} SHIELD;
typedef struct
{
BYTE active; /* TRUE if beam is active */
int frame; /* Beam frame index */
int x, y; /* Beam position */
int vx; /* Beam velocity in X */
} BEAM;
typedef enum
{
PC_SPEAKER,
SOUND_BLASTER
} SOUND_TYPE;
typedef enum
{
PUP_SHIELD,
PUP_NEUTRON,
PUP_RANDOM,
NUMBER_OF_POWERUPS
} POWER_UP_TYPE;
typedef struct
{
unsigned int id;
int level;
int shield_cnt;
int rays;
int time;
unsigned int timers[MAX_NUCLEI];
unsigned int power_up_timer;
unsigned int beam_timer;
unsigned int rogue_timer;
BEAM beams[MAX_BEAMS];
NUCLEUS nuclei[MAX_NUCLEI];
PARTICLE particles[MAX_PARTICLES];
PARTICLE rogues[MAX_ROGUE_PARTICLES];
SHIELD shields[MAX_SHIELDS];
long score;
BYTE briefed;
} CONFIG;
typedef struct
{
int mass_meltdown; /* TRUE if critical mass causes meltdown */
int time_meltdown; /* TRUE if critical time causes meltdown */
int orbit_speed_up; /* TRUE if nucleus orbit acceleration */
int rogue_particles; /* TRUE if rogue particles active */
int rogue_beams; /* TRUE if rogue neutron beams active */
int bounce_edges; /* TRUE if particles bounce at edges */
int force_field; /* TRUE if retention grid available */
int gun; /* TRUE if neutron gun is available */
int count; /* Number of particles active */
int time; /* Time duration of experiment in seconds */
int critical_mass; /* Critical mass in units */
int critical_time; /* Critical time in seconds */
int shields; /* Number of shields to start with */
int rays; /* Number of neutrons to start with */
int power_up_delay; /* Seconds before power up appears */
POWER_UP_TYPE powerup; /* Type of power up to be made available */
int min_beam_sep; /* Min time (secs) between rogue beams */
int max_beam_sep; /* Max time (secs) between rogue beams */
int min_rogue_sep; /* Min time (secs) between rogue particles*/
int max_rogue_sep; /* Max time (secs) between rogue particles*/
int rogue_duration; /* Time (secs) rogue particle lasts for */
int shield_duration; /* Time (secs) shield lasts for */
char text[12][60]; /* Experiment text */
} LEVEL_TYPE;
typedef enum
{
SFX_NO_FIRE, /* BUTTON 0 */
SFX_ROGUE_BEAM, /* LASERZAP 1 */
SFX_NUCLEUS_HIT, /* BOOM 2 */
SFX_NUCLEUS_SPLIT, /* FREEING 3 */
SFX_GAME_OVER, /* GAMEOVER 4 */
SFX_NEUTRON_FIRED, /* ZAP2 5 */
SFX_SHIELD_HIT, /* DRUM2 6 */
SFX_SHIELD_FIRED, /* WHIPCRAK 7 */
SFX_MENU_KEY, /* DING 8 */
SFX_SCREAM1, /* AHHHHH 9 */
SFX_SCREAM2, /* SCREAM 10 */
SFX_FANFARE, /* TADA 11 */
SFX_ROGUE_PARTICLE, /* CRICKET 12 */
SFX_MOVE_BUMPER, /* CAMRA 13 */
SFX_BONUS_PICKUP, /* BONUS 14 */
SFX_LEVEL_START, /* SPACE 15 */
SFX_WARNING, /* ??? 16 */
SFX_ERROR, /* ??? 17 */
NUMBER_OF_SFX
} SFX_TYPE;
typedef enum
{
PTS_NUCLEUS_HIT=5,
PTS_NEUTRON_LEFT=25,
PTS_SHIELD_HIT=5,
PTS_SHIELD_LEFT=50,
PTS_END_OF_LEVEL_BONUS=1000,
PTS_POWER_UP=100,
NUMBER_OF_PTS
} SCORING_PTS;
typedef enum
{
NO_MELTDOWN=0,
TIME_MELTDOWN,
MASS_MELTDOWN,
ROGUE_RAY_MELTDOWN,
ROGUE_PARTICLE_MELTDOWN,
NUMBER_OF_MELTDOWNS
} MELTDOWN_TYPE;
/*==========================[ End Of Include ]================================*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -