X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=345e9f9dfc0600ab468b086c2f8f046bdd903a26;hb=49600fe866a0590700a684593913fc5674332201;hp=0ed5442c24d24f33728a0b7b4cb8b4e31f44ef37;hpb=942ec4881e3b21c130df9ae105d06c2c633fa192;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index 0ed5442c..345e9f9d 100644 --- a/src/main.h +++ b/src/main.h @@ -86,6 +86,7 @@ #define EP_DROPPABLE 22 #define EP_CAN_EXPLODE_1X1 23 #define EP_PUSHABLE 24 +#define EP_CAN_EXPLODE_DYNA 25 /* values for pre-defined properties */ #define EP_PLAYER 32 @@ -161,7 +162,7 @@ #define CE_PRESSED_BY_PLAYER 2 #define CE_PUSHED_BY_PLAYER 3 #define CE_DROPPED_BY_PLAYER 4 -#define CE_COLLISION_ACTIVE 5 +#define CE_HITTING_SOMETHING 5 #define CE_IMPACT 6 #define CE_SMASHED 7 #define CE_OTHER_IS_TOUCHING 8 @@ -183,9 +184,9 @@ #define CE_OTHER_GETS_LEFT 24 #define CE_SWITCHED 25 #define CE_OTHER_IS_SWITCHING 26 -#define CE_COLLISION_PASSIVE 27 -#define CE_OTHER_IS_COLL_ACTIVE 28 -#define CE_OTHER_IS_COLL_PASSIVE 29 +#define CE_HIT_BY_SOMETHING 27 +#define CE_OTHER_IS_HITTING 28 +#define CE_OTHER_GETS_HIT 29 #define NUM_CHANGE_EVENTS 30 @@ -229,12 +230,19 @@ #define MV_BIT_WHEN_PUSHED 10 #define MV_BIT_MAZE_RUNNER 11 #define MV_BIT_MAZE_HUNTER 12 +#define MV_BIT_WHEN_DROPPED 13 +#define MV_BIT_TURNING_LEFT_RIGHT 14 +#define MV_BIT_TURNING_RIGHT_LEFT 15 +#define MV_BIT_TURNING_RANDOM 16 +#define MV_BIT_PREVIOUS 17 /* values for special move patterns for custom elements */ #define MV_HORIZONTAL (MV_LEFT | MV_RIGHT) #define MV_VERTICAL (MV_UP | MV_DOWN) #define MV_ALL_DIRECTIONS (MV_HORIZONTAL | MV_VERTICAL) #define MV_ANY_DIRECTION (MV_ALL_DIRECTIONS) +#define MV_RANDOM (MV_ALL_DIRECTIONS) +#define MV_AUTOMATIC (MV_NO_MOVING) #define MV_TOWARDS_PLAYER (1 << MV_BIT_TOWARDS_PLAYER) #define MV_AWAY_FROM_PLAYER (1 << MV_BIT_AWAY_FROM_PLAYER) #define MV_ALONG_LEFT_SIDE (1 << MV_BIT_ALONG_LEFT_SIDE) @@ -245,6 +253,15 @@ #define MV_MAZE_RUNNER (1 << MV_BIT_MAZE_RUNNER) #define MV_MAZE_HUNTER (1 << MV_BIT_MAZE_HUNTER) #define MV_MAZE_RUNNER_STYLE (MV_MAZE_RUNNER | MV_MAZE_HUNTER) +#define MV_WHEN_DROPPED (1 << MV_BIT_WHEN_DROPPED) +#define MV_TURNING_LEFT_RIGHT (1 << MV_BIT_TURNING_LEFT_RIGHT) +#define MV_TURNING_RIGHT_LEFT (1 << MV_BIT_TURNING_RIGHT_LEFT) +#define MV_TURNING_RANDOM (1 << MV_BIT_TURNING_RANDOM) +#define MV_PREVIOUS (1 << MV_BIT_PREVIOUS) + +/* values for elements left behind by custom elements */ +#define LEAVE_TYPE_UNLIMITED 0 +#define LEAVE_TYPE_LIMITED 1 /* values for slippery property for custom elements */ #define SLIPPERY_ANY_RANDOM 0 @@ -279,6 +296,7 @@ #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) /* macros for special configurable properties */ #define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL) @@ -332,6 +350,9 @@ #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ (e) <= EL_CUSTOM_END) +#define IS_GROUP_ELEMENT(e) ((e) >= EL_GROUP_START && \ + (e) <= EL_GROUP_END) + #define IS_ENVELOPE(e) ((e) >= EL_ENVELOPE_1 && \ (e) <= EL_ENVELOPE_4) @@ -408,6 +429,8 @@ #define MAX_ENVELOPE_TEXT_LEN (MAX_ENVELOPE_XSIZE * MAX_ENVELOPE_YSIZE) #define MIN_CHANGE_PAGES 1 #define MAX_CHANGE_PAGES 16 +#define MIN_ELEMENTS_IN_GROUP 1 +#define MAX_ELEMENTS_IN_GROUP 16 /* values for elements with content */ #define MIN_ELEMENT_CONTENTS 1 @@ -454,6 +477,23 @@ #define MICROLABEL_YPOS (MICROLEV_YPOS + MICROLEV_YSIZE + 7) +/* score for elements */ +#define SC_EMERALD 0 +#define SC_DIAMOND 1 +#define SC_BUG 2 +#define SC_SPACESHIP 3 +#define SC_YAMYAM 4 +#define SC_ROBOT 5 +#define SC_PACMAN 6 +#define SC_NUT 7 +#define SC_DYNAMITE 8 +#define SC_KEY 9 +#define SC_TIME_BONUS 10 +#define SC_CRYSTAL 11 +#define SC_PEARL 12 +#define SC_SHIELD 13 + + /* "real" level file elements */ #define EL_UNDEFINED -1 @@ -521,9 +561,7 @@ #define EL_DARK_YAMYAM 60 #define EL_BD_MAGIC_WALL 61 #define EL_INVISIBLE_STEELWALL 62 - -#define EL_MAZE_RUNNER 63 - +#define EL_SOKOBAN_FIELD_PLAYER 63 #define EL_DYNABOMB_INCREASE_NUMBER 64 #define EL_DYNABOMB_INCREASE_SIZE 65 #define EL_DYNABOMB_INCREASE_POWER 66 @@ -797,7 +835,16 @@ #define EL_ENVELOPE_3 622 #define EL_ENVELOPE_4 623 -#define NUM_FILE_ELEMENTS 624 +/* ---------- begin of group elements section ------------------------------ */ +#define EL_GROUP_START 624 + +#include "conf_grp.h" /* include auto-generated data structure definitions */ + +#define NUM_GROUP_ELEMENTS 32 +#define EL_GROUP_END 655 +/* ---------- end of custom elements section ------------------------------- */ + +#define NUM_FILE_ELEMENTS 656 /* "real" (and therefore drawable) runtime elements */ @@ -863,12 +910,16 @@ #define EL_EXPANDABLE_WALL_GROWING (EL_FIRST_RUNTIME_UNREAL + 8) #define EL_FLAMES (EL_FIRST_RUNTIME_UNREAL + 9) #define EL_PLAYER_IS_LEAVING (EL_FIRST_RUNTIME_UNREAL + 10) -#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 11) -#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 12) -#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 13) +#define EL_PLAYER_IS_EXPLODING_1 (EL_FIRST_RUNTIME_UNREAL + 11) +#define EL_PLAYER_IS_EXPLODING_2 (EL_FIRST_RUNTIME_UNREAL + 12) +#define EL_PLAYER_IS_EXPLODING_3 (EL_FIRST_RUNTIME_UNREAL + 13) +#define EL_PLAYER_IS_EXPLODING_4 (EL_FIRST_RUNTIME_UNREAL + 14) +#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 15) +#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 16) +#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 17) /* dummy elements (never used as game elements, only used as graphics) */ -#define EL_FIRST_DUMMY (EL_FIRST_RUNTIME_UNREAL + 14) +#define EL_FIRST_DUMMY (EL_FIRST_RUNTIME_UNREAL + 18) #define EL_STEELWALL_TOPLEFT (EL_FIRST_DUMMY + 0) #define EL_STEELWALL_TOPRIGHT (EL_FIRST_DUMMY + 1) @@ -895,9 +946,14 @@ #define EL_BD_DEFAULT (EL_FIRST_DUMMY + 22) #define EL_SP_DEFAULT (EL_FIRST_DUMMY + 23) #define EL_SB_DEFAULT (EL_FIRST_DUMMY + 24) -#define EL_DUMMY (EL_FIRST_DUMMY + 25) -#define MAX_NUM_ELEMENTS (EL_FIRST_DUMMY + 26) +/* 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 MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 2) /* values for graphics/sounds action types */ @@ -1088,7 +1144,7 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 0 -#define PROGRAM_VERSION_PATCH 8 +#define PROGRAM_VERSION_PATCH 9 #define PROGRAM_VERSION_BUILD 0 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" @@ -1177,7 +1233,7 @@ struct PlayerInfo { boolean present; /* player present in level playfield */ boolean connected; /* player connected (locally or via network) */ - boolean active; /* player (present && connected) */ + boolean active; /* player present and connected */ int index_nr, client_nr, element_nr; @@ -1207,6 +1263,7 @@ struct PlayerInfo boolean is_collecting; boolean is_pushing; boolean is_switching; + boolean is_dropping; boolean is_bored; boolean is_sleeping; @@ -1217,6 +1274,7 @@ struct PlayerInfo int anim_delay_counter; int post_delay_counter; + int action_waiting, last_action_waiting; int special_action_bored; int special_action_sleeping; @@ -1230,11 +1288,15 @@ struct PlayerInfo unsigned long move_delay; int move_delay_value; + int move_delay_reset_counter; + unsigned long push_delay; unsigned long push_delay_value; unsigned long actual_frame_counter; + int drop_delay; + int step_counter; int score; @@ -1256,6 +1318,13 @@ struct LevelSetInfo int music[MAX_LEVELS]; }; +struct LevelFileInfo +{ + int nr; + int type; + char *filename; +}; + struct LevelInfo { int file_version; /* file format version the level is stored with */ @@ -1407,6 +1476,19 @@ struct ElementChangeInfo int other_action; /* change triggered by other element actions */ }; +struct ElementGroupInfo +{ + int num_elements; /* number of elements in this group */ + short element[MAX_ELEMENTS_IN_GROUP]; /* list of elements in this group */ + + /* ---------- internal values used at runtime when playing ---------- */ + + /* the following is the same as above, but with recursively resolved group + elements (group elements may also contain further group elements!) */ + int num_elements_resolved; + short element_resolved[NUM_FILE_ELEMENTS]; +}; + struct ElementInfo { /* ---------- token and description strings ---------- */ @@ -1415,7 +1497,7 @@ struct ElementInfo char *class_name; /* element class used in config files */ char *editor_description; /* pre-defined description for level editor */ char *custom_description; /* alternative description from config file */ - char description[MAX_ELEMENT_NAME_LEN + 1]; /* for custom elements */ + char description[MAX_ELEMENT_NAME_LEN + 1]; /* for custom/group elements */ /* ---------- graphic and sound definitions ---------- */ @@ -1448,6 +1530,9 @@ struct ElementInfo int move_pattern; /* direction movable element moves to */ int move_direction_initial; /* initial direction element moves to */ int move_stepsize; /* step size element moves with */ + int move_enter_element; /* element that can be entered (and removed) */ + int move_leave_element; /* element that can be left behind */ + int move_leave_type; /* change (limited) or leave (unlimited) */ int slippery_type; /* how/where other elements slip away */ @@ -1459,6 +1544,8 @@ struct ElementInfo int num_change_pages; /* actual number of change pages */ int current_change_page; /* currently edited change page */ + struct ElementGroupInfo *group; /* pointer to element group info */ + /* ---------- internal values used at runtime when playing ---------- */ unsigned long change_events; /* bitfield for combined change events */ @@ -1466,6 +1553,11 @@ struct ElementInfo int event_page_nr[NUM_CHANGE_EVENTS]; /* page number for each event */ struct ElementChangeInfo *event_page[NUM_CHANGE_EVENTS]; /* page for event */ + boolean in_group[NUM_GROUP_ELEMENTS]; + + boolean can_leave_element; /* element can leave other element behind */ + boolean can_leave_element_last; + /* ---------- internal values used in level editor ---------- */ int access_type; /* walkable or passable */ @@ -1545,7 +1637,12 @@ struct MusicPrefixInfo struct MusicFileInfo { - char *context; + char *basename; + + char *title_header; + char *artist_header; + char *album_header; + char *year_header; char *title; char *artist; @@ -1554,6 +1651,8 @@ struct MusicFileInfo int music; + boolean is_sound; + struct MusicFileInfo *next; };