4 /* ========================================================================= */
5 /* functions and definitions exported from game_em to main program */
6 /* ========================================================================= */
8 /* ------------------------------------------------------------------------- */
9 /* constant definitions */
10 /* ------------------------------------------------------------------------- */
12 /* define these for backwards compatibility */
13 #define EM_ENGINE_BAD_ROLL
14 #define EM_ENGINE_BAD_SPRING
16 /* define these to use additional elements */
17 #define EM_ENGINE_USE_ADDITIONAL_ELEMENTS
19 /* internal definitions for EM engine */
20 #ifdef EM_ENGINE_BAD_ROLL
24 #ifdef EM_ENGINE_BAD_SPRING
28 /* one border for ZBORDER elements, one border for steelwall, if needed */
29 #define EM_MAX_CAVE_WIDTH (MAX_PLAYFIELD_WIDTH + 2 + 2)
30 #define EM_MAX_CAVE_HEIGHT (MAX_PLAYFIELD_HEIGHT + 2 + 2)
33 -----------------------------------------------------------------------------
34 definition of elements used in the Emerald Mine Club engine;
35 the element names have the following properties:
36 - elements that start with 'X' can be stored in a level file
37 - elements that start with 'Y' indicate moving elements
38 - elements that end with 'B' are the "backside" of moving elements
39 -----------------------------------------------------------------------------
44 Xblank = 0, /* still */
45 Yacid_splash_eB, /* hmm */
46 Yacid_splash_wB, /* hmm */
48 #ifdef EM_ENGINE_BAD_ROLL
49 Xstone_force_e, /* only use these in eater */
279 #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
381 #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
463 Xboom_bug, /* passed from explode to synchro (linked explosion);
464 transition to explode_normal */
465 Xboom_bomb, /* passed from explode to synchro (linked explosion);
466 transition to explode_normal */
467 Xboom_android, /* passed from explode to synchro;
468 transition to boom_2 */
469 Xboom_1, /* passed from explode to synchro;
470 transition to boom_2 */
471 Xboom_2, /* transition to boom[] */
473 Znormal, /* passed from synchro to explode, only in next[];
475 Zdynamite, /* passed from synchro to explode, only in next[];
477 Zplayer, /* special code to indicate player;
479 ZBORDER, /* special code to indicate border;
485 /* other definitions */
499 SAMPLE_blank = 0, /* player walks on blank */
500 SAMPLE_roll, /* player pushes stone/bomb/nut/spring */
501 SAMPLE_stone, /* stone hits ground */
502 SAMPLE_nut, /* nut hits ground */
503 SAMPLE_crack, /* stone hits nut */
504 SAMPLE_bug, /* bug moves */
505 SAMPLE_tank, /* tank moves */
506 SAMPLE_android_clone, /* android places something */
507 SAMPLE_android_move, /* android moves */
508 SAMPLE_spring, /* spring hits ground/wall/bumper, stone hits spring */
509 SAMPLE_slurp, /* spring kills alien */
510 SAMPLE_eater, /* eater sits */
511 SAMPLE_eater_eat, /* eater eats diamond */
512 SAMPLE_alien, /* alien moves */
513 SAMPLE_collect, /* player collects object */
514 SAMPLE_diamond, /* diamond/emerald hits ground */
515 SAMPLE_squash, /* stone squashes diamond */
516 SAMPLE_wonderfall, /* object falls thru wonderwall */
517 SAMPLE_drip, /* drip hits ground */
518 SAMPLE_push, /* player pushes balloon/android */
519 SAMPLE_dirt, /* player walks on dirt */
520 SAMPLE_acid, /* acid splashes */
521 SAMPLE_ball, /* ball places something */
522 SAMPLE_grow, /* growing wall grows */
523 SAMPLE_wonder, /* wonderwall is active */
524 SAMPLE_door, /* player goes thru door (gate) */
525 SAMPLE_exit_open, /* exit opens */
526 SAMPLE_exit_leave, /* player goes into exit */
527 SAMPLE_dynamite, /* player places dynamite */
528 SAMPLE_tick, /* dynamite ticks */
529 SAMPLE_press, /* player presses wheel/wind/switch */
530 SAMPLE_wheel, /* wheel moves */
531 SAMPLE_boom, /* explosion */
532 SAMPLE_time, /* time runs out */
533 SAMPLE_die, /* player dies */
539 /* ------------------------------------------------------------------------- */
540 /* data structure definitions */
541 /* ------------------------------------------------------------------------- */
545 int home_initial; /* number of players (initial) */
546 int home; /* number of players not yet at home */
547 /* 0 == all players at home */
549 int width; /* playfield width */
550 int height; /* playfield height */
552 int time_seconds; /* available time (seconds) */
553 int time_initial; /* available time (initial) */
554 int time; /* time remaining (runtime) */
556 boolean killed_out_of_time; /* kill player due to time out */
558 int required_initial; /* emeralds needed (initial) */
559 int required; /* emeralds needed (runtime) */
561 int score; /* score */
563 /* all below entries must be filled every time a level is read */
565 int alien_score; /* score for killing alien */
566 int amoeba_time; /* amoeba speed */
567 int android_move_cnt_initial; /* android move counter (initial) */
568 int android_move_cnt; /* android move counter */
569 int android_move_time; /* android move reset time */
570 int android_clone_cnt_initial;/* android clone counter (initial) */
571 int android_clone_cnt; /* android clone counter */
572 int android_clone_time; /* android clone reset time */
573 int ball_cnt; /* ball counter */
574 int ball_pos; /* ball array pos counter */
575 int ball_random; /* ball is random flag */
576 int ball_state_initial; /* ball active flag (initial) */
577 int ball_state; /* ball active flag */
578 int ball_time; /* ball reset time */
579 int bug_score; /* score for killing bug */
580 int diamond_score; /* score for collecting diamond */
581 int dynamite_score; /* score for collecting dynamite */
582 int eater_pos; /* eater array pos */
583 int eater_score; /* score for killing eater */
584 int emerald_score; /* score for collecting emerald */
585 int exit_score; /* score for entering exit */
586 int key_score; /* score for colleting key */
587 int lenses_cnt_initial; /* lenses counter (initial) */
588 int lenses_cnt; /* lenses counter */
589 int lenses_score; /* score for collecting lenses */
590 int lenses_time; /* lenses reset time */
591 int magnify_cnt_initial; /* magnify counter (initial) */
592 int magnify_cnt; /* magnify counter */
593 int magnify_score; /* score for collecting magnifier */
594 int magnify_time; /* magnify reset time */
595 int nut_score; /* score for cracking nut */
596 int shine_cnt; /* shine counter for emerald/diamond */
597 int slurp_score; /* score for slurping alien */
598 int tank_score; /* score for killing tank */
599 int wheel_cnt_initial; /* wheel counter (initial) */
600 int wheel_cnt; /* wheel counter */
601 int wheel_x_initial; /* wheel x pos (initial) */
602 int wheel_x; /* wheel x pos */
603 int wheel_y_initial; /* wheel y pos (initial) */
604 int wheel_y; /* wheel y pos */
605 int wheel_time; /* wheel reset time */
606 int wind_cnt_initial; /* wind counter (initial) */
607 int wind_cnt; /* wind time counter */
608 int wind_direction_initial; /* wind direction (initial) */
609 int wind_direction; /* wind direction */
610 int wind_time; /* wind reset time */
611 int wonderwall_state_initial; /* wonderwall active flag (initial) */
612 int wonderwall_state; /* wonderwall active flag */
613 int wonderwall_time_initial; /* wonderwall time (initial) */
614 int wonderwall_time; /* wonderwall time */
615 short eater_array[8][9]; /* eater data */
616 short ball_array[8][8]; /* ball data */
617 short android_array[TILE_MAX];/* android clone table */
618 int num_ball_arrays; /* number of ball data arrays used */
654 Bitmap *screenbuffer;
659 boolean any_player_moving;
660 int last_moving_player;
661 int last_player_direction[MAX_PLAYERS];
668 short cave[EM_MAX_CAVE_WIDTH][EM_MAX_CAVE_HEIGHT];
671 struct PLAYER *ply[MAX_PLAYERS];
674 struct GraphicInfo_EM
678 int src_offset_x, src_offset_y;
679 int dst_offset_x, dst_offset_y;
682 Bitmap *crumbled_bitmap;
683 int crumbled_src_x, crumbled_src_y;
684 int crumbled_border_size;
686 boolean has_crumbled_graphics;
687 boolean preserve_background;
689 int unique_identifier; /* used to identify needed screen updates */
693 /* ------------------------------------------------------------------------- */
694 /* exported functions */
695 /* ------------------------------------------------------------------------- */
697 extern struct GlobalInfo_EM global_em_info;
698 extern struct LevelInfo_EM native_em_level;
699 extern struct GraphicInfo_EM graphic_info_em_object[TILE_MAX][8];
700 extern struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][SPR_MAX][8];
702 extern void em_open_all();
703 extern void em_close_all();
705 extern void InitGameEngine_EM();
706 extern void GameActions_EM(byte *, boolean);
708 extern unsigned int InitEngineRND_EM(long);
710 extern void setLevelInfoToDefaults_EM();
711 extern boolean LoadNativeLevel_EM(char *);
713 extern void BlitScreenToBitmap_EM(Bitmap *);
714 extern void RedrawPlayfield_EM(boolean);
715 extern void DrawGameDoorValues_EM();
717 #endif /* EXPORT_H */