From 2382d7155d6c54e7fa9c961473a44deafe8f9a55 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 24 Mar 2024 21:28:34 +0100 Subject: [PATCH] added support for skeleton settings in BD engine to level editor --- src/editor.c | 6 ++++++ src/files.c | 17 +++++++++++++++++ src/main.h | 2 ++ 3 files changed, 25 insertions(+) diff --git a/src/editor.c b/src/editor.c index 092ecac0..b5bfa272 100644 --- a/src/editor.c +++ b/src/editor.c @@ -11299,6 +11299,8 @@ static void DrawPropertiesInfo(void) #define TEXT_REPLICATION_DELAY "Create delay (BD frames)" #define TEXT_HAMMER_BREAK_DELAY "Delay for breaking walls" #define TEXT_HAMMER_REAPPEAR_DELAY "Delay for reappearing walls" +#define TEXT_SKELETONS_NEEDED "Amount needed to use a pot" +#define TEXT_SKELETONS_WORTH "Counts as this many diamonds" static struct { @@ -11439,6 +11441,10 @@ static struct 1, 100 }, { EL_BD_PNEUMATIC_HAMMER, &level.bd_hammer_walls_reappear_delay, TEXT_HAMMER_REAPPEAR_DELAY, 1, 200 }, + { EL_BD_SKELETON, &level.bd_num_skeletons_needed_for_pot, TEXT_SKELETONS_NEEDED, + 0, 50 }, + { EL_BD_SKELETON, &level.bd_skeleton_worth_num_diamonds, TEXT_SKELETONS_WORTH, + 0, 10 }, { EL_EXTRA_TIME, &level.extra_time, TEXT_TIME_BONUS }, { EL_TIME_ORB_FULL, &level.time_orb_time, TEXT_TIME_BONUS }, { EL_GAME_OF_LIFE, &level.game_of_life[0], TEXT_GAME_OF_LIFE_1,0,8 }, diff --git a/src/files.c b/src/files.c index 6831c112..628f577e 100644 --- a/src/files.c +++ b/src/files.c @@ -863,6 +863,17 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = &li.bd_hammer_walls_reappear_delay, 100 }, + { + EL_BD_SKELETON, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(1), + &li.bd_num_skeletons_needed_for_pot, 5 + }, + { + EL_BD_SKELETON, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(2), + &li.bd_skeleton_worth_num_diamonds, 0 + }, + // (the following values are related to various game elements) { @@ -4189,6 +4200,9 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->hammered_walls_reappear = level->bd_hammer_walls_reappear; cave->hammered_wall_reappear_frame = level->bd_hammer_walls_reappear_delay; + cave->skeletons_needed_for_pot = level->bd_num_skeletons_needed_for_pot; + cave->skeletons_worth_diamonds = level->bd_skeleton_worth_num_diamonds; + // level name strncpy(cave->name, level->name, sizeof(GdString)); cave->name[sizeof(GdString) - 1] = '\0'; @@ -4319,6 +4333,9 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_hammer_walls_reappear = cave->hammered_walls_reappear; level->bd_hammer_walls_reappear_delay = cave->hammered_wall_reappear_frame; + level->bd_num_skeletons_needed_for_pot= cave->skeletons_needed_for_pot; + level->bd_skeleton_worth_num_diamonds = cave->skeletons_worth_diamonds; + // 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 e89e2d1f..1abf844f 100644 --- a/src/main.h +++ b/src/main.h @@ -3679,6 +3679,8 @@ struct LevelInfo int bd_hammer_walls_break_delay; // BD hammer time for breaking walls (in BD frames) boolean bd_hammer_walls_reappear; // BD hammered walls are reappearing after some delay int bd_hammer_walls_reappear_delay; // BD hammer time for reappearing walls (in BD frames) + 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 boolean em_slippery_gems; // EM style "gems slip from wall" behaviour boolean em_explodes_by_fire; // EM style chain explosion behaviour -- 2.34.1