From: Holger Schemel Date: Tue, 5 Nov 2024 18:05:34 +0000 (+0100) Subject: added level editor option for buggy BD style conveyor belts X-Git-Tag: 4.4.0.0-test-4~84 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3ddaeee8afe076d678c7f677dd1fd49164bafcf1;p=rocksndiamonds.git added level editor option for buggy BD style conveyor belts This makes the change from the last commit optional in the level editor, deactivating it for existing levels in GDash formats (and therefore also replays), so neither existing levels (caves) nor tapes (replays) will be broken anymore by that change. For newly created levels in R'n'D format, however, this change will be activated by default, using the new, fixed conveyor belt behavior. --- diff --git a/src/editor.c b/src/editor.c index 332abb54..97e77f6a 100644 --- a/src/editor.c +++ b/src/editor.c @@ -867,6 +867,7 @@ enum GADGET_ID_BD_REPLICATORS_ACTIVE, GADGET_ID_BD_CONVEYOR_BELTS_ACTIVE, GADGET_ID_BD_CONVEYOR_BELTS_CHANGED, + GADGET_ID_BD_CONVEYOR_BELTS_BUGGY, GADGET_ID_BD_WATER_CANNOT_FLOW_DOWN, GADGET_ID_BD_HAMMER_WALLS_REAPPEAR, GADGET_ID_BD_INFINITE_ROCKETS, @@ -1268,6 +1269,7 @@ enum ED_CHECKBUTTON_ID_BD_REPLICATORS_ACTIVE, ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_ACTIVE, ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_CHANGED, + ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_BUGGY, ED_CHECKBUTTON_ID_BD_WATER_CANNOT_FLOW_DOWN, ED_CHECKBUTTON_ID_BD_HAMMER_WALLS_REAPPEAR, ED_CHECKBUTTON_ID_BD_INFINITE_ROCKETS, @@ -4396,6 +4398,14 @@ static struct NULL, NULL, "Change direction", "Switch conveyor belt direction" }, + { + ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_BUGGY, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), + GADGET_ID_BD_CONVEYOR_BELTS_BUGGY, GADGET_ID_NONE, + &level.bd_conveyor_belts_buggy, + NULL, NULL, + "Use buggy conveyor belts", "Bumpy pushing rocks on belt from left" + }, { ED_CHECKBUTTON_ID_BD_WATER_CANNOT_FLOW_DOWN, ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), @@ -13167,6 +13177,7 @@ static void DrawPropertiesConfig(void) { MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_ACTIVE); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_CHANGED); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_BUGGY); } if (properties_element == EL_BDX_WATER) diff --git a/src/files.c b/src/files.c index 886be93d..e73fe238 100644 --- a/src/files.c +++ b/src/files.c @@ -987,6 +987,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_BOOLEAN, CONF_VALUE_8_BIT(2), &li.bd_conveyor_belts_changed, FALSE }, + { + EL_BDX_CONVEYOR_LEFT, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(3), + &li.bd_conveyor_belts_buggy, FALSE + }, { EL_BDX_WATER, -1, @@ -4427,6 +4432,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->conveyor_belts_active = level->bd_conveyor_belts_active; cave->conveyor_belts_direction_changed= level->bd_conveyor_belts_changed; + cave->conveyor_belts_buggy = level->bd_conveyor_belts_buggy; cave->water_does_not_flow_down = level->bd_water_cannot_flow_down; @@ -4614,6 +4620,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_conveyor_belts_active = cave->conveyor_belts_active; level->bd_conveyor_belts_changed = cave->conveyor_belts_direction_changed; + level->bd_conveyor_belts_buggy = cave->conveyor_belts_buggy; level->bd_water_cannot_flow_down = cave->water_does_not_flow_down; diff --git a/src/game_bd/bd_cave.h b/src/game_bd/bd_cave.h index cc412d00..3c3bc74d 100644 --- a/src/game_bd/bd_cave.h +++ b/src/game_bd/bd_cave.h @@ -496,6 +496,7 @@ typedef struct _gd_cave boolean conveyor_belts_active; boolean conveyor_belts_direction_changed; + boolean conveyor_belts_buggy; // use old, buggy conveyor belt behavior // effects GdElement explosion_effect; // explosion converts to this element after its last stage. diff --git a/src/game_bd/bd_cavedb.c b/src/game_bd/bd_cavedb.c index 263809c1..c1b5cb93 100644 --- a/src/game_bd/bd_cavedb.c +++ b/src/game_bd/bd_cavedb.c @@ -2720,6 +2720,11 @@ const GdStructDescriptor gd_cave_properties[] = N_("Direction changed"), CAVE_OFFSET(conveyor_belts_direction_changed), 1, N_("If the conveyor belts' movement is changed, ie. they are running in the opposite direction. As you can freely use left and right going versions of the conveyor belt in a cave, it is not recommended to change this setting, rather you should select the correct one from the element box when drawing.") }, + { + "ConveyorBelt.buggy", GD_TYPE_BOOLEAN, 0, + N_("Buggy conveyor belt"), CAVE_OFFSET(conveyor_belts_buggy), 1, + N_("If it is true, pushing an object onto an active (going right) conveyor belt from the left side results in that object immediately jumping another tile to the right before moving further on the conveyor belt. Otherwise, the conveyor belt works as expected, and objects being pushed onto it from the left side move normally.") + }, // water { @@ -3215,6 +3220,7 @@ GdPropertyDefault gd_cave_defaults_gdash[] = // conveyor belt { CAVE_OFFSET(conveyor_belts_active), TRUE }, { CAVE_OFFSET(conveyor_belts_direction_changed), FALSE }, + { CAVE_OFFSET(conveyor_belts_buggy), TRUE }, // slime { CAVE_OFFSET(slime_predictable), TRUE }, diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 107441d5..b4c9219e 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -3680,8 +3680,9 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, int old_x = getx(cave, raw_x, raw_y); int old_y = gety(cave, raw_x, raw_y); - // only move game element if not already moving in that direction - if (game_bd.game->dir_buffer_to[old_y][old_x] != move_dir) + // only move game element if not already moving in that direction (or if buggy) + if (game_bd.game->dir_buffer_to[old_y][old_x] != move_dir || + cave->conveyor_belts_buggy) { store_dir(cave, x, y, GD_MV_UP, O_SPACE); // place a space ... store_dir(cave, old_x, old_y, move_dir, tile); // and move element. @@ -3714,8 +3715,9 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, int old_x = getx(cave, raw_x, raw_y); int old_y = gety(cave, raw_x, raw_y); - // only move game element if not already moving in that direction - if (game_bd.game->dir_buffer_to[old_y][old_x] != move_dir) + // only move game element if not already moving in that direction (or if buggy) + if (game_bd.game->dir_buffer_to[old_y][old_x] != move_dir || + cave->conveyor_belts_buggy) { store_dir(cave, x, y, GD_MV_DOWN, O_SPACE); // place a space ... store_dir(cave, old_x, old_y, move_dir, tile); // and move element. diff --git a/src/main.h b/src/main.h index b4b5eeaf..e09fd304 100644 --- a/src/main.h +++ b/src/main.h @@ -3876,6 +3876,7 @@ struct LevelInfo int bd_replicator_create_delay; // BD replicator delay between replications (in BD frames) boolean bd_conveyor_belts_active; // BD conveyor belts start in active state if enabled boolean bd_conveyor_belts_changed; // BD conveyor belts direction is changed if enabled + boolean bd_conveyor_belts_buggy; // BD conveyor belts setting to implement buggy behaviour boolean bd_water_cannot_flow_down; // BD water does not flow downwards if enabled int bd_nut_content; // BD nut contains the specified game element int bd_hammer_walls_break_delay; // BD hammer time for breaking walls (in BD frames)