X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=1e7ea6b7ea2e71499e2c58c6134cf8c11aba378a;hb=213773d641290a743d56c17165d0bafec72cc0aa;hp=4b69a028acafe27701d4b288177b6bec4d9b5ce6;hpb=54a07f99492ff2571a6bec16fef524de5b4439fb;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index 4b69a028..1e7ea6b7 100644 --- a/src/main.h +++ b/src/main.h @@ -63,12 +63,12 @@ /* values for configurable properties (custom elem's only, else pre-defined) */ #define EP_DIGGABLE 0 #define EP_COLLECTIBLE 1 -#define EP_UNUSED_2 2 -#define EP_UNUSED_3 3 -#define EP_UNUSED_4 4 +#define EP_DONT_RUN_INTO 2 +#define EP_DONT_COLLIDE_WITH 3 +#define EP_DONT_TOUCH 4 #define EP_INDESTRUCTIBLE 5 #define EP_SLIPPERY 6 -#define EP_CAN_EXPLODE 7 +#define EP_CAN_EXPLODE_BY_FIRE 7 #define EP_CAN_MOVE 8 #define EP_CAN_FALL 9 #define EP_CAN_SMASH 10 @@ -79,8 +79,8 @@ #define EP_PASSABLE_INSIDE 15 #define EP_PASSABLE_UNDER 16 #define EP_CHANGEABLE 17 -#define EP_UNUSED_18 18 -#define EP_UNUSED_19 19 +#define EP_CAN_EXPLODE_SMASHED 18 +#define EP_CAN_EXPLODE_IMPACT 19 #define EP_UNUSED_20 20 #define EP_UNUSED_21 21 #define EP_UNUSED_22 22 @@ -97,44 +97,44 @@ #define EP_PLAYER 27 #define EP_CAN_PASS_MAGIC_WALL 28 #define EP_SWITCHABLE 29 -#define EP_DONT_TOUCH 30 -#define EP_ENEMY 31 -#define EP_DONT_GO_TO 32 -#define EP_BD_ELEMENT 33 -#define EP_SP_ELEMENT 34 -#define EP_SB_ELEMENT 35 -#define EP_GEM 36 -#define EP_FOOD_DARK_YAMYAM 37 -#define EP_FOOD_PENGUIN 38 -#define EP_FOOD_PIG 39 -#define EP_HISTORIC_WALL 40 -#define EP_HISTORIC_SOLID 41 -#define EP_BELT 42 -#define EP_BELT_ACTIVE 43 -#define EP_BELT_SWITCH 44 -#define EP_TUBE 45 -#define EP_KEYGATE 46 -#define EP_AMOEBOID 47 -#define EP_AMOEBALIVE 48 -#define EP_HAS_CONTENT 49 -#define EP_ACTIVE_BOMB 50 -#define EP_INACTIVE 51 +#define EP_BD_ELEMENT 30 +#define EP_SP_ELEMENT 31 +#define EP_SB_ELEMENT 32 +#define EP_GEM 33 +#define EP_FOOD_DARK_YAMYAM 34 +#define EP_FOOD_PENGUIN 35 +#define EP_FOOD_PIG 36 +#define EP_HISTORIC_WALL 37 +#define EP_HISTORIC_SOLID 38 +#define EP_CLASSIC_ENEMY 39 +#define EP_BELT 40 +#define EP_BELT_ACTIVE 41 +#define EP_BELT_SWITCH 42 +#define EP_TUBE 43 +#define EP_KEYGATE 44 +#define EP_AMOEBOID 45 +#define EP_AMOEBALIVE 46 +#define EP_HAS_CONTENT 47 +#define EP_ACTIVE_BOMB 48 +#define EP_INACTIVE 49 /* values for derived properties (determined from properties above) */ -#define EP_ACCESSIBLE_OVER 52 -#define EP_ACCESSIBLE_INSIDE 53 -#define EP_ACCESSIBLE_UNDER 54 -#define EP_WALKABLE 55 -#define EP_PASSABLE 56 -#define EP_ACCESSIBLE 57 -#define EP_SNAPPABLE 58 -#define EP_WALL 59 -#define EP_SOLID_FOR_PUSHING 60 -#define EP_DRAGONFIRE_PROOF 61 -#define EP_EXPLOSION_PROOF 62 +#define EP_ACCESSIBLE_OVER 50 +#define EP_ACCESSIBLE_INSIDE 51 +#define EP_ACCESSIBLE_UNDER 52 +#define EP_WALKABLE 53 +#define EP_PASSABLE 54 +#define EP_ACCESSIBLE 55 +#define EP_SNAPPABLE 56 +#define EP_WALL 57 +#define EP_SOLID_FOR_PUSHING 58 +#define EP_DRAGONFIRE_PROOF 59 +#define EP_EXPLOSION_PROOF 60 /* values for internal purpose only (level editor) */ -#define EP_WALK_TO_OBJECT 63 +#define EP_EXPLODE_RESULT 61 +#define EP_WALK_TO_OBJECT 62 +#define EP_DEADLY 63 #define NUM_ELEMENT_PROPERTIES 64 @@ -152,17 +152,14 @@ /* values for change events for custom elements */ -#define CE_DELAY_FIXED 0 -#define CE_DELAY_RANDOM 1 +#define CE_DELAY 0 -#define NUM_CHANGE_EVENTS 2 +#define NUM_CHANGE_EVENTS 1 #define CE_BITMASK_DEFAULT 0 -#define CUSTOM_ELEMENT_INFO(e) (level.custom_element[(e) - EL_CUSTOM_START]) - #define CH_EVENT_BIT(c) (1 << (c)) -#define CH_EVENT_VAR(e) (CUSTOM_ELEMENT_INFO(e).change.events) +#define CH_EVENT_VAR(e) (element_info[e].change.events) #define HAS_CHANGE_EVENT(e,c) (IS_CUSTOM_ELEMENT(e) && \ (CH_EVENT_VAR(e) & CH_EVENT_BIT(c)) != 0) @@ -175,9 +172,12 @@ /* macros for configurable properties */ #define IS_DIGGABLE(e) HAS_PROPERTY(e, EP_DIGGABLE) #define IS_COLLECTIBLE(e) HAS_PROPERTY(e, EP_COLLECTIBLE) +#define DONT_RUN_INTO(e) HAS_PROPERTY(e, EP_DONT_RUN_INTO) +#define DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_DONT_COLLIDE_WITH) +#define DONT_TOUCH(e) HAS_PROPERTY(e, EP_DONT_TOUCH) #define IS_INDESTRUCTIBLE(e) HAS_PROPERTY(e, EP_INDESTRUCTIBLE) #define IS_SLIPPERY(e) HAS_PROPERTY(e, EP_SLIPPERY) -#define CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE) +#define CAN_EXPLODE_BY_FIRE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_FIRE) #define CAN_MOVE(e) HAS_PROPERTY(e, EP_CAN_MOVE) #define CAN_FALL(e) HAS_PROPERTY(e, EP_CAN_FALL) #define CAN_SMASH(e) HAS_PROPERTY(e, EP_CAN_SMASH) @@ -187,8 +187,8 @@ #define IS_PASSABLE_OVER(e) HAS_PROPERTY(e, EP_PASSABLE_OVER) #define IS_PASSABLE_INSIDE(e) HAS_PROPERTY(e, EP_PASSABLE_INSIDE) #define IS_PASSABLE_UNDER(e) HAS_PROPERTY(e, EP_PASSABLE_UNDER) -#define IS_PUSHABLE(e) HAS_PROPERTY(e, EP_PUSHABLE) #define IS_CHANGEABLE(e) HAS_PROPERTY(e, EP_CHANGEABLE) +#define IS_PUSHABLE(e) HAS_PROPERTY(e, EP_PUSHABLE) /* macros for special configurable properties */ #define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL) @@ -200,9 +200,6 @@ #define ELEM_IS_PLAYER(e) HAS_PROPERTY(e, EP_PLAYER) #define CAN_PASS_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_MAGIC_WALL) #define IS_SWITCHABLE(e) HAS_PROPERTY(e, EP_SWITCHABLE) -#define DONT_TOUCH(e) HAS_PROPERTY(e, EP_DONT_TOUCH) -#define IS_ENEMY(e) HAS_PROPERTY(e, EP_ENEMY) -#define DONT_GO_TO(e) HAS_PROPERTY(e, EP_DONT_GO_TO) #define IS_BD_ELEMENT(e) HAS_PROPERTY(e, EP_BD_ELEMENT) #define IS_SP_ELEMENT(e) HAS_PROPERTY(e, EP_SP_ELEMENT) #define IS_SB_ELEMENT(e) HAS_PROPERTY(e, EP_SB_ELEMENT) @@ -212,6 +209,7 @@ #define IS_FOOD_PIG(e) HAS_PROPERTY(e, EP_FOOD_PIG) #define IS_HISTORIC_WALL(e) HAS_PROPERTY(e, EP_HISTORIC_WALL) #define IS_HISTORIC_SOLID(e) HAS_PROPERTY(e, EP_HISTORIC_SOLID) +#define IS_CLASSIC_ENEMY(e) HAS_PROPERTY(e, EP_CLASSIC_ENEMY) #define IS_BELT(e) HAS_PROPERTY(e, EP_BELT) #define IS_BELT_ACTIVE(e) HAS_PROPERTY(e, EP_BELT_ACTIVE) #define IS_BELT_SWITCH(e) HAS_PROPERTY(e, EP_BELT_SWITCH) @@ -236,12 +234,11 @@ #define IS_DRAGONFIRE_PROOF(e) HAS_PROPERTY(e, EP_DRAGONFIRE_PROOF) #define IS_EXPLOSION_PROOF(e) HAS_PROPERTY(e, EP_EXPLOSION_PROOF) -#define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ +#define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ (e) <= EL_CUSTOM_END) -#define GFX_ELEMENT(e) (IS_CUSTOM_ELEMENT(e) && \ - CUSTOM_ELEMENT_INFO(e).use_gfx_element ? \ - CUSTOM_ELEMENT_INFO(e).gfx_element : e) +#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])) @@ -901,6 +898,7 @@ #define PROGRAM_VERSION_MAJOR 2 #define PROGRAM_VERSION_MINOR 2 #define PROGRAM_VERSION_PATCH 0 +#define PROGRAM_VERSION_RELEASE 7 #define PROGRAM_VERSION_STRING "2.2.0rc7" #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" @@ -948,9 +946,10 @@ #define GAME_VERSION_1_4 FILE_VERSION_1_4 #define GAME_VERSION_2_0 FILE_VERSION_2_0 -#define GAME_VERSION_ACTUAL VERSION_IDENT(PROGRAM_VERSION_MAJOR, \ +#define GAME_VERSION_ACTUAL RELEASE_IDENT(PROGRAM_VERSION_MAJOR, \ PROGRAM_VERSION_MINOR, \ - PROGRAM_VERSION_PATCH) + PROGRAM_VERSION_PATCH, \ + PROGRAM_VERSION_RELEASE) /* values for game_emulation */ #define EMU_NONE 0 @@ -1019,30 +1018,6 @@ struct PlayerInfo int shield_deadly_time_left; }; -struct CustomElementChangeInfo -{ - unsigned long events; /* bitfield for change events */ - - int delay_fixed; /* added frame delay before changed (fixed) */ - int delay_random; /* added frame delay before changed (random) */ - int delay_frames; /* either 1 (frames) or 50 (seconds; 50 fps) */ - - short successor; /* new custom element after change */ -}; - -struct CustomElementInfo -{ - boolean use_gfx_element; - short gfx_element; /* optional custom graphic element */ - - int walk_to_action; /* only for level editor; not stored */ - int walkable_layer; /* only for level editor; not stored */ - - int content[3][3]; /* new elements after explosion */ - - struct CustomElementChangeInfo change; -}; - struct LevelInfo { int file_version; /* file format version the level is stored with */ @@ -1059,8 +1034,8 @@ struct LevelInfo char name[MAX_LEVEL_NAME_LEN + 1]; char author[MAX_LEVEL_AUTHOR_LEN + 1]; int score[LEVEL_SCORE_ELEMENTS]; - int yam_content[MAX_ELEMENT_CONTENTS][3][3]; - int num_yam_contents; + int yamyam_content[MAX_ELEMENT_CONTENTS][3][3]; + int num_yamyam_contents; int amoeba_speed; int amoeba_content; int time_magic_wall; @@ -1071,8 +1046,6 @@ struct LevelInfo boolean gravity; boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */ - struct CustomElementInfo custom_element[NUM_CUSTOM_ELEMENTS]; - boolean no_level_file; }; @@ -1118,7 +1091,7 @@ struct GameInfo int initial_move_delay_value; /* variable within running game */ - int yam_content_nr; + int yamyam_content_nr; boolean magic_wall_active; int magic_wall_time_left; int light_time_left; @@ -1156,13 +1129,28 @@ struct DoorInfo int step_delay; }; +struct ElementChangeInfo +{ + unsigned long events; /* bitfield for change events */ + + int delay_fixed; /* added frame delay before changed (fixed) */ + int delay_random; /* added frame delay before changed (random) */ + int delay_frames; /* either 1 (frames) or 50 (seconds; 50 fps) */ + + short successor; /* new custom element after change */ +}; + struct ElementInfo { + /* ---------- token and description strings ---------- */ + char *token_name; /* element token used in config files */ char *class_name; /* element class used in config files */ char *editor_description; /* short description for level editor */ char *custom_description; /* custom description for level editor */ + /* ---------- graphic and sound definitions ---------- */ + int graphic[NUM_ACTIONS]; /* default graphics for several actions */ int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS]; /* special graphics for left/right/up/down */ @@ -1170,6 +1158,32 @@ struct ElementInfo /* special graphics for certain screens */ int sound[NUM_ACTIONS]; /* default sounds for several actions */ + + /* ---------- special element property values ---------- */ + + boolean use_template; /* use all properties from template file */ + + boolean use_gfx_element; + short gfx_element; /* optional custom graphic element */ + + int score; /* score for collection, smashing, ... */ + + 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 move_pattern; /* direction movable element moves to */ + int move_direction_initial; /* initial direction element moves to */ + + int consistency; /* only for level editor; not stored */ + int walk_to_action; /* only for level editor; not stored */ + int deadliness; /* only for level editor; not stored */ + int walkable_layer; /* only for level editor; not stored */ + + int content[3][3]; /* new elements after explosion */ + + struct ElementChangeInfo change; }; struct FontInfo