3 This program "Emerald Mine for X11"
4 is copyright © 2009 David Tritscher. All rights reserved.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
13 2. The origin of this software must not be misrepresented; you must
14 not claim that you wrote the original software. If you use this
15 software in a product, an acknowledgment in the product
16 documentation would be appreciated but is not required.
18 3. Altered source versions must be plainly marked as such, and must
19 not be misrepresented as being the original software.
21 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
22 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 /* 2007-03-31 06:22:47
36 * emerald mine game engine defines
39 // ----------------------------------------------------------------------------
40 // EM game engine source code was altered for integration in Rocks'n'Diamonds
41 // ----------------------------------------------------------------------------
47 // ----------------------------------------------------------------------------
48 // constant definitions
49 // ----------------------------------------------------------------------------
51 /* define these to use additional elements */
52 #define EM_ENGINE_USE_ADDITIONAL_ELEMENTS
54 /* one border for Zborder elements, one border for steelwall, if needed */
55 #define EM_MAX_CAVE_WIDTH (MAX_PLAYFIELD_WIDTH + 2 + 2)
56 #define EM_MAX_CAVE_HEIGHT (MAX_PLAYFIELD_HEIGHT + 2 + 2)
59 -----------------------------------------------------------------------------
60 definition of elements used in the Emerald Mine Club engine;
61 the element names have the following properties:
62 - elements that start with 'X' can be stored in a level file
63 - elements that start with 'Y' indicate moving elements
64 - elements that end with 'B' are the "backside" of moving elements
65 -----------------------------------------------------------------------------
87 #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
396 Xfake_amoeba, /* dripper */
419 #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
420 Xsand_stonesand_quickout_1,
421 Xsand_stonesand_quickout_2,
424 Xslidewall_ns, /* growing wall */
516 #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
531 Xboom_bug, /* passed from explode to synchro (linked explosion);
532 transition to explode_normal */
533 Xboom_bomb, /* passed from explode to synchro (linked explosion);
534 transition to explode_normal */
535 Xboom_android, /* passed from explode to synchro;
536 transition to boom_2 */
537 Xboom_1, /* passed from explode to synchro;
538 transition to boom_2 */
539 Xboom_2, /* transition to boom[] */
541 Znormal, /* passed from synchro to explode, only in next[];
543 Zdynamite, /* passed from synchro to explode, only in next[];
545 Zplayer, /* special code to indicate player;
547 Zborder, /* special code to indicate border;
553 /* other definitions */
579 SOUND_blank = 0, /* player walks on blank */
580 SOUND_roll, /* player pushes stone/bomb/nut/spring */
581 SOUND_stone, /* stone hits ground */
582 SOUND_nut, /* nut hits ground */
583 SOUND_crack, /* stone hits nut */
584 SOUND_bug, /* bug moves */
585 SOUND_tank, /* tank moves */
586 SOUND_android_clone, /* android places something */
587 SOUND_android_move, /* android moves */
588 SOUND_spring, /* spring hits ground/wall/bumper, stone hits spring */
589 SOUND_slurp, /* spring kills alien */
590 SOUND_eater, /* eater sits */
591 SOUND_eater_eat, /* eater eats diamond */
592 SOUND_alien, /* alien moves */
593 SOUND_collect, /* player collects object */
594 SOUND_diamond, /* diamond/emerald hits ground */
595 SOUND_squash, /* stone squashes diamond */
596 SOUND_wonderfall, /* object falls thru wonderwall */
597 SOUND_drip, /* drip hits ground */
598 SOUND_push, /* player pushes spring/balloon/android */
599 SOUND_dirt, /* player digs into dirt */
600 SOUND_acid, /* acid splashes */
601 SOUND_ball, /* ball places something */
602 SOUND_slidewall, /* slide wall grows */
603 SOUND_wonder, /* wonderwall is active */
604 SOUND_door, /* player goes thru door (gate) */
605 SOUND_exit_open, /* exit opens */
606 SOUND_exit_leave, /* player goes into exit */
607 SOUND_dynamite, /* player places dynamite */
608 SOUND_tick, /* dynamite ticks */
609 SOUND_press, /* player presses wheel/wind/switch */
610 SOUND_wheel, /* wheel moves */
611 SOUND_boom, /* explosion */
612 SOUND_time, /* time runs out */
613 SOUND_die, /* player dies */
619 // ----------------------------------------------------------------------------
620 // data structure definitions
621 // ----------------------------------------------------------------------------
625 int home_initial; /* number of players (initial) */
626 int home; /* number of players not yet at home */
627 /* 0 == all players at home */
629 int width; /* playfield width */
630 int height; /* playfield height */
632 int time_seconds; /* available time (seconds) */
633 int time_initial; /* available time (initial) */
634 int time; /* time remaining (runtime) */
636 boolean killed_out_of_time; /* kill player due to time out */
638 int required_initial; /* emeralds needed (initial) */
639 int required; /* emeralds needed (runtime) */
641 int score; /* score */
643 /* all below entries must be filled every time a level is read */
645 int alien_score; /* score for killing alien */
646 int amoeba_time; /* amoeba speed */
647 int android_move_cnt_initial; /* android move counter (initial) */
648 int android_move_cnt; /* android move counter */
649 int android_move_time; /* android move reset time */
650 int android_clone_cnt_initial;/* android clone counter (initial) */
651 int android_clone_cnt; /* android clone counter */
652 int android_clone_time; /* android clone reset time */
653 int ball_cnt; /* ball counter */
654 int ball_pos; /* ball array pos counter */
655 int ball_random; /* ball is random flag */
656 int ball_state_initial; /* ball active flag (initial) */
657 int ball_state; /* ball active flag */
658 int ball_time; /* ball reset time */
659 int bug_score; /* score for killing bug */
660 int diamond_score; /* score for collecting diamond */
661 int dynamite_score; /* score for collecting dynamite */
662 int eater_pos; /* eater array pos */
663 int eater_score; /* score for killing eater */
664 int emerald_score; /* score for collecting emerald */
665 int exit_score; /* score for entering exit */
666 int key_score; /* score for colleting key */
667 int lenses_cnt_initial; /* lenses counter (initial) */
668 int lenses_cnt; /* lenses counter */
669 int lenses_score; /* score for collecting lenses */
670 int lenses_time; /* lenses reset time */
671 int magnify_cnt_initial; /* magnify counter (initial) */
672 int magnify_cnt; /* magnify counter */
673 int magnify_score; /* score for collecting magnifier */
674 int magnify_time; /* magnify reset time */
675 int nut_score; /* score for cracking nut */
676 int shine_cnt; /* shine counter for emerald/diamond */
677 int slurp_score; /* score for slurping alien */
678 int tank_score; /* score for killing tank */
679 int wheel_cnt_initial; /* wheel counter (initial) */
680 int wheel_cnt; /* wheel counter */
681 int wheel_x_initial; /* wheel x pos (initial) */
682 int wheel_x; /* wheel x pos */
683 int wheel_y_initial; /* wheel y pos (initial) */
684 int wheel_y; /* wheel y pos */
685 int wheel_time; /* wheel reset time */
686 int wind_cnt_initial; /* wind counter (initial) */
687 int wind_cnt; /* wind time counter */
688 int wind_direction_initial; /* wind direction (initial) */
689 int wind_direction; /* wind direction */
690 int wind_time; /* wind reset time */
691 int wonderwall_state_initial; /* wonderwall active flag (initial) */
692 int wonderwall_state; /* wonderwall active flag */
693 int wonderwall_time_initial; /* wonderwall time (initial) */
694 int wonderwall_time; /* wonderwall time */
695 short eater_array[8][9]; /* eater data */
696 short ball_array[8][8]; /* ball data */
697 short android_array[TILE_MAX];/* android clone table */
698 int num_ball_arrays; /* number of ball data arrays used */
700 int exit_x, exit_y; /* kludge for playing player exit sound */