From 4eff89df72ffc45c4ad59fcd01860eb8f4179b9c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 12 Mar 2024 20:08:40 +0100 Subject: [PATCH] added support for amoeba settings in BD engine to level editor --- src/editor.c | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/files.c | 125 +++++++++++++++++++++++++++++++++++++++++ src/init.c | 1 + src/main.h | 17 ++++++ 4 files changed, 296 insertions(+), 2 deletions(-) diff --git a/src/editor.c b/src/editor.c index 10c26424..6e240560 100644 --- a/src/editor.c +++ b/src/editor.c @@ -556,6 +556,12 @@ enum GADGET_ID_MAGIC_BALL_CONTENT_7, GADGET_ID_ANDROID_CONTENT, GADGET_ID_AMOEBA_CONTENT, + GADGET_ID_BD_AMOEBA_CONTENT_TOO_BIG, + GADGET_ID_BD_AMOEBA_CONTENT_ENCLOSED, + GADGET_ID_BD_AMOEBA_2_CONTENT_TOO_BIG, + GADGET_ID_BD_AMOEBA_2_CONTENT_ENCLOSED, + GADGET_ID_BD_AMOEBA_2_CONTENT_EXPLODING, + GADGET_ID_BD_AMOEBA_2_CONTENT_LOOKS_LIKE, GADGET_ID_START_ELEMENT, GADGET_ID_ARTWORK_ELEMENT, GADGET_ID_EXPLOSION_ELEMENT, @@ -710,6 +716,9 @@ enum GADGET_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET, GADGET_ID_BD_MAGIC_WALL_WAIT_HATCHING, GADGET_ID_BD_MAGIC_WALL_STOPS_AMOEBA, + GADGET_ID_BD_AMOEBA_WAIT_FOR_HATCHING, + GADGET_ID_BD_AMOEBA_START_IMMEDIATELY, + GADGET_ID_BD_AMOEBA_2_EXPLODE_BY_AMOEBA, GADGET_ID_ENVELOPE_AUTOWRAP, GADGET_ID_ENVELOPE_CENTERED, GADGET_ID_MM_LASER_RED, @@ -1047,6 +1056,9 @@ enum 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_BD_AMOEBA_WAIT_FOR_HATCHING, + ED_CHECKBUTTON_ID_BD_AMOEBA_START_IMMEDIATELY, + ED_CHECKBUTTON_ID_BD_AMOEBA_2_EXPLODE_BY_AMOEBA, ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_CHECKBUTTON_ID_ENVELOPE_CENTERED, ED_CHECKBUTTON_ID_MM_LASER_RED, @@ -1142,6 +1154,12 @@ enum ED_DRAWING_ID_MAGIC_BALL_CONTENT_7, ED_DRAWING_ID_ANDROID_CONTENT, ED_DRAWING_ID_AMOEBA_CONTENT, + ED_DRAWING_ID_BD_AMOEBA_CONTENT_TOO_BIG, + ED_DRAWING_ID_BD_AMOEBA_CONTENT_ENCLOSED, + ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_TOO_BIG, + ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_ENCLOSED, + ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_EXPLODING, + ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_LOOKS_LIKE, ED_DRAWING_ID_START_ELEMENT, ED_DRAWING_ID_ARTWORK_ELEMENT, ED_DRAWING_ID_EXPLOSION_ELEMENT, @@ -3708,6 +3726,30 @@ static struct NULL, NULL, "turn amoeba to diamonds", "activation changes amoeba to diamonds" }, + { + ED_CHECKBUTTON_ID_BD_AMOEBA_WAIT_FOR_HATCHING, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), + GADGET_ID_BD_AMOEBA_WAIT_FOR_HATCHING, GADGET_ID_NONE, + &level.bd_amoeba_wait_for_hatching, + NULL, NULL, + "wait for player's birth", "timer start waits for player's birth" + }, + { + ED_CHECKBUTTON_ID_BD_AMOEBA_START_IMMEDIATELY, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), + GADGET_ID_BD_AMOEBA_START_IMMEDIATELY, GADGET_ID_NONE, + &level.bd_amoeba_start_immediately, + NULL, NULL, + "start growing immediately", "start slow growth time immediately" + }, + { + ED_CHECKBUTTON_ID_BD_AMOEBA_2_EXPLODE_BY_AMOEBA, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), + GADGET_ID_BD_AMOEBA_2_EXPLODE_BY_AMOEBA, GADGET_ID_NONE, + &level.bd_amoeba_2_explode_by_amoeba, + NULL, NULL, + "explodes if touched by amoeba", "amoeba 2 explodes if touched by amoeba" + }, { ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), @@ -4179,6 +4221,60 @@ static struct "content:", NULL, NULL, NULL, "amoeba content" }, + // ---------- BD amoeba content ------------------------------------------------ + + { + ED_DRAWING_ID_BD_AMOEBA_CONTENT_TOO_BIG, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(7), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_AMOEBA_CONTENT_TOO_BIG, GADGET_ID_NONE, + &level.bd_amoeba_content_too_big, 1, 1, + "if too big, changes to:", NULL, NULL, NULL, "BD amoeba content if too big" + }, + { + ED_DRAWING_ID_BD_AMOEBA_CONTENT_ENCLOSED, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(8), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_AMOEBA_CONTENT_ENCLOSED, GADGET_ID_NONE, + &level.bd_amoeba_content_enclosed, 1, 1, + "if enclosed, changes to:", NULL, NULL, NULL, "BD amoeba content if enclosed" + }, + + // ---------- BD amoeba 2 content ------------------------------------------------ + + { + ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_TOO_BIG, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(7), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_AMOEBA_2_CONTENT_TOO_BIG, GADGET_ID_NONE, + &level.bd_amoeba_2_content_too_big, 1, 1, + "if too big, changes to:", NULL, NULL, NULL, "BD amoeba 2 content if too big" + }, + { + ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_ENCLOSED, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(8), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_AMOEBA_2_CONTENT_ENCLOSED, GADGET_ID_NONE, + &level.bd_amoeba_2_content_enclosed, 1, 1, + "if enclosed, changes to:", NULL, NULL, NULL, "BD amoeba 2 content if enclosed" + }, + { + ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_EXPLODING, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(10), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_AMOEBA_2_CONTENT_EXPLODING, GADGET_ID_NONE, + &level.bd_amoeba_2_content_exploding, 1, 1, + "if exploding, changes to:", NULL, NULL, NULL, "BD amoeba 2 content if exploding" + }, + { + ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_LOOKS_LIKE, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(11), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_AMOEBA_2_CONTENT_LOOKS_LIKE, GADGET_ID_NONE, + &level.bd_amoeba_2_content_looks_like, 1, 1, + "use graphic of element:", NULL, NULL, NULL, "BD amoeba 2 looks like this element" + }, + // ---------- level start element ------------------------------------------- { @@ -10695,6 +10791,10 @@ static void DrawPropertiesInfo(void) #define TEXT_SLURPING "Score for slurping robot" #define TEXT_CRACKING "Score for cracking" #define TEXT_AMOEBA_SPEED "Speed of amoeba growth" +#define TEXT_AMOEBA_THRESHOED "Size for turning to rocks" +#define TEXT_AMOEBA_SLOW_TIME "Slow growth time (seconds)" +#define TEXT_AMOEBA_SLOW_RATE "Slow growth rate (percent)" +#define TEXT_AMOEBA_FAST_RATE "Fast growth rate (percent)" #define TEXT_DURATION "Duration when activated" #define TEXT_DELAY_ON "Delay before activating" #define TEXT_DELAY_OFF "Delay before deactivating" @@ -10797,6 +10897,14 @@ static struct { EL_AMOEBA_FULL, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, { EL_BD_AMOEBA, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, { EL_EMC_DRIPPER, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, + { EL_BD_AMOEBA, &level.bd_amoeba_threshold_too_big, TEXT_AMOEBA_THRESHOED }, + { EL_BD_AMOEBA, &level.bd_amoeba_slow_growth_time, TEXT_AMOEBA_SLOW_TIME }, + { EL_BD_AMOEBA, &level.bd_amoeba_slow_growth_rate, TEXT_AMOEBA_SLOW_RATE }, + { EL_BD_AMOEBA, &level.bd_amoeba_fast_growth_rate, TEXT_AMOEBA_FAST_RATE }, + { EL_BD_AMOEBA_2, &level.bd_amoeba_2_threshold_too_big, TEXT_AMOEBA_THRESHOED }, + { EL_BD_AMOEBA_2, &level.bd_amoeba_2_slow_growth_time, TEXT_AMOEBA_SLOW_TIME }, + { EL_BD_AMOEBA_2, &level.bd_amoeba_2_slow_growth_rate, TEXT_AMOEBA_SLOW_RATE }, + { EL_BD_AMOEBA_2, &level.bd_amoeba_2_fast_growth_rate, TEXT_AMOEBA_FAST_RATE }, { EL_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION }, { EL_BD_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION }, { EL_DC_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION }, @@ -10967,6 +11075,18 @@ static void DrawPropertiesConfig(void) level.game_engine_type != GAME_ENGINE_TYPE_BD) continue; + // special case: some amoeba counters only available in BD game engine + if (elements_with_counter[i].element == EL_BD_AMOEBA && + elements_with_counter[i].value != &level.amoeba_speed && + level.game_engine_type != GAME_ENGINE_TYPE_BD) + continue; + + // special case: some amoeba counters only available in R'n'D game engine + if (elements_with_counter[i].element == EL_BD_AMOEBA && + elements_with_counter[i].value == &level.amoeba_speed && + level.game_engine_type == GAME_ENGINE_TYPE_BD) + continue; + int counter_id = ED_COUNTER_ID_ELEMENT_VALUE1 + num_element_counters; counterbutton_info[counter_id].y = @@ -10978,6 +11098,12 @@ static void DrawPropertiesConfig(void) (properties_element == EL_EMC_MAGIC_BALL ? 2 : 0) + num_element_counters); + // special case: set amoeba counters for BD game engine separately + if ((properties_element == EL_BD_AMOEBA && level.game_engine_type == GAME_ENGINE_TYPE_BD) || + (properties_element == EL_BD_AMOEBA_2)) + counterbutton_info[counter_id].y = + ED_ELEMENT_SETTINGS_YPOS(3 + num_element_counters); + counterbutton_info[counter_id].value = elements_with_counter[i].value; counterbutton_info[counter_id].text_right = elements_with_counter[i].text; @@ -10987,6 +11113,12 @@ static void DrawPropertiesConfig(void) counterbutton_info[counter_id].min_value = 0; // min neighbours counterbutton_info[counter_id].max_value = 8; // max neighbours } + else if (strEqual(elements_with_counter[i].text, TEXT_AMOEBA_SLOW_RATE) || + strEqual(elements_with_counter[i].text, TEXT_AMOEBA_FAST_RATE)) + { + counterbutton_info[counter_id].min_value = 0; // min percent + counterbutton_info[counter_id].max_value = 100; // max percent + } else { // !!! CHANGE THIS FOR CERTAIN ELEMENTS !!! @@ -11007,7 +11139,26 @@ static void DrawPropertiesConfig(void) // draw stickybutton gadget MapCheckbuttonGadget(ED_CHECKBUTTON_ID_STICK_ELEMENT); - if (IS_AMOEBOID(properties_element)) + if (properties_element == EL_BD_AMOEBA && level.game_engine_type == GAME_ENGINE_TYPE_BD) + { + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_AMOEBA_WAIT_FOR_HATCHING); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_AMOEBA_START_IMMEDIATELY); + + MapDrawingArea(ED_DRAWING_ID_BD_AMOEBA_CONTENT_TOO_BIG); + MapDrawingArea(ED_DRAWING_ID_BD_AMOEBA_CONTENT_ENCLOSED); + } + else if (properties_element == EL_BD_AMOEBA_2) + { + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_AMOEBA_WAIT_FOR_HATCHING); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_AMOEBA_START_IMMEDIATELY); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_AMOEBA_2_EXPLODE_BY_AMOEBA); + + MapDrawingArea(ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_TOO_BIG); + MapDrawingArea(ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_ENCLOSED); + MapDrawingArea(ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_EXPLODING); + MapDrawingArea(ED_DRAWING_ID_BD_AMOEBA_2_CONTENT_LOOKS_LIKE); + } + else if (IS_AMOEBOID(properties_element)) MapDrawingArea(ED_DRAWING_ID_AMOEBA_CONTENT); else if (properties_element == EL_YAMYAM || properties_element == EL_YAMYAM_LEFT || @@ -11194,7 +11345,7 @@ static void DrawPropertiesConfig(void) properties_element == EL_BIOMAZE) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_LIFE_BUGS); - if (CAN_GROW(properties_element)) + if (CAN_GROW(properties_element) && level.game_engine_type != GAME_ENGINE_TYPE_BD) { checkbutton_info[ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE].y = ED_ELEMENT_SETTINGS_YPOS(HAS_EDITOR_CONTENT(properties_element) ? 1 : 0); diff --git a/src/files.c b/src/files.c index 2db82d00..35597a4d 100644 --- a/src/files.c +++ b/src/files.c @@ -602,6 +602,7 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = }, // (these values are only valid for BD style levels) + // (some values for BD style amoeba following below) { EL_BD_PLAYER, -1, TYPE_BOOLEAN, CONF_VALUE_8_BIT(1), @@ -707,6 +708,7 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = &li.score[SC_CRYSTAL], 10 }, + // (amoeba values used by R'n'D game engine only) { EL_BD_AMOEBA, -1, TYPE_ELEMENT, CONF_VALUE_16_BIT(1), @@ -722,6 +724,93 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_BOOLEAN, CONF_VALUE_8_BIT(1), &li.grow_into_diggable, TRUE }, + // (amoeba values used by BD game engine only) + { + EL_BD_AMOEBA, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(2), + &li.bd_amoeba_wait_for_hatching, FALSE + }, + { + EL_BD_AMOEBA, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(3), + &li.bd_amoeba_start_immediately, TRUE + }, + { + EL_BD_AMOEBA, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(4), + &li.bd_amoeba_2_explode_by_amoeba, TRUE + }, + { + EL_BD_AMOEBA, -1, + TYPE_INTEGER, CONF_VALUE_16_BIT(3), + &li.bd_amoeba_threshold_too_big, 200 + }, + { + EL_BD_AMOEBA, -1, + TYPE_INTEGER, CONF_VALUE_16_BIT(4), + &li.bd_amoeba_slow_growth_time, 200 + }, + { + EL_BD_AMOEBA, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(5), + &li.bd_amoeba_slow_growth_rate, 3 + }, + { + EL_BD_AMOEBA, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(6), + &li.bd_amoeba_fast_growth_rate, 25 + }, + { + EL_BD_AMOEBA, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(5), + &li.bd_amoeba_content_too_big, EL_BD_ROCK + }, + { + EL_BD_AMOEBA, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(6), + &li.bd_amoeba_content_enclosed, EL_BD_DIAMOND + }, + + { + EL_BD_AMOEBA_2, -1, + TYPE_INTEGER, CONF_VALUE_16_BIT(3), + &li.bd_amoeba_2_threshold_too_big, 200 + }, + { + EL_BD_AMOEBA_2, -1, + TYPE_INTEGER, CONF_VALUE_16_BIT(4), + &li.bd_amoeba_2_slow_growth_time, 200 + }, + { + EL_BD_AMOEBA_2, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(5), + &li.bd_amoeba_2_slow_growth_rate, 3 + }, + { + EL_BD_AMOEBA_2, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(6), + &li.bd_amoeba_2_fast_growth_rate, 25 + }, + { + EL_BD_AMOEBA_2, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(5), + &li.bd_amoeba_2_content_too_big, EL_BD_ROCK + }, + { + EL_BD_AMOEBA_2, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(6), + &li.bd_amoeba_2_content_enclosed, EL_BD_DIAMOND + }, + { + EL_BD_AMOEBA_2, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(7), + &li.bd_amoeba_2_content_exploding, EL_EMPTY + }, + { + EL_BD_AMOEBA_2, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(8), + &li.bd_amoeba_2_content_looks_like, EL_BD_AMOEBA_2 + }, { EL_YAMYAM, -1, @@ -3810,6 +3899,24 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) 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; + cave->amoeba_timer_wait_for_hatching = level->bd_amoeba_wait_for_hatching; + cave->amoeba_timer_started_immediately= level->bd_amoeba_start_immediately; + cave->amoeba_2_explodes_by_amoeba = level->bd_amoeba_2_explode_by_amoeba; + cave->level_amoeba_threshold[0] = level->bd_amoeba_threshold_too_big; + cave->level_amoeba_time[0] = level->bd_amoeba_slow_growth_time; + cave->amoeba_growth_prob = level->bd_amoeba_slow_growth_rate * 10000; + cave->amoeba_fast_growth_prob = level->bd_amoeba_fast_growth_rate * 10000; + cave->level_amoeba_2_threshold[0] = level->bd_amoeba_2_threshold_too_big; + cave->level_amoeba_2_time[0] = level->bd_amoeba_2_slow_growth_time; + cave->amoeba_2_growth_prob = level->bd_amoeba_2_slow_growth_rate * 10000; + cave->amoeba_2_fast_growth_prob = level->bd_amoeba_2_fast_growth_rate * 10000; + + cave->amoeba_too_big_effect = map_element_RND_to_BD(level->bd_amoeba_content_too_big); + cave->amoeba_enclosed_effect = map_element_RND_to_BD(level->bd_amoeba_content_enclosed); + cave->amoeba_2_too_big_effect = map_element_RND_to_BD(level->bd_amoeba_2_content_too_big); + cave->amoeba_2_enclosed_effect = map_element_RND_to_BD(level->bd_amoeba_2_content_enclosed); + cave->amoeba_2_explosion_effect = map_element_RND_to_BD(level->bd_amoeba_2_content_exploding); + cave->amoeba_2_looks_like = map_element_RND_to_BD(level->bd_amoeba_2_content_looks_like); // level name strncpy(cave->name, level->name, sizeof(GdString)); @@ -3868,6 +3975,24 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) 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->bd_amoeba_wait_for_hatching = cave->amoeba_timer_wait_for_hatching; + level->bd_amoeba_start_immediately = cave->amoeba_timer_started_immediately; + level->bd_amoeba_2_explode_by_amoeba = cave->amoeba_2_explodes_by_amoeba; + level->bd_amoeba_threshold_too_big = cave->level_amoeba_threshold[0]; + level->bd_amoeba_slow_growth_time = cave->level_amoeba_time[0]; + level->bd_amoeba_slow_growth_rate = cave->amoeba_growth_prob / 10000; + level->bd_amoeba_fast_growth_rate = cave->amoeba_fast_growth_prob / 10000; + level->bd_amoeba_2_threshold_too_big = cave->level_amoeba_2_threshold[0]; + level->bd_amoeba_2_slow_growth_time = cave->level_amoeba_2_time[0]; + level->bd_amoeba_2_slow_growth_rate = cave->amoeba_2_growth_prob / 10000; + level->bd_amoeba_2_fast_growth_rate = cave->amoeba_2_fast_growth_prob / 10000; + + level->bd_amoeba_content_too_big = map_element_BD_to_RND(cave->amoeba_too_big_effect); + level->bd_amoeba_content_enclosed = map_element_BD_to_RND(cave->amoeba_enclosed_effect); + level->bd_amoeba_2_content_too_big = map_element_BD_to_RND(cave->amoeba_2_too_big_effect); + level->bd_amoeba_2_content_enclosed = map_element_BD_to_RND(cave->amoeba_2_enclosed_effect); + level->bd_amoeba_2_content_exploding = map_element_BD_to_RND(cave->amoeba_2_explosion_effect); + level->bd_amoeba_2_content_looks_like = map_element_BD_to_RND(cave->amoeba_2_looks_like); // level name char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1); diff --git a/src/init.c b/src/init.c index f2e78ede..f53022f7 100644 --- a/src/init.c +++ b/src/init.c @@ -4278,6 +4278,7 @@ void InitElementPropertiesStatic(void) EL_AMOEBA_DRY, EL_AMOEBA_FULL, EL_BD_AMOEBA, + EL_BD_AMOEBA_2, EL_EMC_MAGIC_BALL, EL_EMC_ANDROID, EL_MM_GRAY_BALL, diff --git a/src/main.h b/src/main.h index 5d03cb54..999c24a7 100644 --- a/src/main.h +++ b/src/main.h @@ -3498,6 +3498,23 @@ struct LevelInfo 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 bd_amoeba_wait_for_hatching; // BD amoeba waits for player's birth + boolean bd_amoeba_start_immediately; // BD amoeba growth starts immediately + boolean bd_amoeba_2_explode_by_amoeba;// BD amoeba 2 explodes if touched by BD amoeba + int bd_amoeba_threshold_too_big; // BD amoeba turns to stones if threshold reached + int bd_amoeba_slow_growth_time; // BD amoeba slow growth time (in seconds) + int bd_amoeba_slow_growth_rate; // BD amoeba slow growth rate (in percent) + int bd_amoeba_fast_growth_rate; // BD amoeba fast growth rate (in percent) + int bd_amoeba_content_too_big; // BD amoeba changes to this element if too big + int bd_amoeba_content_enclosed; // BD amoeba changes to this element if enclosed + int bd_amoeba_2_threshold_too_big; // BD amoeba 2 turns to stones if threshold reached + int bd_amoeba_2_slow_growth_time; // BD amoeba 2 slow growth time (in seconds) + int bd_amoeba_2_slow_growth_rate; // BD amoeba 2 slow growth rate (in percent) + int bd_amoeba_2_fast_growth_rate; // BD amoeba 2 fast growth rate (in percent) + int bd_amoeba_2_content_too_big; // BD amoeba 2 changes to this element if too big + int bd_amoeba_2_content_enclosed; // BD amoeba 2 changes to this element if enclosed + int bd_amoeba_2_content_exploding; // BD amoeba 2 changes to this element if exploding + int bd_amoeba_2_content_looks_like; // BD amoeba 2 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 boolean use_spring_bug; // for compatibility with old levels -- 2.34.1