From: Holger Schemel Date: Sat, 16 Mar 2024 23:43:18 +0000 (+0100) Subject: added support for voodoo doll settings in BD engine to level editor X-Git-Tag: 4.4.0.0-test-1~180 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=920245393de0eb51c7d3cba43b81ec2f5abbcd5c;p=rocksndiamonds.git added support for voodoo doll settings in BD engine to level editor --- diff --git a/src/editor.c b/src/editor.c index 9f917b43..6ca4145f 100644 --- a/src/editor.c +++ b/src/editor.c @@ -719,6 +719,10 @@ enum GADGET_ID_BD_AMOEBA_WAIT_FOR_HATCHING, GADGET_ID_BD_AMOEBA_START_IMMEDIATELY, GADGET_ID_BD_AMOEBA_2_EXPLODE_BY_AMOEBA, + GADGET_ID_BD_VOODOO_COLLECTS_DIAMONDS, + GADGET_ID_BD_VOODOO_HURT_KILLS_PLAYER, + GADGET_ID_BD_VOODOO_DIES_BY_ROCK, + GADGET_ID_BD_VOODOO_VANISH_BY_EXPLOSION, GADGET_ID_ENVELOPE_AUTOWRAP, GADGET_ID_ENVELOPE_CENTERED, GADGET_ID_MM_LASER_RED, @@ -1059,6 +1063,10 @@ enum 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_BD_VOODOO_COLLECTS_DIAMONDS, + ED_CHECKBUTTON_ID_BD_VOODOO_HURT_KILLS_PLAYER, + ED_CHECKBUTTON_ID_BD_VOODOO_DIES_BY_ROCK, + ED_CHECKBUTTON_ID_BD_VOODOO_VANISH_BY_EXPLOSION, ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_CHECKBUTTON_ID_ENVELOPE_CENTERED, ED_CHECKBUTTON_ID_MM_LASER_RED, @@ -3750,6 +3758,38 @@ static struct NULL, NULL, "explodes if touched by amoeba", "amoeba 2 explodes if touched by amoeba" }, + { + ED_CHECKBUTTON_ID_BD_VOODOO_COLLECTS_DIAMONDS, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), + GADGET_ID_BD_VOODOO_COLLECTS_DIAMONDS, GADGET_ID_NONE, + &level.bd_voodoo_collects_diamonds, + NULL, NULL, + "can collect diamonds", "can collect diamonds for the player" + }, + { + ED_CHECKBUTTON_ID_BD_VOODOO_HURT_KILLS_PLAYER, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), + GADGET_ID_BD_VOODOO_HURT_KILLS_PLAYER, GADGET_ID_NONE, + &level.bd_voodoo_hurt_kills_player, + NULL, NULL, + "player is killed if hurt", "if hurt in any way, player is killed" + }, + { + ED_CHECKBUTTON_ID_BD_VOODOO_DIES_BY_ROCK, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), + GADGET_ID_BD_VOODOO_DIES_BY_ROCK, GADGET_ID_NONE, + &level.bd_voodoo_dies_by_rock, + NULL, NULL, + "killed by falling rock", "can be killed by a falling rock" + }, + { + ED_CHECKBUTTON_ID_BD_VOODOO_VANISH_BY_EXPLOSION, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3), + GADGET_ID_BD_VOODOO_VANISH_BY_EXPLOSION, GADGET_ID_NONE, + &level.bd_voodoo_vanish_by_explosion, + NULL, NULL, + "disappears in explosions", "can be destroyed by explosions" + }, { ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), @@ -10787,6 +10827,7 @@ static void DrawPropertiesInfo(void) #define TEXT_GAME_OF_LIFE_3 "Min neighbours to create" #define TEXT_GAME_OF_LIFE_4 "Max neighbours to create" #define TEXT_TIME_BONUS "Extra time to solve level" +#define TEXT_TIME_PENALTY "Time penalty if destroyed" static struct { @@ -10901,6 +10942,8 @@ static struct { EL_SHIELD_DEADLY, &level.shield_deadly_time, TEXT_DURATION }, { EL_BD_CLOCK, &level.bd_clock_extra_time, TEXT_TIME_BONUS, -100, 100 }, + { EL_BD_VOODOO_DOLL, &level.bd_voodoo_penalty_time, TEXT_TIME_PENALTY, + 0, 100 }, { 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 }, @@ -10960,7 +11003,8 @@ static boolean checkPropertiesConfig(int element) MAYBE_DONT_COLLIDE_WITH(element) || element == EL_BD_ROCK || element == EL_BD_MEGA_ROCK || - element == EL_BD_SWEET) + element == EL_BD_SWEET || + element == EL_BD_VOODOO_DOLL) { return TRUE; } @@ -11080,6 +11124,7 @@ static void DrawPropertiesConfig(void) (CAN_GROW(properties_element) ? 1 : 0) + (COULD_MOVE_INTO_ACID(properties_element) ? 1 : 0) + (MAYBE_DONT_COLLIDE_WITH(properties_element) ? 1 : 0) + + (properties_element == EL_BD_VOODOO_DOLL ? 4 : 0) + (properties_element == EL_EMC_MAGIC_BALL ? 2 : 0) + num_element_counters); @@ -11271,6 +11316,14 @@ static void DrawPropertiesConfig(void) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_PUSH_MEGA_ROCK_WITH_SWEET); } + if (properties_element == EL_BD_VOODOO_DOLL) + { + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_VOODOO_COLLECTS_DIAMONDS); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_VOODOO_HURT_KILLS_PLAYER); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_VOODOO_DIES_BY_ROCK); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_VOODOO_VANISH_BY_EXPLOSION); + } + if (properties_element == EL_BD_MAGIC_WALL) { MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_MAGIC_WALL_WAIT_HATCHING); diff --git a/src/files.c b/src/files.c index 78c47b9f..b4c2d7e4 100644 --- a/src/files.c +++ b/src/files.c @@ -652,6 +652,33 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = &li.bd_clock_extra_time, 30 }, + { + EL_BD_VOODOO_DOLL, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(1), + &li.bd_voodoo_collects_diamonds, FALSE + }, + { + EL_BD_VOODOO_DOLL, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(2), + &li.bd_voodoo_hurt_kills_player, FALSE + }, + { + EL_BD_VOODOO_DOLL, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(3), + &li.bd_voodoo_dies_by_rock, FALSE + }, + { + EL_BD_VOODOO_DOLL, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(4), + &li.bd_voodoo_vanish_by_explosion, TRUE + }, + { + EL_BD_VOODOO_DOLL, -1, + TYPE_INTEGER, CONF_VALUE_8_BIT(5), + &li.bd_voodoo_penalty_time, 30 + }, + + // (the following values are related to various game elements) { @@ -3903,6 +3930,11 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) // element properties cave->level_bonus_time[0] = level->bd_clock_extra_time; + cave->voodoo_collects_diamonds = level->bd_voodoo_collects_diamonds; + cave->voodoo_any_hurt_kills_player = level->bd_voodoo_hurt_kills_player; + cave->voodoo_dies_by_stone = level->bd_voodoo_dies_by_rock; + 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_wait_for_hatching = level->bd_magic_wall_wait_hatching; cave->magic_wall_stops_amoeba = level->bd_magic_wall_stops_amoeba; @@ -3980,6 +4012,11 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) // element properties level->bd_clock_extra_time = cave->level_bonus_time[0]; + level->bd_voodoo_collects_diamonds = cave->voodoo_collects_diamonds; + level->bd_voodoo_hurt_kills_player = cave->voodoo_any_hurt_kills_player; + level->bd_voodoo_dies_by_rock = cave->voodoo_dies_by_stone; + level->bd_voodoo_vanish_by_explosion = cave->voodoo_disappear_in_explosion; + level->bd_voodoo_penalty_time = cave->level_penalty_time[0]; 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; diff --git a/src/main.h b/src/main.h index 45b045f1..9abb886a 100644 --- a/src/main.h +++ b/src/main.h @@ -3516,6 +3516,11 @@ struct LevelInfo 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 int bd_clock_extra_time; // BD engine extra time when collecting clock + boolean bd_voodoo_collects_diamonds; // BD voodoo doll can collect diamonds for the player + boolean bd_voodoo_hurt_kills_player; // BD voodoo doll hurt in any way, player is killed + boolean bd_voodoo_dies_by_rock; // BD voodoo doll can be killed by a falling rock + boolean bd_voodoo_vanish_by_explosion;// BD voodoo doll can be destroyed by explosions + int bd_voodoo_penalty_time; // BD engine penalty time when voodoo doll destroyed 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