From: Holger Schemel Date: Tue, 2 Apr 2024 08:43:47 +0000 (+0200) Subject: added option for magic wall timer of zero for native BD engine X-Git-Tag: 4.4.0.0-test-1~114 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ee96a7b4c9e63388cf63ede2d935af2c427db5a9;p=rocksndiamonds.git added option for magic wall timer of zero for native BD engine --- diff --git a/src/editor.c b/src/editor.c index 54ef18b8..a91aba1d 100644 --- a/src/editor.c +++ b/src/editor.c @@ -749,6 +749,7 @@ enum GADGET_ID_BD_DIAGONAL_MOVEMENTS, GADGET_ID_BD_TOPMOST_PLAYER_ACTIVE, GADGET_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET, + GADGET_ID_BD_MAGIC_WALL_ZERO_INFINITE, GADGET_ID_BD_MAGIC_WALL_WAIT_HATCHING, GADGET_ID_BD_MAGIC_WALL_STOPS_AMOEBA, GADGET_ID_BD_AMOEBA_WAIT_FOR_HATCHING, @@ -1105,6 +1106,7 @@ enum ED_CHECKBUTTON_ID_BD_DIAGONAL_MOVEMENTS, ED_CHECKBUTTON_ID_BD_TOPMOST_PLAYER_ACTIVE, ED_CHECKBUTTON_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET, + ED_CHECKBUTTON_ID_BD_MAGIC_WALL_ZERO_INFINITE, ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING, ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA, ED_CHECKBUTTON_ID_BD_AMOEBA_WAIT_FOR_HATCHING, @@ -3824,8 +3826,16 @@ static struct "Mega rocks pushable with sweet", "Push mega rocks after eating sweet" }, { - ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING, + ED_CHECKBUTTON_ID_BD_MAGIC_WALL_ZERO_INFINITE, ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), + GADGET_ID_BD_MAGIC_WALL_ZERO_INFINITE, GADGET_ID_NONE, + &level.bd_magic_wall_zero_infinite, + NULL, NULL, + "Run forever if duration is zero", "Run infinitely if timer is zero" + }, + { + ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_BD_MAGIC_WALL_WAIT_HATCHING, GADGET_ID_NONE, &level.bd_magic_wall_wait_hatching, NULL, NULL, @@ -3833,7 +3843,7 @@ static struct }, { ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA, - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4), GADGET_ID_BD_MAGIC_WALL_STOPS_AMOEBA, GADGET_ID_NONE, &level.bd_magic_wall_stops_amoeba, NULL, NULL, @@ -4477,7 +4487,7 @@ static struct { ED_DRAWING_ID_BD_MAGIC_WALL_DIAMOND_TO, - ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(4), + 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_MAGIC_WALL_DIAMOND_TO, GADGET_ID_NONE, &level.bd_magic_wall_diamond_to, 1, 1, @@ -4485,7 +4495,7 @@ static struct }, { ED_DRAWING_ID_BD_MAGIC_WALL_ROCK_TO, - ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(5), + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(6), ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, GADGET_ID_BD_MAGIC_WALL_ROCK_TO, GADGET_ID_NONE, &level.bd_magic_wall_rock_to, 1, 1, @@ -4493,7 +4503,7 @@ static struct }, { ED_DRAWING_ID_BD_MAGIC_WALL_MEGA_ROCK_TO, - ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(6), + 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_MAGIC_WALL_MEGA_ROCK_TO, GADGET_ID_NONE, &level.bd_magic_wall_mega_rock_to, 1, 1, @@ -4501,7 +4511,7 @@ static struct }, { ED_DRAWING_ID_BD_MAGIC_WALL_NUT_TO, - ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(7), + 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_MAGIC_WALL_NUT_TO, GADGET_ID_NONE, &level.bd_magic_wall_nut_to, 1, 1, @@ -4509,7 +4519,7 @@ static struct }, { ED_DRAWING_ID_BD_MAGIC_WALL_NITRO_PACK_TO, - ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(8), + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(9), ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, GADGET_ID_BD_MAGIC_WALL_NITRO_PACK_TO, GADGET_ID_NONE, &level.bd_magic_wall_nitro_pack_to, 1, 1, @@ -4517,7 +4527,7 @@ static struct }, { ED_DRAWING_ID_BD_MAGIC_WALL_FLYING_DIAMOND_TO, - ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(9), + 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_MAGIC_WALL_FLYING_DIAMOND_TO, GADGET_ID_NONE, &level.bd_magic_wall_flying_diamond_to, 1, 1, @@ -4525,7 +4535,7 @@ static struct }, { ED_DRAWING_ID_BD_MAGIC_WALL_FLYING_ROCK_TO, - ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(10), + 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_MAGIC_WALL_FLYING_ROCK_TO, GADGET_ID_NONE, &level.bd_magic_wall_flying_rock_to, 1, 1, @@ -11925,6 +11935,7 @@ static void DrawPropertiesConfig(void) // draw stickybutton gadget MapCheckbuttonGadget(ED_CHECKBUTTON_ID_STICK_ELEMENT); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_MAGIC_WALL_ZERO_INFINITE); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_MAGIC_WALL_STOPS_AMOEBA); diff --git a/src/files.c b/src/files.c index cf353286..25943b63 100644 --- a/src/files.c +++ b/src/files.c @@ -737,6 +737,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_BOOLEAN, CONF_VALUE_8_BIT(2), &li.bd_magic_wall_stops_amoeba, TRUE }, + { + EL_BD_MAGIC_WALL, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(3), + &li.bd_magic_wall_zero_infinite, TRUE + }, { EL_BD_MAGIC_WALL, -1, TYPE_ELEMENT, CONF_VALUE_16_BIT(1), @@ -4264,6 +4269,7 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->voodoo_disappear_in_explosion = level->bd_voodoo_vanish_by_explosion; cave->level_penalty_time[0] = level->bd_voodoo_penalty_time; cave->level_magic_wall_time[0] = level->time_magic_wall; + cave->magic_timer_zero_is_infinite = level->bd_magic_wall_zero_infinite; cave->magic_timer_wait_for_hatching = level->bd_magic_wall_wait_hatching; cave->magic_wall_stops_amoeba = level->bd_magic_wall_stops_amoeba; @@ -4427,6 +4433,7 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_voodoo_vanish_by_explosion = cave->voodoo_disappear_in_explosion; level->bd_voodoo_penalty_time = cave->level_penalty_time[bd_level_nr]; level->time_magic_wall = cave->level_magic_wall_time[bd_level_nr]; + level->bd_magic_wall_zero_infinite = cave->magic_timer_zero_is_infinite; level->bd_magic_wall_wait_hatching = cave->magic_timer_wait_for_hatching; level->bd_magic_wall_stops_amoeba = cave->magic_wall_stops_amoeba; diff --git a/src/game_bd/bd_c64import.c b/src/game_bd/bd_c64import.c index 8ff3e183..61486da7 100644 --- a/src/game_bd/bd_c64import.c +++ b/src/game_bd/bd_c64import.c @@ -221,6 +221,7 @@ GdPropertyDefault gd_defaults_bd1[] = {CAVE_OFFSET(intermission_instantlife), TRUE}, {CAVE_OFFSET(intermission_rewardlife), FALSE}, {CAVE_OFFSET(magic_wall_stops_amoeba), TRUE}, + {CAVE_OFFSET(magic_timer_zero_is_infinite), TRUE}, {CAVE_OFFSET(magic_timer_wait_for_hatching), FALSE}, {CAVE_OFFSET(pushing_stone_prob), 250000}, {CAVE_OFFSET(pushing_stone_prob_sweet), 1000000}, @@ -257,6 +258,7 @@ GdPropertyDefault gd_defaults_bd2[] = {CAVE_OFFSET(intermission_instantlife), TRUE}, {CAVE_OFFSET(intermission_rewardlife), FALSE}, {CAVE_OFFSET(magic_wall_stops_amoeba), FALSE}, // marek roth bd inside faq 3.0 + {CAVE_OFFSET(magic_timer_zero_is_infinite), TRUE}, {CAVE_OFFSET(magic_timer_wait_for_hatching), FALSE}, {CAVE_OFFSET(pushing_stone_prob), 250000}, {CAVE_OFFSET(pushing_stone_prob_sweet), 1000000}, @@ -293,6 +295,7 @@ GdPropertyDefault gd_defaults_plck[] = {CAVE_OFFSET(intermission_instantlife), TRUE}, {CAVE_OFFSET(intermission_rewardlife), FALSE}, {CAVE_OFFSET(magic_wall_stops_amoeba), FALSE}, + {CAVE_OFFSET(magic_timer_zero_is_infinite), TRUE}, {CAVE_OFFSET(magic_timer_wait_for_hatching), FALSE}, {CAVE_OFFSET(pushing_stone_prob), 250000}, {CAVE_OFFSET(pushing_stone_prob_sweet), 1000000}, @@ -323,6 +326,7 @@ GdPropertyDefault gd_defaults_1stb[] = {CAVE_OFFSET(level_hatching_delay_time[0]), 2}, {CAVE_OFFSET(intermission_instantlife), FALSE}, {CAVE_OFFSET(intermission_rewardlife), TRUE}, + {CAVE_OFFSET(magic_timer_zero_is_infinite), TRUE}, {CAVE_OFFSET(magic_timer_wait_for_hatching), TRUE}, {CAVE_OFFSET(pushing_stone_prob), 250000}, {CAVE_OFFSET(pushing_stone_prob_sweet), 1000000}, @@ -356,6 +360,7 @@ GdPropertyDefault gd_defaults_crdr_7[] = {CAVE_OFFSET(level_hatching_delay_time[0]), 2}, {CAVE_OFFSET(intermission_instantlife), FALSE}, {CAVE_OFFSET(intermission_rewardlife), TRUE}, + {CAVE_OFFSET(magic_timer_zero_is_infinite), FALSE}, {CAVE_OFFSET(magic_timer_wait_for_hatching), TRUE}, {CAVE_OFFSET(pushing_stone_prob), 250000}, {CAVE_OFFSET(pushing_stone_prob_sweet), 1000000}, @@ -391,6 +396,7 @@ GdPropertyDefault gd_defaults_crli[] = {CAVE_OFFSET(level_hatching_delay_time[0]), 2}, {CAVE_OFFSET(intermission_instantlife), FALSE}, {CAVE_OFFSET(intermission_rewardlife), TRUE}, + {CAVE_OFFSET(magic_timer_zero_is_infinite), FALSE}, {CAVE_OFFSET(magic_timer_wait_for_hatching), TRUE}, {CAVE_OFFSET(pushing_stone_prob), 250000}, {CAVE_OFFSET(pushing_stone_prob_sweet), 1000000}, diff --git a/src/game_bd/bd_cave.h b/src/game_bd/bd_cave.h index b1ec47f3..d8f45591 100644 --- a/src/game_bd/bd_cave.h +++ b/src/game_bd/bd_cave.h @@ -394,6 +394,7 @@ typedef struct _gd_cave int level_magic_wall_time[5]; // magic wall 'on' state for each level (seconds) boolean magic_wall_stops_amoeba; // Turning on magic wall changes amoeba to diamonds. // Original BD: yes, constkit: no + boolean magic_timer_zero_is_infinite; // magic wall timer 0 is interpreted as infinite boolean magic_timer_wait_for_hatching;// magic wall timer does not start before player's birth boolean magic_wall_sound; // magic wall has sound diff --git a/src/game_bd/bd_cavedb.c b/src/game_bd/bd_cavedb.c index 34084767..b54eff89 100644 --- a/src/game_bd/bd_cavedb.c +++ b/src/game_bd/bd_cavedb.c @@ -547,6 +547,7 @@ const GdStructDescriptor gd_cave_properties[] = {"", GD_TAB, 0, N_("Magic Wall")}, {"", GD_LABEL, GD_SHOW_LEVEL_LABEL, N_("Timing")}, {"MagicWallTime", GD_TYPE_INT, 0, N_("Milling time (s)"), CAVE_OFFSET(level_magic_wall_time), 5, N_("Magic wall will stop after this time, and it cannot be activated again."), 0, 999}, + {"MagicWallProperties.zeroisinfinite", GD_TYPE_BOOLEAN, 0, N_("Milling time 0 is infinite"), CAVE_OFFSET(magic_timer_zero_is_infinite), 1, N_("This determines if the magic wall timer 0 is interpreted as infinite.")}, {"MagicWallProperties.waitforhatching", GD_TYPE_BOOLEAN, 0, N_("Timer waits for hatching"), CAVE_OFFSET(magic_timer_wait_for_hatching), 1, N_("This determines if the magic wall timer starts before the player appearing. Magic can always be activated before that; but if this is set to true, the timer will not start.")}, {"MagicWallProperties.convertamoeba", GD_TYPE_BOOLEAN, 0, N_("Stops amoeba"), CAVE_OFFSET(magic_wall_stops_amoeba), 1, N_("When the magic wall is activated, it can convert amoeba into diamonds.")}, {"", GD_LABEL, 0, N_("Conversions")}, @@ -796,6 +797,7 @@ GdPropertyDefault gd_cave_defaults_gdash[] = {CAVE_OFFSET(magic_flying_stone_to), O_FLYING_DIAMOND_F}, {CAVE_OFFSET(magic_flying_diamond_to), O_FLYING_STONE_F}, {CAVE_OFFSET(magic_wall_stops_amoeba), TRUE}, + {CAVE_OFFSET(magic_timer_zero_is_infinite), TRUE}, {CAVE_OFFSET(magic_timer_wait_for_hatching), FALSE}, // amoeba diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index e95236ce..46c97e57 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -3713,7 +3713,8 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, // magic wall; if active&wait or not wait for hatching if (cave->magic_wall_state == GD_MW_ACTIVE && - (cave->hatched || !cave->magic_timer_wait_for_hatching)) + (cave->hatched || !cave->magic_timer_wait_for_hatching) && + !(cave->magic_wall_time == 0 && cave->magic_timer_zero_is_infinite)) { cave->magic_wall_time -= cave->speed; if (cave->magic_wall_time < 0) diff --git a/src/main.h b/src/main.h index 04b6021a..4472b912 100644 --- a/src/main.h +++ b/src/main.h @@ -3662,6 +3662,7 @@ struct LevelInfo 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 + boolean bd_magic_wall_zero_infinite; // BD magic wall with timer of zero runs infinitely boolean bd_magic_wall_wait_hatching; // BD magic wall waits for player's birth boolean bd_magic_wall_stops_amoeba; // BD magic wall can stop amoeba and turn to diamonds int bd_magic_wall_diamond_to; // BD magic wall turns diamonds to specified element