X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=0f07442c6a2bc3c57ef6a2e3c8b8d7d42efd207c;hb=b640b9d7647df4cbba0e530f6f4bcece384048e4;hp=f4bfad08eba1422482a561fb6f73469a1a75bafe;hpb=c46bcfd8dd92fbf3ce134eed1e64078147d33b50;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index f4bfad08..0f07442c 100644 --- a/src/main.h +++ b/src/main.h @@ -381,13 +381,16 @@ #define CA_ARG_ELEMENT_RESET (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_ELEMENT_HEADLINE (CA_ARG_ELEMENT + 998) +#define CA_ARG_ELEMENT_HEADLINE (CA_ARG_ELEMENT + 997) #define CA_ARG_ELEMENT_CV_TARGET (CA_ARG_ELEMENT_TARGET) #define CA_ARG_ELEMENT_CV_TRIGGER (CA_ARG_ELEMENT_TRIGGER) #define CA_ARG_ELEMENT_CV_HEADLINE (CA_ARG_ELEMENT_HEADLINE) #define CA_ARG_ELEMENT_NR_TARGET (CA_ARG_ELEMENT + 3) #define CA_ARG_ELEMENT_NR_TRIGGER (CA_ARG_ELEMENT + 4) -#define CA_ARG_ELEMENT_NR_HEADLINE (CA_ARG_ELEMENT + 999) +#define CA_ARG_ELEMENT_NR_HEADLINE (CA_ARG_ELEMENT + 998) +#define CA_ARG_ELEMENT_CS_TARGET (CA_ARG_ELEMENT + 5) +#define CA_ARG_ELEMENT_CS_TRIGGER (CA_ARG_ELEMENT + 6) +#define CA_ARG_ELEMENT_CS_HEADLINE (CA_ARG_ELEMENT + 999) #define CA_ARG_SPEED 13000 #define CA_ARG_SPEED_NOT_MOVING (CA_ARG_SPEED + STEPSIZE_NOT_MOVING) #define CA_ARG_SPEED_VERY_SLOW (CA_ARG_SPEED + STEPSIZE_VERY_SLOW) @@ -667,6 +670,19 @@ #define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \ element_info[e].gfx_element : e) +/* !!! CHECK THIS !!! */ +#if 1 +#define TILE_GFX_ELEMENT(x, y) \ + (GfxElement[x][y] != EL_UNDEFINED && \ + Feld[x][y] != EL_EXPLOSION ? \ + GfxElement[x][y] : Feld[x][y]) +#else +#define TILE_GFX_ELEMENT(x, y) \ + GFX_ELEMENT(GfxElement[x][y] != EL_UNDEFINED && \ + Feld[x][y] != EL_EXPLOSION ? \ + GfxElement[x][y] : Feld[x][y]) +#endif + /* !!! "use sound" deactivated due to problems with level "bug machine" !!! */ /* (solution: add separate "use sound of element" to level file and editor) */ #if 0 @@ -753,10 +769,6 @@ #define EL_NAME(e) ((e) >= 0 ? element_info[e].token_name : "(?)") /* fundamental game speed values */ -#define ONE_SECOND_DELAY 1000 /* delay value for one second */ -#define GAME_FRAME_DELAY 20 /* frame delay in milliseconds */ -#define FFWD_FRAME_DELAY 10 /* 200% speed for fast forward */ -#define FRAMES_PER_SECOND (ONE_SECOND_DELAY / GAME_FRAME_DELAY) #define MICROLEVEL_SCROLL_DELAY 50 /* delay for scrolling micro level */ #define MICROLEVEL_LABEL_DELAY 250 /* delay for micro level label */ @@ -764,13 +776,14 @@ #define MAX_LEVEL_NAME_LEN 32 #define MAX_LEVEL_AUTHOR_LEN 32 #define MAX_ELEMENT_NAME_LEN 32 -#define MAX_TAPE_LEN (1000 * FRAMES_PER_SECOND) /* max.time x fps */ #define MAX_TAPES_PER_SET 1024 #define MAX_SCORE_ENTRIES 100 #define MAX_NUM_AMOEBA 100 +#if 0 /* game.h */ #define MAX_INVENTORY_SIZE 1000 #define STD_NUM_KEYS 4 #define MAX_NUM_KEYS 8 +#endif #define NUM_BELTS 4 #define NUM_BELT_PARTS 3 #define MIN_ENVELOPE_XSIZE 1 @@ -1256,8 +1269,16 @@ #define EL_EMC_DRIPPER 704 #define EL_TRIGGER_CE_VALUE 705 +#define EL_TRIGGER_CE_SCORE 706 +#define EL_CURRENT_CE_VALUE 707 +#define EL_CURRENT_CE_SCORE 708 + +#define EL_YAMYAM_LEFT 709 +#define EL_YAMYAM_RIGHT 710 +#define EL_YAMYAM_UP 711 +#define EL_YAMYAM_DOWN 712 -#define NUM_FILE_ELEMENTS 706 +#define NUM_FILE_ELEMENTS 713 /* "real" (and therefore drawable) runtime elements */ @@ -1622,11 +1643,12 @@ #define FONT_VALUE_1 26 #define FONT_VALUE_2 27 #define FONT_VALUE_OLD 28 -#define FONT_LEVEL_NUMBER 29 -#define FONT_TAPE_RECORDER 30 -#define FONT_GAME_INFO 31 +#define FONT_LEVEL_NUMBER_ACTIVE 29 +#define FONT_LEVEL_NUMBER 30 +#define FONT_TAPE_RECORDER 31 +#define FONT_GAME_INFO 32 -#define NUM_FONTS 32 +#define NUM_FONTS 33 #define NUM_INITIAL_FONTS 4 /* values for game_status (must match special image configuration suffixes) */ @@ -1660,7 +1682,7 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 2 #define PROGRAM_VERSION_PATCH 0 -#define PROGRAM_VERSION_BUILD 7 +#define PROGRAM_VERSION_BUILD 8 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" @@ -1768,104 +1790,6 @@ struct Content int e[3][3]; }; -struct PlayerInfo -{ - boolean present; /* player present in level playfield */ - boolean connected; /* player connected (locally or via network) */ - boolean active; /* player present and connected */ - - int index_nr; /* player number (0 to 3) */ - int index_bit; /* player number bit (1 << 0 to 1 << 3) */ - int element_nr; /* element (EL_PLAYER_1 to EL_PLAYER_4) */ - int client_nr; /* network client identifier */ - - byte action; /* action from local input device */ - byte effective_action; /* action acknowledged from network server - or summarized over all configured input - devices when in single player mode */ - byte programmed_action; /* action forced by game itself (like moving - through doors); overrides other actions */ - - int jx, jy, last_jx, last_jy; - int MovDir, MovPos, GfxDir, GfxPos; - int Frame, StepFrame; - - int GfxAction; - - boolean use_murphy; - int artwork_element; - - boolean block_last_field; - int block_delay_adjustment; /* needed for different engine versions */ - - boolean can_fall_into_acid; - - boolean LevelSolved, GameOver; - - int last_move_dir; - - boolean is_waiting; - boolean is_moving; - boolean is_auto_moving; - boolean is_digging; - boolean is_snapping; - boolean is_collecting; - boolean is_pushing; - boolean is_switching; - boolean is_dropping; - - boolean is_bored; - boolean is_sleeping; - - boolean cannot_move; - - int frame_counter_bored; - int frame_counter_sleeping; - - int anim_delay_counter; - int post_delay_counter; - - int action_waiting, last_action_waiting; - int special_action_bored; - int special_action_sleeping; - - int num_special_action_bored; - int num_special_action_sleeping; - - int switch_x, switch_y; - int drop_x, drop_y; - - int show_envelope; - - int move_delay; - int move_delay_value; - int move_delay_value_next; - int move_delay_reset_counter; - - int push_delay; - int push_delay_value; - - unsigned long actual_frame_counter; - - int drop_delay; - - int step_counter; - - int score; - int gems_still_needed; - int sokobanfields_still_needed; - int lights_still_needed; - int friends_still_needed; - int key[MAX_NUM_KEYS]; - int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl; - int shield_normal_time_left; - int shield_deadly_time_left; - - int inventory_element[MAX_INVENTORY_SIZE]; - int inventory_infinite_element; - int inventory_size; -}; - struct LevelSetInfo { int music[MAX_LEVELS]; @@ -1977,6 +1901,7 @@ struct LevelInfo boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */ boolean grow_into_diggable; /* amoeba can grow into anything diggable */ + boolean continuous_snapping; /* repeated snapping without releasing key */ boolean block_snap_field; /* snapping blocks field to show animation */ boolean block_last_field; /* player blocks previous field while moving */ boolean sp_block_last_field; /* player blocks previous field while moving */ @@ -1993,94 +1918,6 @@ struct LevelInfo boolean changed; /* set when level was changed in the editor */ }; -struct TapeInfo -{ - int file_version; /* file format version the tape is stored with */ - int game_version; /* game release version the tape was created with */ - int engine_version; /* game engine version the tape was recorded with */ - - char *level_identifier; - int level_nr; - unsigned long random_seed; - unsigned long date; - unsigned long counter; - unsigned long length; - unsigned long length_seconds; - unsigned int delay_played; - boolean pause_before_death; - boolean recording, playing, pausing; - boolean fast_forward; - boolean warp_forward; - boolean deactivate_display; - boolean auto_play; - boolean auto_play_level_solved; - boolean quick_resume; - boolean single_step; - boolean changed; - boolean player_participates[MAX_PLAYERS]; - int num_participating_players; - - struct - { - byte action[MAX_PLAYERS]; - byte delay; - } pos[MAX_TAPE_LEN]; - - boolean no_valid_file; /* set when tape file missing or invalid */ -}; - -struct GameInfo -{ - /* values for engine initialization */ - int default_push_delay_fixed; - int default_push_delay_random; - - /* constant within running game */ - int engine_version; - int emulation; - int initial_move_delay; - int initial_move_delay_value; - int initial_push_delay_value; - - /* flags to handle bugs in and changes between different engine versions */ - /* (for the latest engine version, these flags should always be "FALSE") */ - boolean use_change_when_pushing_bug; - boolean use_block_last_field_bug; - boolean max_num_changes_per_frame; - boolean use_reverse_scan_direction; - - /* variable within running game */ - int yamyam_content_nr; - boolean magic_wall_active; - int magic_wall_time_left; - int light_time_left; - int timegate_time_left; - int belt_dir[4]; - int belt_dir_nr[4]; - int switchgate_pos; - int wind_direction; - boolean gravity; - boolean explosions_delayed; - boolean envelope_active; - -#if 1 - /* values for the new EMC elements */ - int lenses_time_left; - int magnify_time_left; - boolean ball_state; - int ball_content_nr; -#endif - - /* values for player idle animation (no effect on engine) */ - int player_boring_delay_fixed; - 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 { char *autoplay_leveldir; @@ -2141,6 +1978,7 @@ struct ElementChangeInfo int actual_trigger_side; /* element side that triggered the change */ int actual_trigger_player; /* player which actually triggered change */ int actual_trigger_ce_value; /* CE value of element that triggered change */ + int actual_trigger_ce_score; /* CE score of element that triggered change */ boolean can_change_or_has_action; /* can_change | has_action */ @@ -2479,10 +2317,8 @@ extern int graphics_action_mapping[]; extern struct LevelSetInfo levelset; extern struct LevelInfo level, level_template; -extern struct PlayerInfo stored_player[], *local_player; extern struct HiScore highscore[]; extern struct TapeInfo tape; -extern struct GameInfo game; extern struct GlobalInfo global; extern struct MenuInfo menu; extern struct DoorInfo door_1, door_2;