X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=c8aca94af96d16e06271779961fb97522ed3f0f0;hb=cdc3c940197937b0508a1eb7dcf44874951908b7;hp=af3e7b4e187d4909df9ba9bc230de1054feef756;hpb=098ef036131fbf9cdcd77d1b985abae78df7cb3c;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index af3e7b4e..c8aca94a 100644 --- a/src/main.h +++ b/src/main.h @@ -155,7 +155,10 @@ #define EP_WALK_TO_OBJECT 81 #define EP_DEADLY 82 -#define NUM_ELEMENT_PROPERTIES 83 +/* values for internal purpose only (game engine) */ +#define EP_HAS_ACTION 83 + +#define NUM_ELEMENT_PROPERTIES 84 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -179,28 +182,35 @@ #define CE_HITTING_SOMETHING 5 #define CE_IMPACT 6 #define CE_SMASHED 7 -#define CE_OTHER_IS_TOUCHING 8 -#define CE_OTHER_IS_CHANGING 9 -#define CE_OTHER_IS_EXPLODING 10 -#define CE_OTHER_GETS_TOUCHED 11 -#define CE_OTHER_GETS_PRESSED 12 -#define CE_OTHER_GETS_PUSHED 13 -#define CE_OTHER_GETS_COLLECTED 14 -#define CE_OTHER_GETS_DROPPED 15 +#define CE_TOUCHING_X 8 +#define CE_CHANGE_OF_X 9 +#define CE_EXPLOSION_OF_X 10 +#define CE_PLAYER_TOUCHES_X 11 +#define CE_PLAYER_PRESSES_X 12 +#define CE_PLAYER_PUSHES_X 13 +#define CE_PLAYER_COLLECTS_X 14 +#define CE_PLAYER_DROPS_X 15 + +#if 1 +#define CE_COUNT_AT_ZERO 16 +#define CE_COUNT_AT_ZERO_OF_X 17 +#else #define CE_BY_PLAYER_OBSOLETE 16 /* obsolete; now CE_BY_DIRECT_ACTION */ #define CE_BY_COLLISION_OBSOLETE 17 /* obsolete; now CE_BY_DIRECT_ACTION */ +#endif + #define CE_BY_OTHER_ACTION 18 /* activates other element events */ #define CE_BY_DIRECT_ACTION 19 /* activates direct element events */ -#define CE_OTHER_GETS_DIGGED 20 +#define CE_PLAYER_DIGS_X 20 #define CE_ENTERED_BY_PLAYER 21 #define CE_LEFT_BY_PLAYER 22 -#define CE_OTHER_GETS_ENTERED 23 -#define CE_OTHER_GETS_LEFT 24 +#define CE_PLAYER_ENTERS_X 23 +#define CE_PLAYER_LEAVES_X 24 #define CE_SWITCHED 25 -#define CE_OTHER_IS_SWITCHING 26 +#define CE_SWITCH_OF_X 26 #define CE_HIT_BY_SOMETHING 27 -#define CE_OTHER_IS_HITTING 28 -#define CE_OTHER_GETS_HIT 29 +#define CE_HITTING_X 28 +#define CE_HIT_BY_X 29 #define CE_BLOCKED 30 #define NUM_CHANGE_EVENTS 31 @@ -243,6 +253,18 @@ (CH_ANY_EVENT_VAR(e) &= ~CH_EVENT_BIT(c))) : 0) #endif +/* values for player bitmasks */ +#define PLAYER_BITS_NONE 0 +#define PLAYER_BITS_1 (1 << 0) +#define PLAYER_BITS_2 (1 << 1) +#define PLAYER_BITS_3 (1 << 2) +#define PLAYER_BITS_4 (1 << 3) +#define PLAYER_BITS_ANY (PLAYER_BITS_1 | \ + PLAYER_BITS_2 | \ + PLAYER_BITS_3 | \ + PLAYER_BITS_4) +#define PLAYER_BITS_TRIGGER (1 << 4) + /* values for change side for custom elements */ #define CH_SIDE_NONE MV_NO_MOVING #define CH_SIDE_LEFT MV_LEFT @@ -254,13 +276,12 @@ #define CH_SIDE_ANY MV_ANY_DIRECTION /* values for change player for custom elements */ -#define CH_PLAYER_NONE 0 -#define CH_PLAYER_1 (1 << 0) -#define CH_PLAYER_2 (1 << 1) -#define CH_PLAYER_3 (1 << 2) -#define CH_PLAYER_4 (1 << 3) -#define CH_PLAYER_ANY (CH_PLAYER_1 | CH_PLAYER_2 | CH_PLAYER_3 | \ - CH_PLAYER_4) +#define CH_PLAYER_NONE PLAYER_BITS_NONE +#define CH_PLAYER_1 PLAYER_BITS_1 +#define CH_PLAYER_2 PLAYER_BITS_2 +#define CH_PLAYER_3 PLAYER_BITS_3 +#define CH_PLAYER_4 PLAYER_BITS_4 +#define CH_PLAYER_ANY PLAYER_BITS_ANY /* values for change page for custom elements */ #define CH_PAGE_ANY_FILE (0xff) @@ -274,6 +295,70 @@ #define CP_WHEN_REMOVABLE 4 #define CP_WHEN_WALKABLE 5 +/* values for change actions for custom elements */ +#define CA_NO_ACTION 0 +#define CA_EXIT_PLAYER 1 +#define CA_KILL_PLAYER 2 +#define CA_RESTART_LEVEL 3 +#define CA_SHOW_ENVELOPE 4 +#define CA_ADD_KEY 5 +#define CA_DEL_KEY 6 +#define CA_SET_PLAYER_SPEED 7 +#define CA_SET_GEMS 8 +#define CA_SET_TIME 9 +#define CA_SET_SCORE 10 +#define CA_SET_CE_SCORE 11 +#define CA_SET_CE_COUNT 12 +#define CA_SET_DYNABOMB_NUMBER 13 +#define CA_SET_DYNABOMB_SIZE 14 +#define CA_SET_DYNABOMB_POWER 15 +#define CA_TOGGLE_PLAYER_GRAVITY 16 +#define CA_ENABLE_PLAYER_GRAVITY 17 +#define CA_DISABLE_PLAYER_GRAVITY 18 + +/* values for change action mode for custom elements */ +#define CA_MODE_UNDEFINED 0 +#define CA_MODE_ADD 1 +#define CA_MODE_SUBTRACT 2 +#define CA_MODE_MULTIPLY 3 +#define CA_MODE_DIVIDE 4 +#define CA_MODE_SET 5 + +/* values for change action parameters for custom elements */ +#define CA_ARG_MIN 0 +#define CA_ARG_0 0 +#define CA_ARG_1 1 +#define CA_ARG_2 2 +#define CA_ARG_3 3 +#define CA_ARG_4 4 +#define CA_ARG_5 5 +#define CA_ARG_10 10 +#define CA_ARG_100 100 +#define CA_ARG_1000 1000 +#define CA_ARG_MAX 9999 +#define CA_ARG_PLAYER 10000 +#define CA_ARG_PLAYER_HEADLINE (CA_ARG_PLAYER + 0) +#define CA_ARG_PLAYER_1 (CA_ARG_PLAYER + PLAYER_BITS_1) +#define CA_ARG_PLAYER_2 (CA_ARG_PLAYER + PLAYER_BITS_2) +#define CA_ARG_PLAYER_3 (CA_ARG_PLAYER + PLAYER_BITS_3) +#define CA_ARG_PLAYER_4 (CA_ARG_PLAYER + PLAYER_BITS_4) +#define CA_ARG_PLAYER_ANY (CA_ARG_PLAYER + PLAYER_BITS_ANY) +#define CA_ARG_PLAYER_TRIGGER (CA_ARG_PLAYER + PLAYER_BITS_TRIGGER) +#define CA_ARG_NUMBER 20000 +#define CA_ARG_NUMBER_HEADLINE (CA_ARG_NUMBER + 0) +#define CA_ARG_NUMBER_MIN (CA_ARG_NUMBER + 1) +#define CA_ARG_NUMBER_MAX (CA_ARG_NUMBER + 2) +#define CA_ARG_NUMBER_NORMAL (CA_ARG_NUMBER + 3) +#define CA_ARG_NUMBER_RESET (CA_ARG_NUMBER + 4) +#define CA_ARG_NUMBER_CE_SCORE (CA_ARG_NUMBER + 5) +#define CA_ARG_NUMBER_CE_COUNT (CA_ARG_NUMBER + 6) +#define CA_ARG_NUMBER_CE_DELAY (CA_ARG_NUMBER + 7) +#define CA_ARG_ELEMENT 30000 +#define CA_ARG_ELEMENT_HEADLINE (CA_ARG_ELEMENT + 0) +#define CA_ARG_ELEMENT_TARGET (CA_ARG_ELEMENT + 1) +#define CA_ARG_ELEMENT_TRIGGER (CA_ARG_ELEMENT + 2) +#define CA_ARG_UNDEFINED 30999 + /* values for custom move patterns (bits 0 - 3: basic move directions) */ #define MV_BIT_TOWARDS_PLAYER 4 #define MV_BIT_AWAY_FROM_PLAYER 5 @@ -424,6 +509,7 @@ HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_EXPLOSION) #define COULD_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_COULD_MOVE_INTO_ACID) #define MAYBE_DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_MAYBE_DONT_COLLIDE_WITH) +#define HAS_ACTION(e) HAS_PROPERTY(e, EP_HAS_ACTION) /* special macros used in game engine */ #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ @@ -550,6 +636,9 @@ #define PLAYER_SWITCHING(p,x,y) ((p)->is_switching && \ (p)->switch_x == (x) && (p)->switch_y == (y)) +#define PLAYER_DROPPING(p,x,y) ((p)->is_dropping && \ + (p)->drop_x == (x) && (p)->drop_y == (y)) + #define PLAYER_NR_GFX(g,i) ((g) + i * (IMG_PLAYER_2 - IMG_PLAYER_1)) #define ANIM_FRAMES(g) (graphic_info[g].anim_frames) @@ -1385,14 +1474,24 @@ /* program information and versioning definitions */ +#define RELEASE_311 FALSE + +#if RELEASE_311 +#define PROGRAM_VERSION_MAJOR 3 +#define PROGRAM_VERSION_MINOR 1 +#define PROGRAM_VERSION_PATCH 2 +#define PROGRAM_VERSION_BUILD 0 +#else +/* !!! make sure that packaging script can find unique version number !!! */ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 2 #define PROGRAM_VERSION_PATCH 0 #define PROGRAM_VERSION_BUILD 3 +#endif #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" -#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2004 by Holger Schemel" +#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2005 by Holger Schemel" #define ICON_TITLE_STRING PROGRAM_TITLE_STRING #define COOKIE_PREFIX "ROCKSNDIAMONDS" @@ -1551,6 +1650,7 @@ struct PlayerInfo int num_special_action_sleeping; int switch_x, switch_y; + int drop_x, drop_y; int show_envelope; @@ -1766,6 +1866,9 @@ struct GameInfo int player_boring_delay_random; int player_sleeping_delay_fixed; int player_sleeping_delay_random; + + /* values for special game initialization control */ + boolean restart_level; }; struct GlobalInfo @@ -1815,6 +1918,11 @@ struct ElementChangeInfo boolean explode; /* explode instead of change */ + boolean use_action; /* execute action on specified condition */ + int action_type; /* type of action */ + int action_mode; /* mode of action */ + int action_arg; /* parameter of action */ + /* ---------- internal values used at runtime when playing ---------- */ /* functions that are called before, while and after the change of an @@ -1916,6 +2024,8 @@ struct ElementInfo int explosion_delay; /* duration of explosion of this element */ int ignition_delay; /* delay for explosion by other explosion */ + int counter_initial; /* initial value of generic CE counter */ + struct ElementChangeInfo *change_page; /* actual list of change pages */ struct ElementChangeInfo *change; /* pointer to current change page */ @@ -1942,6 +2052,8 @@ struct ElementInfo boolean can_leave_element_last; #endif + int counter; /* current value of generic CE counter */ + /* ---------- internal values used in level editor ---------- */ int access_type; /* walkable or passable */