From: Holger Schemel Date: Sun, 24 Mar 2024 23:12:14 +0000 (+0100) Subject: added support for sand (dirt) settings in BD engine to level editor X-Git-Tag: 4.4.0.0-test-1~139 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=afbad74c77ab1a2cac76b0ce8f633da50a8f52ab;p=rocksndiamonds.git added support for sand (dirt) settings in BD engine to level editor --- diff --git a/src/editor.c b/src/editor.c index a09e20ac..73d2c36f 100644 --- a/src/editor.c +++ b/src/editor.c @@ -582,6 +582,7 @@ enum GADGET_ID_BD_BLADDER_CONVERTS_BY_ELEMENT, GADGET_ID_BD_NUT_CONTENT, GADGET_ID_BD_EXPANDING_WALL_LOOKS_LIKE, + GADGET_ID_BD_SAND_LOOKS_LIKE, GADGET_ID_START_ELEMENT, GADGET_ID_ARTWORK_ELEMENT, GADGET_ID_EXPLOSION_ELEMENT, @@ -1222,6 +1223,7 @@ enum ED_DRAWING_ID_BD_BLADDER_CONVERTS_BY_ELEMENT, ED_DRAWING_ID_BD_NUT_CONTENT, ED_DRAWING_ID_BD_EXPANDING_WALL_LOOKS_LIKE, + ED_DRAWING_ID_BD_SAND_LOOKS_LIKE, ED_DRAWING_ID_START_ELEMENT, ED_DRAWING_ID_ARTWORK_ELEMENT, ED_DRAWING_ID_EXPLOSION_ELEMENT, @@ -4590,6 +4592,14 @@ static struct &level.bd_expanding_wall_looks_like, 1, 1, "Use graphic of element:", NULL, NULL, NULL, "Expanding wall looks like this element" }, + { + ED_DRAWING_ID_BD_SAND_LOOKS_LIKE, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(0), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_SAND_LOOKS_LIKE, GADGET_ID_NONE, + &level.bd_sand_looks_like, 1, 1, + "Use graphic of element:", NULL, NULL, NULL, "Sand looks like this element" + }, // ---------- level start element ------------------------------------------- @@ -11518,6 +11528,7 @@ static boolean checkPropertiesConfig(int element) CAN_GROW(element) || COULD_MOVE_INTO_ACID(element) || MAYBE_DONT_COLLIDE_WITH(element) || + element == EL_BD_SAND || element == EL_BD_ROCK || element == EL_BD_MEGA_ROCK || element == EL_BD_SWEET || @@ -11855,6 +11866,11 @@ static void DrawPropertiesConfig(void) MapDrawingArea(ED_DRAWING_ID_BD_SNAP_ELEMENT); } + if (properties_element == EL_BD_SAND) + { + MapDrawingArea(ED_DRAWING_ID_BD_SAND_LOOKS_LIKE); + } + if (properties_element == EL_BD_ROCK && level.game_engine_type == GAME_ENGINE_TYPE_BD) { counterbutton_info[ED_COUNTER_ID_BD_PUSHING_PROB].y = diff --git a/src/files.c b/src/files.c index 4e70f9ef..1f01d8bb 100644 --- a/src/files.c +++ b/src/files.c @@ -879,6 +879,12 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = &li.bd_skeleton_worth_num_diamonds, 0 }, + { + EL_BD_SAND, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(1), + &li.bd_sand_looks_like, EL_BD_SAND + }, + // (the following values are related to various game elements) { @@ -4209,6 +4215,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->skeletons_worth_diamonds = level->bd_skeleton_worth_num_diamonds; cave->expanding_wall_looks_like = map_element_RND_to_BD_cave(level->bd_expanding_wall_looks_like); + cave->dirt_looks_like = map_element_RND_to_BD_cave(level->bd_sand_looks_like); // level name strncpy(cave->name, level->name, sizeof(GdString)); @@ -4344,6 +4351,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_skeleton_worth_num_diamonds = cave->skeletons_worth_diamonds; level->bd_expanding_wall_looks_like = map_element_BD_to_RND_cave(cave->expanding_wall_looks_like); + level->bd_sand_looks_like = map_element_BD_to_RND_cave(cave->dirt_looks_like); // 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 6ec00ec1..2481f3da 100644 --- a/src/main.h +++ b/src/main.h @@ -3683,6 +3683,7 @@ struct LevelInfo int bd_num_skeletons_needed_for_pot; // BD skeletons amount must be collected to use a pot int bd_skeleton_worth_num_diamonds; // BD skeleton collected is worth this number of diamonds int bd_expanding_wall_looks_like; // BD expanding wall looks like this other game element + int bd_sand_looks_like; // BD sand looks like this other game element boolean em_slippery_gems; // EM style "gems slip from wall" behaviour boolean em_explodes_by_fire; // EM style chain explosion behaviour