From: Holger Schemel Date: Fri, 21 Aug 2020 16:45:04 +0000 (+0200) Subject: added support for initially moving spring to R'n'D game engine X-Git-Tag: 4.2.0.2~29 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c96a3788bfff5c87355451700389df7a83a8a9fb;p=rocksndiamonds.git added support for initially moving spring to R'n'D game engine --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 854fa264..daf471eb 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -1764,6 +1764,11 @@ struct ConfigInfo image_config[] = { "spring.ypos", "13" }, { "spring.frames", "1" }, + { "spring.left", UNDEFINED_FILENAME }, + { "spring.left.clone_from", "spring" }, + { "spring.right", UNDEFINED_FILENAME }, + { "spring.right.clone_from", "spring" }, + { "emc_steelwall_1", "RocksDC.png" }, { "emc_steelwall_1.xpos", "14" }, { "emc_steelwall_1.ypos", "0" }, diff --git a/src/editor.c b/src/editor.c index 7931d896..edbef12d 100644 --- a/src/editor.c +++ b/src/editor.c @@ -4056,13 +4056,13 @@ static int editor_el_emerald_mine_club[] = EL_EMC_MAGIC_BALL, EL_EMC_MAGIC_BALL_SWITCH, - EL_SPRING, - EL_EMC_SPRING_BUMPER, - EL_EMC_LENSES, EL_EMC_MAGNIFIER, - EL_EMPTY, - EL_EMPTY, + + EL_SPRING_LEFT, + EL_SPRING, + EL_SPRING_RIGHT, + EL_EMC_SPRING_BUMPER, EL_BALLOON, EL_YAMYAM_UP, @@ -9741,6 +9741,8 @@ static struct { EL_EMC_LENSES, &level.lenses_score, TEXT_COLLECTING }, { EL_EMC_MAGNIFIER, &level.magnify_score, TEXT_COLLECTING }, { EL_SPRING, &level.slurp_score, TEXT_SLURPING }, + { EL_SPRING_LEFT, &level.slurp_score, TEXT_SLURPING }, + { EL_SPRING_RIGHT, &level.slurp_score, TEXT_SLURPING }, { EL_EMC_LENSES, &level.lenses_time, TEXT_DURATION }, { EL_EMC_MAGNIFIER, &level.magnify_time, TEXT_DURATION }, { EL_MM_FUSE_ACTIVE, &level.mm_time_fuse, TEXT_DELAY_OFF }, @@ -10016,7 +10018,9 @@ static void DrawPropertiesConfig(void) if (MAYBE_DONT_COLLIDE_WITH(properties_element)) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH); - if (properties_element == EL_SPRING) + if (properties_element == EL_SPRING || + properties_element == EL_SPRING_LEFT || + properties_element == EL_SPRING_RIGHT) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_SPRING_BUG); if (properties_element == EL_TIME_ORB_FULL) diff --git a/src/game.c b/src/game.c index 8c243a49..18a45fcf 100644 --- a/src/game.c +++ b/src/game.c @@ -1877,6 +1877,8 @@ static void InitField(int x, int y, boolean init_game) case EL_MOLE_RIGHT: case EL_MOLE_UP: case EL_MOLE_DOWN: + case EL_SPRING_LEFT: + case EL_SPRING_RIGHT: InitMovDir(x, y); break; @@ -4489,6 +4491,12 @@ void InitMovDir(int x, int y) MovDir[x][y] = direction[2][element - EL_MOLE_LEFT]; break; + case EL_SPRING_LEFT: + case EL_SPRING_RIGHT: + Feld[x][y] = EL_SPRING; + MovDir[x][y] = direction[2][element - EL_SPRING_LEFT]; + break; + default: if (IS_CUSTOM_ELEMENT(element)) { diff --git a/src/init.c b/src/init.c index 04d7f32a..708b7dd7 100644 --- a/src/init.c +++ b/src/init.c @@ -77,6 +77,11 @@ static int copy_properties[][5] = EL_MOLE_LEFT, EL_MOLE_RIGHT, EL_MOLE_UP, EL_MOLE_DOWN }, + { + EL_SPRING, + EL_SPRING_LEFT, EL_SPRING_RIGHT, + EL_SPRING_LEFT, EL_SPRING_RIGHT, // (to match array size) + }, { -1, -1, -1, -1, -1 @@ -2357,6 +2362,8 @@ static int get_special_property_bit(int element, int property_bit_nr) { EL_SP_ELECTRON, 15 }, { EL_BALLOON, 16 }, { EL_SPRING, 17 }, + { EL_SPRING_LEFT, 17 }, + { EL_SPRING_RIGHT, 17 }, { EL_EMC_ANDROID, 18 }, { -1, -1 }, diff --git a/src/main.c b/src/main.c index cb083658..760d3c15 100644 --- a/src/main.c +++ b/src/main.c @@ -6269,6 +6269,16 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "df_wooden_wall", "wooden wall (DF style)", }, + { + "spring.left", + "spring", + "spring (starts moving left)" + }, + { + "spring.right", + "spring", + "spring (starts moving right)" + }, // -------------------------------------------------------------------------- // "real" (and therefore drawable) runtime elements diff --git a/src/main.h b/src/main.h index ae52c9fe..15b99ab6 100644 --- a/src/main.h +++ b/src/main.h @@ -1898,7 +1898,10 @@ #define EL_MM_END_2 (EL_DF_START2 + 430) #define EL_MM_END EL_MM_END_2 -#define NUM_FILE_ELEMENTS 1215 +#define EL_SPRING_LEFT 1215 +#define EL_SPRING_RIGHT 1216 + +#define NUM_FILE_ELEMENTS 1217 // "real" (and therefore drawable) runtime elements diff --git a/src/tools.c b/src/tools.c index 70441d1c..32d33f4d 100644 --- a/src/tools.c +++ b/src/tools.c @@ -6536,11 +6536,11 @@ em_object_mapping_list[GAME_TILE_MAX + 1] = }, { Xspring_e, FALSE, FALSE, - EL_SPRING, -1, -1 + EL_SPRING_RIGHT, -1, -1 }, { Xspring_w, FALSE, FALSE, - EL_SPRING, -1, -1 + EL_SPRING_LEFT, -1, -1 }, { Xspring_fall, FALSE, FALSE, @@ -6628,12 +6628,12 @@ em_object_mapping_list[GAME_TILE_MAX + 1] = EL_NUT, -1, MV_BIT_LEFT }, { - Xpush_spring_e, FALSE, FALSE, - EL_SPRING, -1, MV_BIT_RIGHT + Xpush_spring_e, TRUE, FALSE, + EL_SPRING_RIGHT, -1, MV_BIT_RIGHT }, { - Xpush_spring_w, FALSE, FALSE, - EL_SPRING, -1, MV_BIT_LEFT + Xpush_spring_w, TRUE, FALSE, + EL_SPRING_LEFT, -1, MV_BIT_LEFT }, {