From c50ed169cbd9ea0a7ed120a2f6dc0042a84e104a Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 11 Mar 2024 23:35:46 +0100 Subject: [PATCH] added support for magic wall settings in BD engine to level editor --- src/editor.c | 26 ++++++++++++++++++++++++++ src/files.c | 15 +++++++++++++++ src/main.h | 2 ++ 3 files changed, 43 insertions(+) diff --git a/src/editor.c b/src/editor.c index 9dbe4982..10c26424 100644 --- a/src/editor.c +++ b/src/editor.c @@ -708,6 +708,8 @@ enum GADGET_ID_BD_DIAGONAL_MOVEMENTS, GADGET_ID_BD_TOPMOST_PLAYER_ACTIVE, GADGET_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET, + GADGET_ID_BD_MAGIC_WALL_WAIT_HATCHING, + GADGET_ID_BD_MAGIC_WALL_STOPS_AMOEBA, GADGET_ID_ENVELOPE_AUTOWRAP, GADGET_ID_ENVELOPE_CENTERED, GADGET_ID_MM_LASER_RED, @@ -1043,6 +1045,8 @@ enum ED_CHECKBUTTON_ID_BD_DIAGONAL_MOVEMENTS, ED_CHECKBUTTON_ID_BD_TOPMOST_PLAYER_ACTIVE, ED_CHECKBUTTON_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET, + ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING, + ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA, ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_CHECKBUTTON_ID_ENVELOPE_CENTERED, ED_CHECKBUTTON_ID_MM_LASER_RED, @@ -3688,6 +3692,22 @@ static struct NULL, NULL, "mega rocks pushable with sweet", "push mega rocks after eating sweet" }, + { + ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), + GADGET_ID_BD_MAGIC_WALL_WAIT_HATCHING, GADGET_ID_NONE, + &level.bd_magic_wall_wait_hatching, + NULL, NULL, + "wait for player's birth", "timer start waits for player's birth" + }, + { + ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), + GADGET_ID_BD_MAGIC_WALL_STOPS_AMOEBA, GADGET_ID_NONE, + &level.bd_magic_wall_stops_amoeba, + NULL, NULL, + "turn amoeba to diamonds", "activation changes amoeba to diamonds" + }, { ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), @@ -11130,6 +11150,12 @@ static void DrawPropertiesConfig(void) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET); } + if (properties_element == EL_BD_MAGIC_WALL) + { + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA); + } + // special case: slippery walls option for gems only available in R'n'D game engine if (IS_GEM(properties_element) && level.game_engine_type == GAME_ENGINE_TYPE_RND) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS); diff --git a/src/files.c b/src/files.c index 87ad27a9..2db82d00 100644 --- a/src/files.c +++ b/src/files.c @@ -634,6 +634,17 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = &li.score[SC_DIAMOND_EXTRA], 20 }, + { + EL_BD_MAGIC_WALL, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(1), + &li.bd_magic_wall_wait_hatching, FALSE + }, + { + EL_BD_MAGIC_WALL, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(2), + &li.bd_magic_wall_stops_amoeba, TRUE + }, + // (the following values are related to various game elements) { @@ -3797,6 +3808,8 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) // element properties cave->level_magic_wall_time[0] = level->time_magic_wall; + cave->magic_timer_wait_for_hatching = level->bd_magic_wall_wait_hatching; + cave->magic_wall_stops_amoeba = level->bd_magic_wall_stops_amoeba; // level name strncpy(cave->name, level->name, sizeof(GdString)); @@ -3853,6 +3866,8 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) // element properties level->time_magic_wall = cave->level_magic_wall_time[bd_level_nr]; + level->bd_magic_wall_wait_hatching = cave->magic_timer_wait_for_hatching; + level->bd_magic_wall_stops_amoeba = cave->magic_wall_stops_amoeba; // level name char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1); diff --git a/src/main.h b/src/main.h index 31e926fe..5d03cb54 100644 --- a/src/main.h +++ b/src/main.h @@ -3496,6 +3496,8 @@ struct LevelInfo int bd_pushing_prob; // BD player probability to push rocks int bd_pushing_prob_with_sweet; // BD player probability to push rocks after eating sweet boolean bd_push_mega_rock_with_sweet; // BD player can push mega rocks after eating sweet + boolean bd_magic_wall_wait_hatching; // BD magic wall waits for player's birth + boolean bd_magic_wall_stops_amoeba; // BD magic wall turns amoeba to diamonds boolean em_slippery_gems; // EM style "gems slip from wall" behaviour boolean em_explodes_by_fire; // EM style chain explosion behaviour boolean use_spring_bug; // for compatibility with old levels -- 2.34.1