From dc9fe7359bd0b8dea49f46b9fb2e59f006200a63 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 23 Mar 2024 14:43:55 +0100 Subject: [PATCH] added "effects" game elements for native BD engine to level editor --- src/editor.c | 148 +++++++++++++++++++++++++++++++++++++++++++ src/files.c | 6 ++ src/init.c | 2 + src/libgame/system.h | 2 + src/main.c | 10 +++ src/main.h | 74 +++++++++++----------- 6 files changed, 206 insertions(+), 36 deletions(-) diff --git a/src/editor.c b/src/editor.c index fd5d5463..721f4afe 100644 --- a/src/editor.c +++ b/src/editor.c @@ -4924,6 +4924,141 @@ static int *editor_el_boulderdash_native_ptr = editor_el_boulderdash_native; static int num_editor_hl_boulderdash_native = ARRAY_SIZE(editor_hl_boulderdash_native); static int num_editor_el_boulderdash_native = ARRAY_SIZE(editor_el_boulderdash_native); +static int editor_hl_boulderdash_effects[] = +{ + EL_INTERNAL_CASCADE_BD_EFFECTS_ACTIVE, + EL_CHAR('B'), + EL_CHAR('D'), + EL_CHAR('E'), +}; + +static int editor_el_boulderdash_effects[] = +{ + EL_BD_DIAMOND_FALLING, + EL_BD_ROCK_FALLING, + EL_BD_MEGA_ROCK_FALLING, + EL_BD_FLYING_DIAMOND_FLYING, + + EL_BD_FLYING_ROCK_FLYING, + EL_BD_FALLING_WALL_FALLING, + EL_BD_NITRO_PACK_FALLING, + EL_BD_NUT_FALLING, + + EL_BD_PLAYER_GROWING_1, + EL_BD_PLAYER_GROWING_2, + EL_BD_PLAYER_GROWING_3, + EL_BD_PLAYER, + + EL_BD_PLAYER_WITH_BOMB, + EL_BD_PLAYER_STIRRING, + EL_BD_EXIT_OPEN, + EL_BD_INVISIBLE_EXIT_OPEN, + + EL_BD_BLADDER_1, + EL_BD_BLADDER_2, + EL_BD_BLADDER_3, + EL_BD_BLADDER_4, + + EL_BD_BLADDER_5, + EL_BD_BLADDER_6, + EL_BD_BLADDER_7, + EL_BD_BLADDER_8, + + EL_BD_SAND_2, + EL_BD_COW_ENCLOSED_1, + EL_BD_COW_ENCLOSED_2, + EL_BD_COW_ENCLOSED_3, + + EL_BD_COW_ENCLOSED_4, + EL_BD_COW_ENCLOSED_5, + EL_BD_COW_ENCLOSED_6, + EL_BD_COW_ENCLOSED_7, + + EL_BD_WATER_1, + EL_BD_WATER_2, + EL_BD_WATER_3, + EL_BD_WATER_4, + + EL_BD_WATER_5, + EL_BD_WATER_6, + EL_BD_WATER_7, + EL_BD_WATER_8, + + EL_BD_WATER_9, + EL_BD_WATER_10, + EL_BD_WATER_11, + EL_BD_WATER_12, + + EL_BD_WATER_13, + EL_BD_WATER_14, + EL_BD_WATER_15, + EL_BD_WATER_16, + + EL_BD_BOMB_TICKING_1, + EL_BD_BOMB_TICKING_2, + EL_BD_BOMB_TICKING_3, + EL_BD_BOMB_TICKING_4, + + EL_BD_BOMB_TICKING_5, + EL_BD_BOMB_TICKING_6, + EL_BD_BOMB_TICKING_7, + EL_EMPTY, + + EL_BD_BOMB_EXPLODING_1, + EL_BD_BOMB_EXPLODING_2, + EL_BD_BOMB_EXPLODING_3, + EL_BD_BOMB_EXPLODING_4, + + EL_BD_NUT_BREAKING_1, + EL_BD_NUT_BREAKING_2, + EL_BD_NUT_BREAKING_3, + EL_BD_NUT_BREAKING_4, + + EL_BD_EXPLODING_1, + EL_BD_EXPLODING_2, + EL_BD_EXPLODING_3, + EL_BD_EXPLODING_4, + + EL_BD_EXPLODING_5, + EL_BD_TIME_PENALTY, + EL_BD_DIAMOND_GROWING_1, + EL_BD_DIAMOND_GROWING_2, + + EL_BD_DIAMOND_GROWING_3, + EL_BD_DIAMOND_GROWING_4, + EL_BD_DIAMOND_GROWING_5, + EL_BD_NITRO_PACK_EXPLODING, + + EL_BD_NITRO_PACK_EXPLODING_1, + EL_BD_NITRO_PACK_EXPLODING_2, + EL_BD_NITRO_PACK_EXPLODING_3, + EL_BD_NITRO_PACK_EXPLODING_4, + + EL_BD_ROCK_GROWING_1, + EL_BD_ROCK_GROWING_2, + EL_BD_ROCK_GROWING_3, + EL_BD_ROCK_GROWING_4, + + EL_BD_STEELWALL_GROWING_1, + EL_BD_STEELWALL_GROWING_2, + EL_BD_STEELWALL_GROWING_3, + EL_BD_STEELWALL_GROWING_4, + + EL_BD_CLOCK_GROWING_1, + EL_BD_CLOCK_GROWING_2, + EL_BD_CLOCK_GROWING_3, + EL_BD_CLOCK_GROWING_4, + + EL_BD_GHOST_EXPLODING_1, + EL_BD_GHOST_EXPLODING_2, + EL_BD_GHOST_EXPLODING_3, + EL_BD_GHOST_EXPLODING_4, +}; +static int *editor_hl_boulderdash_effects_ptr = editor_hl_boulderdash_effects; +static int *editor_el_boulderdash_effects_ptr = editor_el_boulderdash_effects; +static int num_editor_hl_boulderdash_effects = ARRAY_SIZE(editor_hl_boulderdash_effects); +static int num_editor_el_boulderdash_effects = ARRAY_SIZE(editor_el_boulderdash_effects); + static int editor_hl_emerald_mine[] = { EL_INTERNAL_CASCADE_EM_ACTIVE, @@ -6335,6 +6470,7 @@ static boolean setup_editor_cascade_never = FALSE; static boolean setup_editor_el_players = TRUE; static boolean setup_editor_el_boulderdash = TRUE; static boolean setup_editor_el_boulderdash_native = TRUE; +static boolean setup_editor_el_boulderdash_effects = TRUE; static boolean setup_editor_el_emerald_mine = TRUE; static boolean setup_editor_el_emerald_mine_club = TRUE; static boolean setup_editor_el_more = TRUE; @@ -6387,6 +6523,12 @@ editor_elements_info[] = &editor_hl_boulderdash_native_ptr, &num_editor_hl_boulderdash_native, &editor_el_boulderdash_native_ptr, &num_editor_el_boulderdash_native }, + { + &setup_editor_el_boulderdash_effects, + &setup.editor_cascade.el_bd_effects, + &editor_hl_boulderdash_effects_ptr, &num_editor_hl_boulderdash_effects, + &editor_el_boulderdash_effects_ptr, &num_editor_el_boulderdash_effects + }, { &setup_editor_el_emerald_mine, &setup.editor_cascade.el_em, @@ -6687,6 +6829,7 @@ static void ReinitializeElementList_EnableSections(void) setup_editor_el_players = TRUE; setup_editor_el_boulderdash = TRUE; setup_editor_el_boulderdash_native = TRUE; + setup_editor_el_boulderdash_effects = TRUE; setup_editor_el_emerald_mine = TRUE; setup_editor_el_emerald_mine_club = TRUE; setup_editor_el_more = TRUE; @@ -6710,6 +6853,7 @@ static void ReinitializeElementList_EnableSections(void) setup_editor_el_players = FALSE; setup_editor_el_boulderdash = FALSE; setup_editor_el_boulderdash_native = FALSE; + setup_editor_el_boulderdash_effects = FALSE; setup_editor_el_emerald_mine = FALSE; setup_editor_el_emerald_mine_club = FALSE; setup_editor_el_more = FALSE; @@ -6741,6 +6885,7 @@ static void ReinitializeElementList_EnableSections(void) if (level.game_engine_type == GAME_ENGINE_TYPE_RND) { setup_editor_el_boulderdash_native = FALSE; + setup_editor_el_boulderdash_effects = FALSE; setup_editor_el_mirror_magic = FALSE; setup_editor_el_deflektor = FALSE; } @@ -6766,6 +6911,7 @@ static void ReinitializeElementList_EnableSections(void) { setup_editor_el_boulderdash = FALSE; setup_editor_el_boulderdash_native = FALSE; + setup_editor_el_boulderdash_effects = FALSE; setup_editor_el_more = FALSE; setup_editor_el_sokoban = FALSE; setup_editor_el_supaplex = FALSE; @@ -6782,6 +6928,7 @@ static void ReinitializeElementList_EnableSections(void) setup_editor_el_players = FALSE; setup_editor_el_boulderdash = FALSE; setup_editor_el_boulderdash_native = FALSE; + setup_editor_el_boulderdash_effects = FALSE; setup_editor_el_emerald_mine = FALSE; setup_editor_el_emerald_mine_club = FALSE; setup_editor_el_more = FALSE; @@ -6800,6 +6947,7 @@ static void ReinitializeElementList_EnableSections(void) setup_editor_el_players = FALSE; setup_editor_el_boulderdash = FALSE; setup_editor_el_boulderdash_native = FALSE; + setup_editor_el_boulderdash_effects = FALSE; setup_editor_el_emerald_mine = FALSE; setup_editor_el_emerald_mine_club = FALSE; setup_editor_el_more = FALSE; diff --git a/src/files.c b/src/files.c index 3e6d25f3..8197672a 100644 --- a/src/files.c +++ b/src/files.c @@ -10532,6 +10532,10 @@ static struct TokenInfo editor_cascade_setup_tokens[] = TYPE_SWITCH, &setup.editor_cascade.el_bd_native, "editor.cascade.el_bd_native" }, + { + TYPE_SWITCH, + &setup.editor_cascade.el_bd_effects, "editor.cascade.el_bd_effects" + }, { TYPE_SWITCH, &setup.editor_cascade.el_em, "editor.cascade.el_em" @@ -11226,6 +11230,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->editor.el_boulderdash = TRUE; si->editor.el_boulderdash_native = TRUE; + si->editor.el_boulderdash_effects = TRUE; si->editor.el_emerald_mine = TRUE; si->editor.el_emerald_mine_club = TRUE; si->editor.el_more = TRUE; @@ -11400,6 +11405,7 @@ static void setSetupInfoToDefaults_EditorCascade(struct SetupInfo *si) { si->editor_cascade.el_bd = TRUE; si->editor_cascade.el_bd_native = TRUE; + si->editor_cascade.el_bd_effects = FALSE; si->editor_cascade.el_em = TRUE; si->editor_cascade.el_emc = TRUE; si->editor_cascade.el_rnd = TRUE; diff --git a/src/init.c b/src/init.c index 0233351e..28d8aae2 100644 --- a/src/init.c +++ b/src/init.c @@ -4582,6 +4582,7 @@ void InitElementPropertiesStatic(void) { EL_INTERNAL_CASCADE_BD_ACTIVE, EL_INTERNAL_CASCADE_BD_NATIVE_ACTIVE, + EL_INTERNAL_CASCADE_BD_EFFECTS_ACTIVE, EL_INTERNAL_CASCADE_EM_ACTIVE, EL_INTERNAL_CASCADE_EMC_ACTIVE, EL_INTERNAL_CASCADE_RND_ACTIVE, @@ -4607,6 +4608,7 @@ void InitElementPropertiesStatic(void) { EL_INTERNAL_CASCADE_BD, EL_INTERNAL_CASCADE_BD_NATIVE, + EL_INTERNAL_CASCADE_BD_EFFECTS, EL_INTERNAL_CASCADE_EM, EL_INTERNAL_CASCADE_EMC, EL_INTERNAL_CASCADE_RND, diff --git a/src/libgame/system.h b/src/libgame/system.h index cc17c730..d4999b46 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1290,6 +1290,7 @@ struct SetupEditorInfo { boolean el_boulderdash; boolean el_boulderdash_native; + boolean el_boulderdash_effects; boolean el_emerald_mine; boolean el_emerald_mine_club; boolean el_more; @@ -1335,6 +1336,7 @@ struct SetupEditorCascadeInfo { boolean el_bd; boolean el_bd_native; + boolean el_bd_effects; boolean el_em; boolean el_emc; boolean el_rnd; diff --git a/src/main.c b/src/main.c index 783ecf42..b9967e30 100644 --- a/src/main.c +++ b/src/main.c @@ -8383,6 +8383,16 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "internal", "Hide native Boulder Dash elements" }, + { + "internal_cascade_bd_effects", + "internal", + "Show Boulder Dash effect elements" + }, + { + "internal_cascade_bd_effects.active", + "internal", + "Hide Boulder Dash effect elements" + }, { "internal_cascade_em", "internal", diff --git a/src/main.h b/src/main.h index f9836d97..3b735c4c 100644 --- a/src/main.h +++ b/src/main.h @@ -2438,47 +2438,49 @@ #define EL_INTERNAL_CASCADE_BD_ACTIVE (EL_FIRST_INTERNAL + 5) #define EL_INTERNAL_CASCADE_BD_NATIVE (EL_FIRST_INTERNAL + 6) #define EL_INTERNAL_CASCADE_BD_NATIVE_ACTIVE (EL_FIRST_INTERNAL + 7) -#define EL_INTERNAL_CASCADE_EM (EL_FIRST_INTERNAL + 8) -#define EL_INTERNAL_CASCADE_EM_ACTIVE (EL_FIRST_INTERNAL + 9) -#define EL_INTERNAL_CASCADE_EMC (EL_FIRST_INTERNAL + 10) -#define EL_INTERNAL_CASCADE_EMC_ACTIVE (EL_FIRST_INTERNAL + 11) -#define EL_INTERNAL_CASCADE_RND (EL_FIRST_INTERNAL + 12) -#define EL_INTERNAL_CASCADE_RND_ACTIVE (EL_FIRST_INTERNAL + 13) -#define EL_INTERNAL_CASCADE_SB (EL_FIRST_INTERNAL + 14) -#define EL_INTERNAL_CASCADE_SB_ACTIVE (EL_FIRST_INTERNAL + 15) -#define EL_INTERNAL_CASCADE_SP (EL_FIRST_INTERNAL + 16) -#define EL_INTERNAL_CASCADE_SP_ACTIVE (EL_FIRST_INTERNAL + 17) -#define EL_INTERNAL_CASCADE_DC (EL_FIRST_INTERNAL + 18) -#define EL_INTERNAL_CASCADE_DC_ACTIVE (EL_FIRST_INTERNAL + 19) -#define EL_INTERNAL_CASCADE_DX (EL_FIRST_INTERNAL + 20) -#define EL_INTERNAL_CASCADE_DX_ACTIVE (EL_FIRST_INTERNAL + 21) -#define EL_INTERNAL_CASCADE_MM (EL_FIRST_INTERNAL + 22) -#define EL_INTERNAL_CASCADE_MM_ACTIVE (EL_FIRST_INTERNAL + 23) -#define EL_INTERNAL_CASCADE_DF (EL_FIRST_INTERNAL + 24) -#define EL_INTERNAL_CASCADE_DF_ACTIVE (EL_FIRST_INTERNAL + 25) -#define EL_INTERNAL_CASCADE_CHARS (EL_FIRST_INTERNAL + 26) -#define EL_INTERNAL_CASCADE_CHARS_ACTIVE (EL_FIRST_INTERNAL + 27) -#define EL_INTERNAL_CASCADE_STEEL_CHARS (EL_FIRST_INTERNAL + 28) -#define EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE (EL_FIRST_INTERNAL + 29) -#define EL_INTERNAL_CASCADE_CE (EL_FIRST_INTERNAL + 30) -#define EL_INTERNAL_CASCADE_CE_ACTIVE (EL_FIRST_INTERNAL + 31) -#define EL_INTERNAL_CASCADE_GE (EL_FIRST_INTERNAL + 32) -#define EL_INTERNAL_CASCADE_GE_ACTIVE (EL_FIRST_INTERNAL + 33) -#define EL_INTERNAL_CASCADE_ES (EL_FIRST_INTERNAL + 34) -#define EL_INTERNAL_CASCADE_ES_ACTIVE (EL_FIRST_INTERNAL + 35) -#define EL_INTERNAL_CASCADE_REF (EL_FIRST_INTERNAL + 36) -#define EL_INTERNAL_CASCADE_REF_ACTIVE (EL_FIRST_INTERNAL + 37) -#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 38) -#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 39) -#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 40) -#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 41) +#define EL_INTERNAL_CASCADE_BD_EFFECTS (EL_FIRST_INTERNAL + 8) +#define EL_INTERNAL_CASCADE_BD_EFFECTS_ACTIVE (EL_FIRST_INTERNAL + 9) +#define EL_INTERNAL_CASCADE_EM (EL_FIRST_INTERNAL + 10) +#define EL_INTERNAL_CASCADE_EM_ACTIVE (EL_FIRST_INTERNAL + 11) +#define EL_INTERNAL_CASCADE_EMC (EL_FIRST_INTERNAL + 12) +#define EL_INTERNAL_CASCADE_EMC_ACTIVE (EL_FIRST_INTERNAL + 13) +#define EL_INTERNAL_CASCADE_RND (EL_FIRST_INTERNAL + 14) +#define EL_INTERNAL_CASCADE_RND_ACTIVE (EL_FIRST_INTERNAL + 15) +#define EL_INTERNAL_CASCADE_SB (EL_FIRST_INTERNAL + 16) +#define EL_INTERNAL_CASCADE_SB_ACTIVE (EL_FIRST_INTERNAL + 17) +#define EL_INTERNAL_CASCADE_SP (EL_FIRST_INTERNAL + 18) +#define EL_INTERNAL_CASCADE_SP_ACTIVE (EL_FIRST_INTERNAL + 19) +#define EL_INTERNAL_CASCADE_DC (EL_FIRST_INTERNAL + 20) +#define EL_INTERNAL_CASCADE_DC_ACTIVE (EL_FIRST_INTERNAL + 21) +#define EL_INTERNAL_CASCADE_DX (EL_FIRST_INTERNAL + 22) +#define EL_INTERNAL_CASCADE_DX_ACTIVE (EL_FIRST_INTERNAL + 23) +#define EL_INTERNAL_CASCADE_MM (EL_FIRST_INTERNAL + 24) +#define EL_INTERNAL_CASCADE_MM_ACTIVE (EL_FIRST_INTERNAL + 25) +#define EL_INTERNAL_CASCADE_DF (EL_FIRST_INTERNAL + 26) +#define EL_INTERNAL_CASCADE_DF_ACTIVE (EL_FIRST_INTERNAL + 27) +#define EL_INTERNAL_CASCADE_CHARS (EL_FIRST_INTERNAL + 28) +#define EL_INTERNAL_CASCADE_CHARS_ACTIVE (EL_FIRST_INTERNAL + 29) +#define EL_INTERNAL_CASCADE_STEEL_CHARS (EL_FIRST_INTERNAL + 30) +#define EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE (EL_FIRST_INTERNAL + 31) +#define EL_INTERNAL_CASCADE_CE (EL_FIRST_INTERNAL + 32) +#define EL_INTERNAL_CASCADE_CE_ACTIVE (EL_FIRST_INTERNAL + 33) +#define EL_INTERNAL_CASCADE_GE (EL_FIRST_INTERNAL + 34) +#define EL_INTERNAL_CASCADE_GE_ACTIVE (EL_FIRST_INTERNAL + 35) +#define EL_INTERNAL_CASCADE_ES (EL_FIRST_INTERNAL + 36) +#define EL_INTERNAL_CASCADE_ES_ACTIVE (EL_FIRST_INTERNAL + 37) +#define EL_INTERNAL_CASCADE_REF (EL_FIRST_INTERNAL + 38) +#define EL_INTERNAL_CASCADE_REF_ACTIVE (EL_FIRST_INTERNAL + 39) +#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 40) +#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 41) +#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 42) +#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 43) #define EL_INTERNAL_CLIPBOARD_START (EL_FIRST_INTERNAL + 0) #define EL_INTERNAL_CLIPBOARD_END (EL_FIRST_INTERNAL + 2) #define EL_INTERNAL_START (EL_FIRST_INTERNAL + 0) -#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 41) +#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 43) -#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 42) +#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 44) // values for graphics/sounds action types -- 2.34.1