X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=0690bafee808f0e66089399beab6a885252873ec;hb=af07d74262e7d5075feaea67fa16c04c6be0e3f6;hp=e40f4d8858c266354c05ceb91ae1d068da0a492b;hpb=f7eeeedb1a0bb21cbd8366cf241faffc76aafc16;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index e40f4d88..0690bafe 100644 --- a/src/main.h +++ b/src/main.h @@ -86,9 +86,10 @@ #define EP_DROPPABLE 22 #define EP_CAN_EXPLODE_1X1 23 #define EP_PUSHABLE 24 -#define EP_CAN_EXPLODE_DYNA 25 +#define EP_CAN_EXPLODE_CROSS 25 #define EP_PROTECTED 26 #define EP_CAN_MOVE_INTO_ACID 27 +#define EP_THROWABLE 28 /* values for pre-defined properties */ #define EP_PLAYER 32 @@ -112,42 +113,45 @@ #define EP_AMOEBOID 50 #define EP_AMOEBALIVE 51 #define EP_HAS_CONTENT 52 -#define EP_ACTIVE_BOMB 53 -#define EP_INACTIVE 54 +#define EP_CAN_TURN_EACH_MOVE 53 +#define EP_CAN_GROW 54 +#define EP_ACTIVE_BOMB 55 +#define EP_INACTIVE 56 /* values for special configurable properties (depending on level settings) */ -#define EP_EM_SLIPPERY_WALL 55 +#define EP_EM_SLIPPERY_WALL 57 /* values for special graphics properties (no effect on game engine) */ -#define EP_GFX_CRUMBLED 56 +#define EP_GFX_CRUMBLED 58 /* values for derived properties (determined from properties above) */ -#define EP_ACCESSIBLE_OVER 57 -#define EP_ACCESSIBLE_INSIDE 58 -#define EP_ACCESSIBLE_UNDER 59 -#define EP_WALKABLE 60 -#define EP_PASSABLE 61 -#define EP_ACCESSIBLE 62 -#define EP_COLLECTIBLE 63 -#define EP_SNAPPABLE 64 -#define EP_WALL 65 -#define EP_SOLID_FOR_PUSHING 66 -#define EP_DRAGONFIRE_PROOF 67 -#define EP_EXPLOSION_PROOF 68 -#define EP_CAN_SMASH 69 -#define EP_CAN_EXPLODE 70 -#define EP_CAN_EXPLODE_3X3 71 -#define EP_SP_PORT 72 -#define EP_CAN_EXPLODE_BY_DRAGONFIRE 73 -#define EP_CAN_EXPLODE_BY_EXPLOSION 74 -#define EP_COULD_MOVE_INTO_ACID 75 +#define EP_ACCESSIBLE_OVER 59 +#define EP_ACCESSIBLE_INSIDE 60 +#define EP_ACCESSIBLE_UNDER 61 +#define EP_WALKABLE 62 +#define EP_PASSABLE 63 +#define EP_ACCESSIBLE 64 +#define EP_COLLECTIBLE 65 +#define EP_SNAPPABLE 66 +#define EP_WALL 67 +#define EP_SOLID_FOR_PUSHING 68 +#define EP_DRAGONFIRE_PROOF 69 +#define EP_EXPLOSION_PROOF 70 +#define EP_CAN_SMASH 71 +#define EP_CAN_EXPLODE 72 +#define EP_CAN_EXPLODE_3X3 73 +#define EP_SP_PORT 74 +#define EP_CAN_EXPLODE_BY_DRAGONFIRE 75 +#define EP_CAN_EXPLODE_BY_EXPLOSION 76 +#define EP_COULD_MOVE_INTO_ACID 77 +#define EP_MAYBE_DONT_COLLIDE_WITH 78 /* values for internal purpose only (level editor) */ -#define EP_EXPLODE_RESULT 76 -#define EP_WALK_TO_OBJECT 77 -#define EP_DEADLY 78 +#define EP_EXPLODE_RESULT 79 +#define EP_WALK_TO_OBJECT 80 +#define EP_DEADLY 81 -#define NUM_ELEMENT_PROPERTIES 79 +#define NUM_ELEMENT_PROPERTIES 82 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -235,9 +239,11 @@ #define CH_PAGE_ANY (0xffffffff) /* values for change power for custom elements */ -#define CP_NON_DESTRUCTIVE 0 -#define CP_HALF_DESTRUCTIVE 1 -#define CP_FULL_DESTRUCTIVE 2 +#define CP_WHEN_EMPTY 0 +#define CP_WHEN_DIGGABLE 1 +#define CP_WHEN_DESTRUCTIBLE 2 +#define CP_WHEN_COLLECTIBLE 3 +#define CP_WHEN_REMOVABLE 4 /* values for custom move patterns (bits 0 - 3: basic move directions) */ #define MV_BIT_TOWARDS_PLAYER 4 @@ -256,8 +262,8 @@ /* values for custom move patterns */ #define MV_HORIZONTAL (MV_LEFT | MV_RIGHT) -#define MV_VERTICAL (MV_UP | MV_DOWN) -#define MV_ALL_DIRECTIONS (MV_HORIZONTAL | MV_VERTICAL) +#define MV_VERTICAL (MV_UP | MV_DOWN) +#define MV_ALL_DIRECTIONS (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN) #define MV_ANY_DIRECTION (MV_ALL_DIRECTIONS) #define MV_TOWARDS_PLAYER (1 << MV_BIT_TOWARDS_PLAYER) #define MV_AWAY_FROM_PLAYER (1 << MV_BIT_AWAY_FROM_PLAYER) @@ -323,9 +329,10 @@ #define IS_DROPPABLE(e) HAS_PROPERTY(e, EP_DROPPABLE) #define CAN_EXPLODE_1X1(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_1X1) #define IS_PUSHABLE(e) HAS_PROPERTY(e, EP_PUSHABLE) -#define CAN_EXPLODE_DYNA(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_DYNA) +#define CAN_EXPLODE_CROSS(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_CROSS) #define IS_PROTECTED(e) HAS_PROPERTY(e, EP_PROTECTED) #define CAN_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_CAN_MOVE_INTO_ACID) +#define IS_THROWABLE(e) HAS_PROPERTY(e, EP_THROWABLE) /* macros for special configurable properties */ #define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL) @@ -355,6 +362,8 @@ #define IS_AMOEBOID(e) HAS_PROPERTY(e, EP_AMOEBOID) #define IS_AMOEBALIVE(e) HAS_PROPERTY(e, EP_AMOEBALIVE) #define HAS_CONTENT(e) HAS_PROPERTY(e, EP_HAS_CONTENT) +#define CAN_TURN_EACH_MOVE(e) HAS_PROPERTY(e, EP_CAN_TURN_EACH_MOVE) +#define CAN_GROW(e) HAS_PROPERTY(e, EP_CAN_GROW) #define IS_ACTIVE_BOMB(e) HAS_PROPERTY(e, EP_ACTIVE_BOMB) #define IS_INACTIVE(e) HAS_PROPERTY(e, EP_INACTIVE) @@ -380,6 +389,7 @@ #define CAN_EXPLODE_BY_EXPLOSION(e) \ 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) /* special macros used in game engine */ #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ @@ -388,16 +398,34 @@ #define IS_GROUP_ELEMENT(e) ((e) >= EL_GROUP_START && \ (e) <= EL_GROUP_END) +#define IS_CLIPBOARD_ELEMENT(e) ((e) >= EL_INTERNAL_CLIPBOARD_START && \ + (e) <= EL_INTERNAL_CLIPBOARD_END) + +#define IS_INTERNAL_ELEMENT(e) ((e) >= EL_INTERNAL_START && \ + (e) <= EL_INTERNAL_END) + #define IS_ENVELOPE(e) ((e) >= EL_ENVELOPE_1 && \ (e) <= EL_ENVELOPE_4) +#define IS_GATE(e) ((e) >= EL_GATE_1 && \ + (e) <= EL_GATE_4) + +#define IS_GATE_GRAY(e) ((e) >= EL_GATE_1_GRAY && \ + (e) <= EL_GATE_4_GRAY) + +#define IS_EM_GATE(e) ((e) >= EL_EM_GATE_1 && \ + (e) <= EL_EM_GATE_4) + +#define IS_EM_GATE_GRAY(e) ((e) >= EL_EM_GATE_1_GRAY && \ + (e) <= EL_EM_GATE_4_GRAY) + #define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \ element_info[e].gfx_element : e) -#define IS_PLAYER(x,y) (ELEM_IS_PLAYER(StorePlayer[x][y])) +#define IS_PLAYER(x, y) (ELEM_IS_PLAYER(StorePlayer[x][y])) -#define IS_FREE(x,y) (Feld[x][y] == EL_EMPTY && !IS_PLAYER(x,y)) -#define IS_FREE_OR_PLAYER(x,y) (Feld[x][y] == EL_EMPTY) +#define IS_FREE(x, y) (Feld[x][y] == EL_EMPTY && !IS_PLAYER(x, y)) +#define IS_FREE_OR_PLAYER(x, y) (Feld[x][y] == EL_EMPTY) #define IS_MOVING(x,y) (MovPos[x][y] != 0) #define IS_FALLING(x,y) (MovPos[x][y] != 0 && MovDir[x][y] == MV_DOWN) @@ -900,8 +928,10 @@ /* ---------- end of custom elements section ------------------------------- */ #define EL_UNKNOWN 656 +#define EL_TRIGGER_ELEMENT 657 +#define EL_TRIGGER_PLAYER 658 -#define NUM_FILE_ELEMENTS 657 +#define NUM_FILE_ELEMENTS 659 /* "real" (and therefore drawable) runtime elements */ @@ -1007,10 +1037,17 @@ /* internal elements (only used for internal purposes like copying) */ #define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 25) -#define EL_INTERNAL_EDITOR (EL_FIRST_INTERNAL + 0) -#define EL_INTERNAL_DUMMY (EL_FIRST_INTERNAL + 1) +#define EL_INTERNAL_CLIPBOARD_CUSTOM (EL_FIRST_INTERNAL + 0) +#define EL_INTERNAL_CLIPBOARD_CHANGE (EL_FIRST_INTERNAL + 1) +#define EL_INTERNAL_CLIPBOARD_GROUP (EL_FIRST_INTERNAL + 2) +#define EL_INTERNAL_DUMMY (EL_FIRST_INTERNAL + 3) + +#define EL_INTERNAL_CLIPBOARD_START (EL_FIRST_INTERNAL + 0) +#define EL_INTERNAL_CLIPBOARD_END (EL_FIRST_INTERNAL + 2) +#define EL_INTERNAL_START (EL_FIRST_INTERNAL + 0) +#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 3) -#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 2) +#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 4) /* values for graphics/sounds action types */ @@ -1200,9 +1237,9 @@ /* program information and versioning definitions */ #define PROGRAM_VERSION_MAJOR 3 -#define PROGRAM_VERSION_MINOR 0 -#define PROGRAM_VERSION_PATCH 9 -#define PROGRAM_VERSION_BUILD 0 +#define PROGRAM_VERSION_MINOR 1 +#define PROGRAM_VERSION_PATCH 0 +#define PROGRAM_VERSION_BUILD 2 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" @@ -1313,6 +1350,7 @@ struct PlayerInfo boolean use_murphy_graphic; boolean block_last_field; + boolean can_fall_into_acid; boolean LevelSolved, GameOver; @@ -1320,6 +1358,7 @@ struct PlayerInfo boolean is_waiting; boolean is_moving; + boolean is_auto_moving; boolean is_digging; boolean is_snapping; boolean is_collecting; @@ -1423,7 +1462,8 @@ struct LevelInfo int time_light; int time_timegate; - int can_move_into_acid_bits; /* bits indicate property for element groups */ + int can_move_into_acid_bits; /* bitfield to store property for elements */ + int dont_collide_with_bits; /* bitfield to store property for elements */ boolean double_speed; boolean initial_gravity; @@ -1431,14 +1471,18 @@ struct LevelInfo boolean block_last_field; /* player blocks previous field while moving */ boolean sp_block_last_field; /* player blocks previous field while moving */ boolean use_spring_bug; /* for compatibility with old levels */ + boolean instant_relocation; /* no visual delay when relocating player */ + boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */ + boolean grow_into_diggable; /* amoeba can grow into anything diggable */ + /* ('int' instead of 'boolean' because used as selectbox value in editor) */ int use_step_counter; /* count steps instead of seconds for level */ short field[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; boolean use_custom_template; /* use custom properties from template file */ - boolean no_level_file; /* set for currently undefined levels */ + boolean no_valid_file; /* set when level file missing or invalid */ }; struct TapeInfo @@ -1458,7 +1502,8 @@ struct TapeInfo boolean pause_before_death; boolean recording, playing, pausing; boolean fast_forward; - boolean index_search; + boolean warp_forward; + boolean deactivate_display; boolean auto_play; boolean auto_play_level_solved; boolean quick_resume; @@ -1472,6 +1517,8 @@ struct TapeInfo byte action[MAX_PLAYERS]; byte delay; } pos[MAX_TAPELEN]; + + boolean no_valid_file; /* set when tape file missing or invalid */ }; struct GameInfo @@ -1536,23 +1583,28 @@ struct ElementChangeInfo int delay_random; /* added frame delay before changed (random) */ int delay_frames; /* either 1 (frames) or 50 (seconds; 50 fps) */ - short trigger_element; /* custom element triggering change */ + short trigger_element; /* element triggering change */ - int content[3][3]; /* new elements after extended change */ - boolean use_content; /* use extended change content */ - boolean only_complete; /* only use complete content */ - boolean use_random_change; /* use random value for setting content */ - int random; /* random value for setting content */ - int power; /* power of extended change */ + int target_content[3][3]; /* elements for extended change target */ + boolean use_target_content; /* use extended change target */ + boolean only_if_complete; /* only use complete target content */ + boolean use_random_replace; /* use random value for replacing elements */ + int random_percentage; /* random value for replacing elements */ + int replace_when; /* type of elements that can be replaced */ boolean explode; /* explode instead of change */ + /* ---------- internal values used at runtime when playing ---------- */ + /* functions that are called before, while and after the change of an element -- currently only used for non-custom elements */ void (*pre_change_function)(int x, int y); void (*change_function)(int x, int y); void (*post_change_function)(int x, int y); + short actual_trigger_element; /* element that actually triggered change */ + int actual_trigger_player; /* player which actually triggered change */ + /* ---------- internal values used in level editor ---------- */ int direct_action; /* change triggered by actions on element */ @@ -1611,10 +1663,12 @@ struct ElementInfo int collect_score; /* score value for collecting */ int collect_count; /* count value for collecting */ - int push_delay_fixed; /* constant frame delay for pushing */ - int push_delay_random; /* additional random frame delay for pushing */ - int move_delay_fixed; /* constant frame delay for moving */ - int move_delay_random; /* additional random frame delay for moving */ + int push_delay_fixed; /* constant delay before pushing */ + int push_delay_random; /* additional random delay before pushing */ + int drop_delay_fixed; /* constant delay after dropping */ + int drop_delay_random; /* additional random delay after dropping */ + int move_delay_fixed; /* constant delay after moving */ + int move_delay_random; /* additional random delay after moving */ int move_pattern; /* direction movable element moves to */ int move_direction_initial; /* initial direction element moves to */ @@ -1647,8 +1701,10 @@ struct ElementInfo boolean in_group[NUM_GROUP_ELEMENTS]; +#if 0 boolean can_leave_element; /* element can leave other element behind */ boolean can_leave_element_last; +#endif /* ---------- internal values used in level editor ---------- */ @@ -1812,6 +1868,7 @@ extern unsigned long Changed[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern unsigned long ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +extern short CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaCnt[MAX_NUM_AMOEBA]; extern short AmoebaCnt2[MAX_NUM_AMOEBA];