From: Holger Schemel Date: Thu, 11 May 2017 21:22:41 +0000 (+0200) Subject: added configurable delay times for some MM style elements (MM engine) X-Git-Tag: 4.1.0.0~110 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=439166f2dc0f7462a6e75497d1ac03f9e96042c7;p=rocksndiamonds.git added configurable delay times for some MM style elements (MM engine) --- diff --git a/src/editor.c b/src/editor.c index 92b35d0f..c806313b 100644 --- a/src/editor.c +++ b/src/editor.c @@ -9114,6 +9114,10 @@ static void DrawPropertiesInfo() #define TEXT_CRACKING "Score for cracking" #define TEXT_AMOEBA_SPEED "Speed of amoeba growth" #define TEXT_DURATION "Duration when activated" +#define TEXT_DELAY_ON "Delay before activating" +#define TEXT_DELAY_OFF "Delay before deactivating" +#define TEXT_DELAY_EXPLODING "Delay before exploding" +#define TEXT_DELAY_MOVING "Delay before moving" #define TEXT_BALL_DELAY "Element generation delay" #define TEXT_MOVE_SPEED "Speed of android moving" #define TEXT_CLONE_SPEED "Speed of android cloning" @@ -9239,10 +9243,11 @@ static struct { EL_SPRING, &level.slurp_score, TEXT_SLURPING }, { EL_EMC_LENSES, &level.lenses_time, TEXT_DURATION }, { EL_EMC_MAGNIFIER, &level.magnify_time, TEXT_DURATION }, -#if 0 - /* defined, but currently not used in MM engine */ - { EL_MM_FUSE_ACTIVE, &level.mm_time_fuse, TEXT_DURATION }, -#endif + { EL_MM_FUSE_ACTIVE, &level.mm_time_fuse, TEXT_DELAY_OFF }, + { EL_MM_BOMB, &level.mm_time_bomb, TEXT_DELAY_EXPLODING }, + { EL_MM_GRAY_BALL, &level.mm_time_ball, TEXT_DELAY_ON }, + { EL_MM_STEEL_BLOCK, &level.mm_time_block, TEXT_DELAY_MOVING }, + { EL_MM_WOODEN_BLOCK, &level.mm_time_block, TEXT_DELAY_MOVING }, { -1, NULL, NULL } }; diff --git a/src/files.c b/src/files.c index d42a2cd5..1af36af6 100644 --- a/src/files.c +++ b/src/files.c @@ -839,9 +839,24 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = }, { - EL_MM_FUSE, -1, + EL_MM_FUSE_ACTIVE, -1, TYPE_INTEGER, CONF_VALUE_16_BIT(1), - &li.mm_time_fuse, 0 + &li.mm_time_fuse, 25 + }, + { + EL_MM_BOMB, -1, + TYPE_INTEGER, CONF_VALUE_16_BIT(1), + &li.mm_time_bomb, 75 + }, + { + EL_MM_GRAY_BALL, -1, + TYPE_INTEGER, CONF_VALUE_16_BIT(1), + &li.mm_time_ball, 75 + }, + { + EL_MM_STEEL_BLOCK, -1, + TYPE_INTEGER, CONF_VALUE_16_BIT(1), + &li.mm_time_block, 75 }, { EL_MM_LIGHTBALL, -1, @@ -3997,7 +4012,10 @@ void CopyNativeLevel_RND_to_MM(struct LevelInfo *level) level_mm->score[SC_ELEM_BONUS] = level->score[SC_ELEM_BONUS]; level_mm->amoeba_speed = level->amoeba_speed; - level_mm->time_fuse = level->mm_time_fuse; + level_mm->time_fuse = level->mm_time_fuse; + level_mm->time_bomb = level->mm_time_bomb; + level_mm->time_ball = level->mm_time_ball; + level_mm->time_block = level->mm_time_block; for (x = 0; x < level->fieldx; x++) for (y = 0; y < level->fieldy; y++) @@ -4033,8 +4051,11 @@ void CopyNativeLevel_MM_to_RND(struct LevelInfo *level) level->score[SC_TIME_BONUS] = level_mm->score[SC_TIME_BONUS]; level->score[SC_ELEM_BONUS] = level_mm->score[SC_ELEM_BONUS]; - level->amoeba_speed = level_mm->amoeba_speed; - level->mm_time_fuse = level_mm->time_fuse; + level->amoeba_speed = level_mm->amoeba_speed; + level->mm_time_fuse = level_mm->time_fuse; + level->mm_time_bomb = level_mm->time_bomb; + level->mm_time_ball = level_mm->time_ball; + level->mm_time_block = level_mm->time_block; for (x = 0; x < level->fieldx; x++) for (y = 0; y < level->fieldy; y++) diff --git a/src/game_mm/export.h b/src/game_mm/export.h index 31c01770..f48cd473 100644 --- a/src/game_mm/export.h +++ b/src/game_mm/export.h @@ -171,6 +171,9 @@ struct LevelInfo_MM int score[MM_LEVEL_SCORE_ELEMENTS]; int amoeba_speed; int time_fuse; + int time_bomb; + int time_ball; + int time_block; short field[MAX_PLAYFIELD_WIDTH][MAX_PLAYFIELD_HEIGHT]; }; diff --git a/src/game_mm/mm_files.c b/src/game_mm/mm_files.c index 0b88735e..1def7cc3 100644 --- a/src/game_mm/mm_files.c +++ b/src/game_mm/mm_files.c @@ -108,7 +108,10 @@ void setLevelInfoToDefaults_MM() native_mm_level.kettles_needed = 0; native_mm_level.auto_count_kettles = TRUE; native_mm_level.amoeba_speed = 0; - native_mm_level.time_fuse = 0; + native_mm_level.time_fuse = 25; + native_mm_level.time_bomb = 75; + native_mm_level.time_ball = 75; + native_mm_level.time_block = 75; native_mm_level.laser_red = FALSE; native_mm_level.laser_green = FALSE; native_mm_level.laser_blue = TRUE; @@ -182,6 +185,10 @@ static int LoadLevel_MM_HEAD(File *file, int chunk_size, level->amoeba_speed = getFile8Bit(file); level->time_fuse = getFile8Bit(file); + // fuse time was 0 and hardcoded in game engine in level files up to 2.0.x + if (level->file_version <= MM_FILE_VERSION_2_0) + level->time_fuse = 25; + laser_color = getFile8Bit(file); level->laser_red = (laser_color >> 2) & 0x01; level->laser_green = (laser_color >> 1) & 0x01; diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 1e6c3061..bb579712 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -3303,7 +3303,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) CT -= Ct; - if (element == EL_BOMB && CT > 75) + if (element == EL_BOMB && CT > native_mm_level.time_bomb) { if (game_mm.cheat_no_explosion) return; @@ -3341,7 +3341,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) return; } - if (element == EL_FUSE_ON && CT > 25) + if (element == EL_FUSE_ON && CT > native_mm_level.time_fuse) { laser.fuse_off = TRUE; laser.fuse_x = ELX; @@ -3351,7 +3351,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) DrawGraphic_MM(ELX, ELY, IMG_MM_FUSE); } - if (element == EL_BALL_GRAY && CT > 75) + if (element == EL_BALL_GRAY && CT > native_mm_level.time_ball) { static int new_elements[] = { @@ -3638,7 +3638,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode) } if ((element == EL_BLOCK_WOOD || element == EL_BLOCK_STONE) && - laser.stops_inside_element && CT > 75) + laser.stops_inside_element && CT > native_mm_level.time_block) { int x, y; int k; diff --git a/src/main.h b/src/main.h index da76f7df..d75c0ae1 100644 --- a/src/main.h +++ b/src/main.h @@ -3061,6 +3061,9 @@ struct LevelInfo boolean mm_laser_red, mm_laser_green, mm_laser_blue; boolean df_laser_red, df_laser_green, df_laser_blue; int mm_time_fuse; + int mm_time_bomb; + int mm_time_ball; + int mm_time_block; /* ('int' instead of 'boolean' because used as selectbox value in editor) */ int use_step_counter; /* count steps instead of seconds for level */