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 for backwards compatibility */
52 #define EM_ENGINE_BAD_ROLL
53 #define EM_ENGINE_BAD_SPRING
55 /* define these to use additional elements */
56 #define EM_ENGINE_USE_ADDITIONAL_ELEMENTS
58 /* internal definitions for EM engine */
59 #ifdef EM_ENGINE_BAD_ROLL
63 #ifdef EM_ENGINE_BAD_SPRING
67 /* one border for Zborder elements, one border for steelwall, if needed */
68 #define EM_MAX_CAVE_WIDTH (MAX_PLAYFIELD_WIDTH + 2 + 2)
69 #define EM_MAX_CAVE_HEIGHT (MAX_PLAYFIELD_HEIGHT + 2 + 2)
72 -----------------------------------------------------------------------------
73 definition of elements used in the Emerald Mine Club engine;
74 the element names have the following properties:
75 - elements that start with 'X' can be stored in a level file
76 - elements that start with 'Y' indicate moving elements
77 - elements that end with 'B' are the "backside" of moving elements
78 -----------------------------------------------------------------------------
88 #ifdef EM_ENGINE_BAD_ROLL
335 #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
350 Xslidewall_ns, /* growing wall */
424 #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
425 Xsand_stonesand_quickout_1,
426 Xsand_stonesand_quickout_2,
443 Xfake_amoeba, /* dripper */
461 #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
547 Xboom_bug, /* passed from explode to synchro (linked explosion);
548 transition to explode_normal */
549 Xboom_bomb, /* passed from explode to synchro (linked explosion);
550 transition to explode_normal */
551 Xboom_android, /* passed from explode to synchro;
552 transition to boom_2 */
553 Xboom_1, /* passed from explode to synchro;
554 transition to boom_2 */
555 Xboom_2, /* transition to boom[] */
557 Znormal, /* passed from synchro to explode, only in next[];
559 Zdynamite, /* passed from synchro to explode, only in next[];
561 Zplayer, /* special code to indicate player;
563 Zborder, /* special code to indicate border;
569 /* other definitions */
595 SOUND_blank = 0, /* player walks on blank */
596 SOUND_roll, /* player pushes stone/bomb/nut/spring */
597 SOUND_stone, /* stone hits ground */
598 SOUND_nut, /* nut hits ground */
599 SOUND_crack, /* stone hits nut */
600 SOUND_bug, /* bug moves */
601 SOUND_tank, /* tank moves */
602 SOUND_android_clone, /* android places something */
603 SOUND_android_move, /* android moves */
604 SOUND_spring, /* spring hits ground/wall/bumper, stone hits spring */
605 SOUND_slurp, /* spring kills alien */
606 SOUND_eater, /* eater sits */
607 SOUND_eater_eat, /* eater eats diamond */
608 SOUND_alien, /* alien moves */
609 SOUND_collect, /* player collects object */
610 SOUND_diamond, /* diamond/emerald hits ground */
611 SOUND_squash, /* stone squashes diamond */
612 SOUND_wonderfall, /* object falls thru wonderwall */
613 SOUND_drip, /* drip hits ground */
614 SOUND_push, /* player pushes spring/balloon/android */
615 SOUND_dirt, /* player digs into dirt */
616 SOUND_acid, /* acid splashes */
617 SOUND_ball, /* ball places something */
618 SOUND_slidewall, /* slide wall grows */
619 SOUND_wonder, /* wonderwall is active */
620 SOUND_door, /* player goes thru door (gate) */
621 SOUND_exit_open, /* exit opens */
622 SOUND_exit_leave, /* player goes into exit */
623 SOUND_dynamite, /* player places dynamite */
624 SOUND_tick, /* dynamite ticks */
625 SOUND_press, /* player presses wheel/wind/switch */
626 SOUND_wheel, /* wheel moves */
627 SOUND_boom, /* explosion */
628 SOUND_time, /* time runs out */
629 SOUND_die, /* player dies */
635 // ----------------------------------------------------------------------------
636 // data structure definitions
637 // ----------------------------------------------------------------------------
641 int home_initial; /* number of players (initial) */
642 int home; /* number of players not yet at home */
643 /* 0 == all players at home */
645 int width; /* playfield width */
646 int height; /* playfield height */
648 int time_seconds; /* available time (seconds) */
649 int time_initial; /* available time (initial) */
650 int time; /* time remaining (runtime) */
652 boolean killed_out_of_time; /* kill player due to time out */
654 int required_initial; /* emeralds needed (initial) */
655 int required; /* emeralds needed (runtime) */
657 int score; /* score */
659 /* all below entries must be filled every time a level is read */
661 int alien_score; /* score for killing alien */
662 int amoeba_time; /* amoeba speed */
663 int android_move_cnt_initial; /* android move counter (initial) */
664 int android_move_cnt; /* android move counter */
665 int android_move_time; /* android move reset time */
666 int android_clone_cnt_initial;/* android clone counter (initial) */
667 int android_clone_cnt; /* android clone counter */
668 int android_clone_time; /* android clone reset time */
669 int ball_cnt; /* ball counter */
670 int ball_pos; /* ball array pos counter */
671 int ball_random; /* ball is random flag */
672 int ball_state_initial; /* ball active flag (initial) */
673 int ball_state; /* ball active flag */
674 int ball_time; /* ball reset time */
675 int bug_score; /* score for killing bug */
676 int diamond_score; /* score for collecting diamond */
677 int dynamite_score; /* score for collecting dynamite */
678 int eater_pos; /* eater array pos */
679 int eater_score; /* score for killing eater */
680 int emerald_score; /* score for collecting emerald */
681 int exit_score; /* score for entering exit */
682 int key_score; /* score for colleting key */
683 int lenses_cnt_initial; /* lenses counter (initial) */
684 int lenses_cnt; /* lenses counter */
685 int lenses_score; /* score for collecting lenses */
686 int lenses_time; /* lenses reset time */
687 int magnify_cnt_initial; /* magnify counter (initial) */
688 int magnify_cnt; /* magnify counter */
689 int magnify_score; /* score for collecting magnifier */
690 int magnify_time; /* magnify reset time */
691 int nut_score; /* score for cracking nut */
692 int shine_cnt; /* shine counter for emerald/diamond */
693 int slurp_score; /* score for slurping alien */
694 int tank_score; /* score for killing tank */
695 int wheel_cnt_initial; /* wheel counter (initial) */
696 int wheel_cnt; /* wheel counter */
697 int wheel_x_initial; /* wheel x pos (initial) */
698 int wheel_x; /* wheel x pos */
699 int wheel_y_initial; /* wheel y pos (initial) */
700 int wheel_y; /* wheel y pos */
701 int wheel_time; /* wheel reset time */
702 int wind_cnt_initial; /* wind counter (initial) */
703 int wind_cnt; /* wind time counter */
704 int wind_direction_initial; /* wind direction (initial) */
705 int wind_direction; /* wind direction */
706 int wind_time; /* wind reset time */
707 int wonderwall_state_initial; /* wonderwall active flag (initial) */
708 int wonderwall_state; /* wonderwall active flag */
709 int wonderwall_time_initial; /* wonderwall time (initial) */
710 int wonderwall_time; /* wonderwall time */
711 short eater_array[8][9]; /* eater data */
712 short ball_array[8][8]; /* ball data */
713 short android_array[TILE_MAX];/* android clone table */
714 int num_ball_arrays; /* number of ball data arrays used */
716 int exit_x, exit_y; /* kludge for playing player exit sound */