From: Holger Schemel Date: Sun, 17 Mar 2024 00:05:56 +0000 (+0100) Subject: added support for snap element in BD engine to level editor X-Git-Tag: 4.4.0.0-test-1~179 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=724645813eb504ac837f045a76ffd604db11aa5c;p=rocksndiamonds.git added support for snap element in BD engine to level editor --- diff --git a/src/editor.c b/src/editor.c index 6ca4145f..0a682af5 100644 --- a/src/editor.c +++ b/src/editor.c @@ -556,6 +556,7 @@ enum GADGET_ID_MAGIC_BALL_CONTENT_7, GADGET_ID_ANDROID_CONTENT, GADGET_ID_AMOEBA_CONTENT, + GADGET_ID_BD_SNAP_ELEMENT, GADGET_ID_BD_AMOEBA_CONTENT_TOO_BIG, GADGET_ID_BD_AMOEBA_CONTENT_ENCLOSED, GADGET_ID_BD_AMOEBA_2_CONTENT_TOO_BIG, @@ -1162,6 +1163,7 @@ enum ED_DRAWING_ID_MAGIC_BALL_CONTENT_7, ED_DRAWING_ID_ANDROID_CONTENT, ED_DRAWING_ID_AMOEBA_CONTENT, + ED_DRAWING_ID_BD_SNAP_ELEMENT, ED_DRAWING_ID_BD_AMOEBA_CONTENT_TOO_BIG, ED_DRAWING_ID_BD_AMOEBA_CONTENT_ENCLOSED, ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_TOO_BIG, @@ -4261,7 +4263,18 @@ static struct "content:", NULL, NULL, NULL, "amoeba content" }, - // ---------- BD amoeba content ------------------------------------------------ + // ---------- BD snap element ----------------------------------------------- + + { + ED_DRAWING_ID_BD_SNAP_ELEMENT, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(5), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_SNAP_ELEMENT, GADGET_ID_NONE, + &level.bd_snap_element, 1, 1, + "snap element:", NULL, NULL, NULL, "element created when snapping" + }, + + // ---------- BD amoeba content --------------------------------------------- { ED_DRAWING_ID_BD_AMOEBA_CONTENT_TOO_BIG, @@ -4280,7 +4293,7 @@ static struct "if enclosed, changes to:", NULL, NULL, NULL, "BD amoeba content if enclosed" }, - // ---------- BD amoeba 2 content ------------------------------------------------ + // ---------- BD amoeba 2 content ------------------------------------------- { ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_TOO_BIG, @@ -11291,6 +11304,9 @@ static void DrawPropertiesConfig(void) // draw counter gadgets MapCounterButtons(ED_COUNTER_ID_BD_PUSHING_PROB); MapCounterButtons(ED_COUNTER_ID_BD_PUSHING_PROB_WITH_SWEET); + + // draw drawing area gadgets + MapDrawingArea(ED_DRAWING_ID_BD_SNAP_ELEMENT); } if (properties_element == EL_BD_ROCK && level.game_engine_type == GAME_ENGINE_TYPE_BD) diff --git a/src/files.c b/src/files.c index b4c2d7e4..6bc53e56 100644 --- a/src/files.c +++ b/src/files.c @@ -628,6 +628,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_BOOLEAN, CONF_VALUE_8_BIT(5), &li.bd_push_mega_rock_with_sweet, FALSE }, + { + EL_BD_PLAYER, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(6), + &li.bd_snap_element, EL_EMPTY + }, { EL_BD_DIAMOND, -1, @@ -3927,6 +3932,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->pushing_stone_prob = level->bd_pushing_prob * 10000; cave->pushing_stone_prob_sweet = level->bd_pushing_prob_with_sweet * 10000; cave->mega_stones_pushable_with_sweet = level->bd_push_mega_rock_with_sweet; + cave->snap_element = map_element_RND_to_BD(level->bd_snap_element); // element properties cave->level_bonus_time[0] = level->bd_clock_extra_time; @@ -4009,6 +4015,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_pushing_prob = cave->pushing_stone_prob / 10000; level->bd_pushing_prob_with_sweet = cave->pushing_stone_prob_sweet / 10000; level->bd_push_mega_rock_with_sweet = cave->mega_stones_pushable_with_sweet; + level->bd_snap_element = map_element_BD_to_RND(cave->snap_element); // element properties level->bd_clock_extra_time = cave->level_bonus_time[0]; diff --git a/src/main.h b/src/main.h index 9abb886a..d650a5f7 100644 --- a/src/main.h +++ b/src/main.h @@ -3493,6 +3493,7 @@ struct LevelInfo boolean bd_intermission; // BD level is intermission boolean bd_diagonal_movements; // BD style diagonal movements boolean bd_topmost_player_active; // BD engine uses first player found on playfield + int bd_snap_element; // BD element that is created when player is snapping 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