From: Holger Schemel Date: Mon, 26 Apr 2004 07:38:39 +0000 (+0200) Subject: rnd-20040426-1-src X-Git-Tag: 3.1.0^2~12 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a5e9fc02d650da0520fc4994ba5780c27e4f3569;p=rocksndiamonds.git rnd-20040426-1-src * added option "reachable despite gravity" for gravity movement * changed gravity movement of most classic walkable and passable elements back to "not reachable" (for compatibility reasons) --- diff --git a/ChangeLog b/ChangeLog index 6ebcd68e..c2aed9a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-04-25 + * added option "reachable despite gravity" for gravity movement + * changed gravity movement of most classic walkable and passable + elements back to "not reachable" (for compatibility reasons) + 2004-04-24 * fixed (removed) "indestructible" / "can explode" dependency in editor * fixed (removed) "accessible inside" / "protected" dependency diff --git a/src/conftime.h b/src/conftime.h index da757eab..da0260a0 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-04-24 22:56]" +#define COMPILE_DATE_STRING "[2004-04-26 09:36]" diff --git a/src/editor.c b/src/editor.c index 4326d882..a544dfa1 100644 --- a/src/editor.c +++ b/src/editor.c @@ -519,19 +519,20 @@ #define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 25) #define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 26) #define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 27) -#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 28) -#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 29) -#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 30) -#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 31) -#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 32) -#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 33) -#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 34) -#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 35) -#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 36) -#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 37) +#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 28) +#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 29) +#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 30) +#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 31) +#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 32) +#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 33) +#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 34) +#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 35) +#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 36) +#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 37) +#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 38) /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 38) +#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 39) #define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ ED_NUM_ELEMENTLIST_BUTTONS - 1) @@ -575,8 +576,8 @@ #define ED_COUNTER_ID_LEVEL_LAST ED_COUNTER_ID_LEVEL_RANDOM #define ED_COUNTER_ID_CUSTOM1_FIRST ED_COUNTER_ID_CUSTOM_SCORE -#define ED_COUNTER_ID_CUSTOM1_LAST ED_COUNTER_ID_MOVE_DELAY_RND -#define ED_COUNTER_ID_CUSTOM2_FIRST ED_COUNTER_ID_EXPLOSION_DELAY +#define ED_COUNTER_ID_CUSTOM1_LAST ED_COUNTER_ID_DROP_DELAY_RND +#define ED_COUNTER_ID_CUSTOM2_FIRST ED_COUNTER_ID_MOVE_DELAY_FIX #define ED_COUNTER_ID_CUSTOM2_LAST ED_COUNTER_ID_IGNITION_DELAY #define ED_COUNTER_ID_CUSTOM_FIRST ED_COUNTER_ID_CUSTOM1_FIRST #define ED_COUNTER_ID_CUSTOM_LAST ED_COUNTER_ID_CUSTOM2_LAST @@ -656,8 +657,8 @@ #define ED_SELECTBOX_ID_LEVEL_LAST ED_SELECTBOX_ID_TIME_OR_STEPS #define ED_SELECTBOX_ID_CUSTOM1_FIRST ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE -#define ED_SELECTBOX_ID_CUSTOM1_LAST ED_SELECTBOX_ID_CUSTOM_MOVE_LEAVE_TYPE -#define ED_SELECTBOX_ID_CUSTOM2_FIRST ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS +#define ED_SELECTBOX_ID_CUSTOM1_LAST ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION +#define ED_SELECTBOX_ID_CUSTOM2_FIRST ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN #define ED_SELECTBOX_ID_CUSTOM2_LAST ED_SELECTBOX_ID_CUSTOM_EXPLOSION_TYPE #define ED_SELECTBOX_ID_CUSTOM_FIRST ED_SELECTBOX_ID_CUSTOM1_FIRST #define ED_SELECTBOX_ID_CUSTOM_LAST ED_SELECTBOX_ID_CUSTOM2_LAST @@ -712,34 +713,35 @@ #define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 14 #define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 15 #define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 16 -#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 17 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 18 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 19 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 20 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 21 -#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 22 -#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 23 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 24 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 25 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 26 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 27 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 28 -#define ED_CHECKBUTTON_ID_CHANGE_DELAY 29 -#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 30 -#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 31 -#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 32 -#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 33 -#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 34 -#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 35 - -#define ED_NUM_CHECKBUTTONS 36 +#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 17 +#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 18 +#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 19 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 20 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 21 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 22 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 23 +#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 24 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 25 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 26 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 27 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 28 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 29 +#define ED_CHECKBUTTON_ID_CHANGE_DELAY 30 +#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 31 +#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 32 +#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 33 +#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 34 +#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 35 +#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 36 + +#define ED_NUM_CHECKBUTTONS 37 #define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC -#define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE -#define ED_CHECKBUTTON_ID_CUSTOM2_FIRST ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL +#define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE +#define ED_CHECKBUTTON_ID_CUSTOM2_FIRST ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE #define ED_CHECKBUTTON_ID_CUSTOM2_LAST ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT #define ED_CHECKBUTTON_ID_CUSTOM_FIRST ED_CHECKBUTTON_ID_CUSTOM1_FIRST #define ED_CHECKBUTTON_ID_CUSTOM_LAST ED_CHECKBUTTON_ID_CUSTOM2_LAST @@ -1039,8 +1041,11 @@ static struct &custom_element.drop_delay_random, NULL, "+random", NULL }, + + /* ---------- element settings: configure 2 (custom elements) ------------ */ + { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(13), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5), 0, 999, GADGET_ID_MOVE_DELAY_FIX_DOWN, GADGET_ID_MOVE_DELAY_FIX_UP, GADGET_ID_MOVE_DELAY_FIX_TEXT, GADGET_ID_NONE, @@ -1048,18 +1053,15 @@ static struct NULL, "move delay", NULL }, { - -1, ED_SETTINGS_YPOS(13), + -1, ED_SETTINGS_YPOS(5), 0, 999, GADGET_ID_MOVE_DELAY_RND_DOWN, GADGET_ID_MOVE_DELAY_RND_UP, GADGET_ID_MOVE_DELAY_RND_TEXT, GADGET_ID_MOVE_DELAY_FIX_UP, &custom_element.move_delay_random, NULL, "+random", NULL }, - - /* ---------- element settings: configure 2 (custom elements) ------------ */ - { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(12), 0, 255, GADGET_ID_EXPLOSION_DELAY_DOWN, GADGET_ID_EXPLOSION_DELAY_UP, GADGET_ID_EXPLOSION_DELAY_TEXT, GADGET_ID_NONE, @@ -1067,7 +1069,7 @@ static struct NULL, "explosion delay", NULL }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(13), 0, 255, GADGET_ID_IGNITION_DELAY_DOWN, GADGET_ID_IGNITION_DELAY_UP, GADGET_ID_IGNITION_DELAY_TEXT, GADGET_ID_NONE, @@ -1543,16 +1545,19 @@ static struct &custom_element.walk_to_action, NULL, NULL, "diggable/collectible/pushable" }, + + /* ---------- element settings: configure 2 (custom elements) ----------- */ + { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(9), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_MOVE_PATTERN, GADGET_ID_NONE, -1, options_move_pattern, &custom_element.move_pattern, - "can move", NULL, "element move direction" + "can move", NULL, "element move pattern" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(10), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(2), GADGET_ID_CUSTOM_MOVE_DIRECTION, GADGET_ID_NONE, -1, options_move_direction, @@ -1560,7 +1565,7 @@ static struct "starts moving", NULL, "initial element move direction" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(12), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4), GADGET_ID_CUSTOM_MOVE_STEPSIZE, GADGET_ID_NONE, -1, options_move_stepsize, @@ -1568,7 +1573,7 @@ static struct "move/fall speed", NULL, "speed of element movement" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(11), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(3), GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE, GADGET_ID_NONE, -1, options_move_leave_type, @@ -1576,7 +1581,7 @@ static struct "can dig: can", ":", "leave behind or change element" }, { - -1, ED_SETTINGS_YPOS(13), + -1, ED_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_SMASH_TARGETS, GADGET_ID_CUSTOM_CAN_SMASH, -1, options_smash_targets, @@ -1584,18 +1589,15 @@ static struct "can smash", NULL, "elements that can be smashed" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(14), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(8), GADGET_ID_CUSTOM_SLIPPERY_TYPE, GADGET_ID_NONE, -1, options_slippery_type, &custom_element.slippery_type, "slippery", NULL, "where other elements fall down" }, - - /* ---------- element settings: configure 2 (custom elements) ----------- */ - { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(1), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(9), GADGET_ID_CUSTOM_DEADLINESS, GADGET_ID_NONE, -1, options_deadliness, @@ -1603,7 +1605,7 @@ static struct "deadly when", NULL, "deadliness of element" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(2), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(10), GADGET_ID_CUSTOM_EXPLOSION_TYPE, GADGET_ID_NONE, -1, options_explosion_type, @@ -2037,7 +2039,7 @@ static struct ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_USE_GRAPHIC, GADGET_ID_NONE, &custom_element.use_gfx_element, - NULL, "use graphic of element:", "use graphic for custom element" + NULL, "use graphic/sound of element:", "use existing graphic and sound" }, { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), @@ -2051,6 +2053,12 @@ static struct &custom_element_properties[EP_ACCESSIBLE], NULL, NULL, "player can walk to or pass this field" }, + { + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(10), + GADGET_ID_CUSTOM_GRAV_REACHABLE, GADGET_ID_NONE, + &custom_element_properties[EP_GRAVITY_REACHABLE], + NULL, "reachable despite gravity", "player can walk/dig despite gravity" + }, { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(5), GADGET_ID_CUSTOM_WALK_TO_OBJECT, GADGET_ID_NONE, @@ -2059,63 +2067,63 @@ static struct }, { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(9), + GADGET_ID_CUSTOM_INDESTRUCTIBLE, GADGET_ID_NONE, + &custom_element_properties[EP_INDESTRUCTIBLE], + NULL, "indestructible", "element is indestructible" + }, + + /* ---------- element settings: configure 2 (custom elements) ----------- */ + + { + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_CAN_MOVE, GADGET_ID_NONE, &custom_element_properties[EP_CAN_MOVE], - NULL, NULL, "element can move in some direction" + NULL, NULL, "element can move with some pattern" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(13), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_CAN_FALL, GADGET_ID_NONE, &custom_element_properties[EP_CAN_FALL], NULL, "can fall", "element can fall down" }, { - -1, ED_SETTINGS_YPOS(13), + -1, ED_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_CAN_SMASH, GADGET_ID_CUSTOM_CAN_FALL, &custom_element_properties[EP_CAN_SMASH], " ", NULL, "element can smash other elements" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(14), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(8), GADGET_ID_CUSTOM_SLIPPERY, GADGET_ID_NONE, &custom_element_properties[EP_SLIPPERY], NULL, NULL, "other elements can fall down from it" }, - - /* ---------- element settings: configure 2 (custom elements) ----------- */ - { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(9), GADGET_ID_CUSTOM_DEADLY, GADGET_ID_NONE, &custom_element_properties[EP_DEADLY], NULL, NULL, "element can kill the player" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(6), - GADGET_ID_CUSTOM_INDESTRUCTIBLE, GADGET_ID_NONE, - &custom_element_properties[EP_INDESTRUCTIBLE], - NULL, "indestructible", "element is indestructible" - }, - { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(10), GADGET_ID_CUSTOM_CAN_EXPLODE, GADGET_ID_NONE, &custom_element_properties[EP_CAN_EXPLODE], NULL, NULL, "element can explode" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(3), + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_FIRE, GADGET_ID_NONE, &custom_element_properties[EP_EXPLODES_BY_FIRE], NULL, "by fire", "element can explode by fire/explosion" }, { - -1, ED_SETTINGS_YPOS(3), + -1, ED_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_SMASH, GADGET_ID_CUSTOM_EXPLODE_FIRE, &custom_element_properties[EP_EXPLODES_SMASHED], " ", "smashed", "element can explode when smashed" }, { - -1, ED_SETTINGS_YPOS(3), + -1, ED_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_IMPACT, GADGET_ID_CUSTOM_EXPLODE_SMASH, &custom_element_properties[EP_EXPLODES_IMPACT], " ", "impact", "element can explode on impact" @@ -2251,6 +2259,8 @@ static struct "content:", NULL, NULL }, + /* ---------- element settings: configure 1 (custom elements) ----------- */ + /* ---------- custom graphic --------------------------------------------- */ { @@ -2260,10 +2270,12 @@ static struct NULL, NULL, NULL }, + /* ---------- element settings: configure 2 (custom elements) ----------- */ + /* ---------- custom content (when exploding) ---------------------------- */ { - -1, ED_AREA_3X3_SETTINGS_YPOS(2), + -1, ED_AREA_3X3_SETTINGS_YPOS(10), 3, 3, GADGET_ID_CUSTOM_CONTENT, GADGET_ID_NONE, /* align three rows */ "content:", NULL, NULL @@ -2272,18 +2284,20 @@ static struct /* ---------- custom enter and leave element (when moving) --------------- */ { - ED_AREA_1X1_SETTINGS_XPOS(1), ED_AREA_1X1_SETTINGS_YPOS(11), + ED_AREA_1X1_SETTINGS_XPOS(1), ED_AREA_1X1_SETTINGS_YPOS(3), 1, 1, GADGET_ID_CUSTOM_MOVE_ENTER, GADGET_ID_NONE, "can dig:", " ", NULL }, { - -1, ED_AREA_1X1_SETTINGS_YPOS(11), + -1, ED_AREA_1X1_SETTINGS_YPOS(3), 1, 1, GADGET_ID_CUSTOM_MOVE_LEAVE, GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE, NULL, NULL, NULL }, + /* ---------- element settings: advanced (custom elements) --------------- */ + /* ---------- custom change target --------------------------------------- */ { @@ -5341,13 +5355,15 @@ static void MapCheckbuttonGadget(int id) int xoffset_left = getTextWidthForGadget(checkbutton_info[id].text_left); int xoffset_right = ED_GADGET_TEXT_DISTANCE; int yoffset = ED_BORDER_SIZE; - int x_left = gi->x - xoffset_left; - int x_right = gi->x + gi->width + xoffset_right; - int y; /* set after gadget position was modified */ + int x_left, x_right, y; /* set after gadget position was modified */ - /* set position for gadgets with dynamically determined vertical position */ + /* set position for gadgets with dynamically determined position */ + if (checkbutton_info[id].x != -1) /* do not change dynamic positions */ + ModifyGadget(gi, GDI_X, SX + checkbutton_info[id].x, GDI_END); ModifyGadget(gi, GDI_Y, SY + checkbutton_info[id].y, GDI_END); + x_left = gi->x - xoffset_left; + x_right = gi->x + gi->width + xoffset_right; y = gi->y + yoffset; if (checkbutton_info[id].text_left) @@ -7090,8 +7106,10 @@ static void DrawPropertiesConfig() edit_mode_properties == ED_MODE_PROPERTIES_CONFIG_2)) { /* set position for checkbutton for "can move into acid" */ + checkbutton_info[ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID].x = + ED_SETTINGS_XPOS(IS_CUSTOM_ELEMENT(properties_element) ? 1 : 0); checkbutton_info[ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID].y = - ED_SETTINGS_YPOS(IS_CUSTOM_ELEMENT(properties_element) ? 7 : + ED_SETTINGS_YPOS(IS_CUSTOM_ELEMENT(properties_element) ? 6 : HAS_CONTENT(properties_element) ? 1 : 0); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID); @@ -7157,8 +7175,6 @@ static void DrawPropertiesConfig() /* draw drawing area gadgets */ MapDrawingArea(ED_DRAWING_ID_CUSTOM_GRAPHIC); - MapDrawingArea(ED_DRAWING_ID_CUSTOM_MOVE_ENTER); - MapDrawingArea(ED_DRAWING_ID_CUSTOM_MOVE_LEAVE); } else if (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG_2) { @@ -7178,6 +7194,8 @@ static void DrawPropertiesConfig() MapSelectboxGadget(i); /* draw drawing area gadgets */ + MapDrawingArea(ED_DRAWING_ID_CUSTOM_MOVE_ENTER); + MapDrawingArea(ED_DRAWING_ID_CUSTOM_MOVE_LEAVE); DrawCustomContentArea(); } } diff --git a/src/game.c b/src/game.c index 994c04f3..ce4948b8 100644 --- a/src/game.c +++ b/src/game.c @@ -9027,6 +9027,13 @@ static boolean canMoveToValidFieldWithGravity(int x, int y, int move_dir) int nexty = newy + dy; #endif +#if 1 + return (IN_LEV_FIELD(newx, newy) && !IS_FREE_OR_PLAYER(newx, newy) && + IS_GRAVITY_REACHABLE(Feld[newx][newy]) && + (IS_DIGGABLE(Feld[newx][newy]) || + IS_WALKABLE_FROM(Feld[newx][newy], opposite_dir) || + canPassField(newx, newy, move_dir))); +#else #if 1 return (IN_LEV_FIELD(newx, newy) && !IS_FREE_OR_PLAYER(newx, newy) && (IS_DIGGABLE_WITH_GRAVITY(Feld[newx][newy]) || @@ -9042,6 +9049,7 @@ static boolean canMoveToValidFieldWithGravity(int x, int y, int move_dir) IS_WALKABLE_FROM(Feld[nextx][nexty], move_dir) && (level.can_pass_to_walkable || IS_FREE(nextx, nexty))))); #endif +#endif } static void CheckGravityMovement(struct PlayerInfo *player) @@ -10779,6 +10787,7 @@ int DigField(struct PlayerInfo *player, if (IS_WALKABLE(element)) #endif { + int sound_element = SND_ELEMENT(element); int sound_action = ACTION_WALKING; #if 0 @@ -10815,8 +10824,8 @@ int DigField(struct PlayerInfo *player, } /* play sound from background or player, whatever is available */ - if (element_info[element].sound[sound_action] != SND_UNDEFINED) - PlayLevelSoundElementAction(x, y, element, sound_action); + if (element_info[sound_element].sound[sound_action] != SND_UNDEFINED) + PlayLevelSoundElementAction(x, y, sound_element, sound_action); else PlayLevelSoundElementAction(x, y, player->element_nr, sound_action); @@ -11718,7 +11727,7 @@ static void PlayLevelSoundAction(int x, int y, int action) static void PlayLevelSoundElementAction(int x, int y, int element, int action) { - int sound_effect = element_info[element].sound[action]; + int sound_effect = element_info[SND_ELEMENT(element)].sound[action]; if (sound_effect != SND_UNDEFINED) PlayLevelSound(x, y, sound_effect); @@ -11727,7 +11736,7 @@ static void PlayLevelSoundElementAction(int x, int y, int element, int action) static void PlayLevelSoundElementActionIfLoop(int x, int y, int element, int action) { - int sound_effect = element_info[element].sound[action]; + int sound_effect = element_info[SND_ELEMENT(element)].sound[action]; if (sound_effect != SND_UNDEFINED && IS_LOOP_SOUND(sound_effect)) PlayLevelSound(x, y, sound_effect); @@ -11735,7 +11744,7 @@ static void PlayLevelSoundElementActionIfLoop(int x, int y, int element, static void PlayLevelSoundActionIfLoop(int x, int y, int action) { - int sound_effect = element_info[Feld[x][y]].sound[action]; + int sound_effect = element_info[SND_ELEMENT(Feld[x][y])].sound[action]; if (sound_effect != SND_UNDEFINED && IS_LOOP_SOUND(sound_effect)) PlayLevelSound(x, y, sound_effect); @@ -11743,7 +11752,7 @@ static void PlayLevelSoundActionIfLoop(int x, int y, int action) static void StopLevelSoundActionIfLoop(int x, int y, int action) { - int sound_effect = element_info[Feld[x][y]].sound[action]; + int sound_effect = element_info[SND_ELEMENT(Feld[x][y])].sound[action]; if (sound_effect != SND_UNDEFINED && IS_LOOP_SOUND(sound_effect)) StopSound(sound_effect); diff --git a/src/init.c b/src/init.c index 70408171..61f8ce8e 100644 --- a/src/init.c +++ b/src/init.c @@ -2326,6 +2326,27 @@ void InitElementPropertiesStatic() -1 }; + static int ep_gravity_reachable[] = + { + EL_SAND, + EL_SP_BASE, + EL_TRAP, + EL_INVISIBLE_SAND, + EL_INVISIBLE_SAND_ACTIVE, + EL_SP_PORT_LEFT, + EL_SP_PORT_RIGHT, + EL_SP_PORT_UP, + EL_SP_PORT_DOWN, + EL_SP_PORT_HORIZONTAL, + EL_SP_PORT_VERTICAL, + EL_SP_PORT_ANY, + EL_SP_GRAVITY_PORT_LEFT, + EL_SP_GRAVITY_PORT_RIGHT, + EL_SP_GRAVITY_PORT_UP, + EL_SP_GRAVITY_PORT_DOWN, + -1 + }; + static int ep_player[] = { EL_PLAYER_1, @@ -2491,14 +2512,6 @@ void InitElementPropertiesStatic() -1 }; - static int ep_sp_buggy_base[] = - { - EL_SP_BUGGY_BASE, - EL_SP_BUGGY_BASE_ACTIVATING, - EL_SP_BUGGY_BASE_ACTIVE, - -1 - }; - static int ep_gem[] = { EL_BD_DIAMOND, @@ -3137,6 +3150,7 @@ void InitElementPropertiesStatic() { ep_protected, EP_PROTECTED }, { ep_throwable, EP_THROWABLE }, { ep_can_explode, EP_CAN_EXPLODE }, + { ep_gravity_reachable, EP_GRAVITY_REACHABLE }, { ep_player, EP_PLAYER }, { ep_can_pass_magic_wall, EP_CAN_PASS_MAGIC_WALL }, @@ -3144,7 +3158,6 @@ void InitElementPropertiesStatic() { ep_bd_element, EP_BD_ELEMENT }, { ep_sp_element, EP_SP_ELEMENT }, { ep_sb_element, EP_SB_ELEMENT }, - { ep_sp_buggy_base, EP_SP_BUGGY_BASE }, { ep_gem, EP_GEM }, { ep_food_dark_yamyam, EP_FOOD_DARK_YAMYAM }, { ep_food_penguin, EP_FOOD_PENGUIN }, @@ -3472,10 +3485,6 @@ void InitElementPropertiesEngine(int engine_version) SET_PROPERTY(i, EP_MAYBE_DONT_COLLIDE_WITH, (i == EL_SP_SNIKSNAK || i == EL_SP_ELECTRON)); - /* ---------- DIGGABLE_WITH_GRAVITY ------------------------------------ */ - SET_PROPERTY(i, EP_DIGGABLE_WITH_GRAVITY, (IS_DIGGABLE(i) && - !IS_SP_BUGGY_BASE(i))); - /* ---------- CAN_MOVE_INTO_ACID --------------------------------------- */ if (COULD_MOVE_INTO_ACID(i) && !IS_CUSTOM_ELEMENT(i)) SET_PROPERTY(i, EP_CAN_MOVE_INTO_ACID, diff --git a/src/main.h b/src/main.h index 541139ce..c6ae5644 100644 --- a/src/main.h +++ b/src/main.h @@ -91,6 +91,7 @@ #define EP_CAN_MOVE_INTO_ACID 27 #define EP_THROWABLE 28 #define EP_CAN_EXPLODE 29 +#define EP_GRAVITY_REACHABLE 30 /* values for pre-defined properties */ #define EP_PLAYER 32 @@ -99,63 +100,61 @@ #define EP_BD_ELEMENT 35 #define EP_SP_ELEMENT 36 #define EP_SB_ELEMENT 37 -#define EP_SP_BUGGY_BASE 38 -#define EP_GEM 39 -#define EP_FOOD_DARK_YAMYAM 40 -#define EP_FOOD_PENGUIN 41 -#define EP_FOOD_PIG 42 -#define EP_HISTORIC_WALL 43 -#define EP_HISTORIC_SOLID 44 -#define EP_CLASSIC_ENEMY 45 -#define EP_BELT 46 -#define EP_BELT_ACTIVE 47 -#define EP_BELT_SWITCH 48 -#define EP_TUBE 49 -#define EP_KEYGATE 50 -#define EP_AMOEBOID 51 -#define EP_AMOEBALIVE 52 -#define EP_HAS_CONTENT 53 -#define EP_CAN_TURN_EACH_MOVE 54 -#define EP_CAN_GROW 55 -#define EP_ACTIVE_BOMB 56 -#define EP_INACTIVE 57 +#define EP_GEM 38 +#define EP_FOOD_DARK_YAMYAM 39 +#define EP_FOOD_PENGUIN 40 +#define EP_FOOD_PIG 41 +#define EP_HISTORIC_WALL 42 +#define EP_HISTORIC_SOLID 43 +#define EP_CLASSIC_ENEMY 44 +#define EP_BELT 45 +#define EP_BELT_ACTIVE 46 +#define EP_BELT_SWITCH 47 +#define EP_TUBE 48 +#define EP_KEYGATE 49 +#define EP_AMOEBOID 50 +#define EP_AMOEBALIVE 51 +#define EP_HAS_CONTENT 52 +#define EP_CAN_TURN_EACH_MOVE 53 +#define EP_CAN_GROW 54 +#define EP_ACTIVE_BOMB 55 +#define EP_INACTIVE 56 /* values for special configurable properties (depending on level settings) */ -#define EP_EM_SLIPPERY_WALL 58 +#define EP_EM_SLIPPERY_WALL 57 /* values for special graphics properties (no effect on game engine) */ -#define EP_GFX_CRUMBLED 59 +#define EP_GFX_CRUMBLED 58 /* values for derived properties (determined from properties above) */ -#define EP_ACCESSIBLE_OVER 60 -#define EP_ACCESSIBLE_INSIDE 61 -#define EP_ACCESSIBLE_UNDER 62 -#define EP_WALKABLE 63 -#define EP_PASSABLE 64 -#define EP_ACCESSIBLE 65 -#define EP_COLLECTIBLE 66 -#define EP_SNAPPABLE 67 -#define EP_WALL 68 -#define EP_SOLID_FOR_PUSHING 69 -#define EP_DRAGONFIRE_PROOF 70 -#define EP_EXPLOSION_PROOF 71 -#define EP_CAN_SMASH 72 -#define EP_EXPLODES_3X3_OLD 73 -#define EP_CAN_EXPLODE_BY_FIRE 74 -#define EP_CAN_EXPLODE_SMASHED 75 -#define EP_CAN_EXPLODE_IMPACT 76 -#define EP_SP_PORT 77 -#define EP_CAN_EXPLODE_BY_DRAGONFIRE 78 -#define EP_CAN_EXPLODE_BY_EXPLOSION 79 -#define EP_COULD_MOVE_INTO_ACID 80 -#define EP_MAYBE_DONT_COLLIDE_WITH 81 -#define EP_DIGGABLE_WITH_GRAVITY 82 +#define EP_ACCESSIBLE_OVER 59 +#define EP_ACCESSIBLE_INSIDE 60 +#define EP_ACCESSIBLE_UNDER 61 +#define EP_WALKABLE 62 +#define EP_PASSABLE 63 +#define EP_ACCESSIBLE 64 +#define EP_COLLECTIBLE 65 +#define EP_SNAPPABLE 66 +#define EP_WALL 67 +#define EP_SOLID_FOR_PUSHING 68 +#define EP_DRAGONFIRE_PROOF 69 +#define EP_EXPLOSION_PROOF 70 +#define EP_CAN_SMASH 71 +#define EP_EXPLODES_3X3_OLD 72 +#define EP_CAN_EXPLODE_BY_FIRE 73 +#define EP_CAN_EXPLODE_SMASHED 74 +#define EP_CAN_EXPLODE_IMPACT 75 +#define EP_SP_PORT 76 +#define EP_CAN_EXPLODE_BY_DRAGONFIRE 77 +#define EP_CAN_EXPLODE_BY_EXPLOSION 78 +#define EP_COULD_MOVE_INTO_ACID 79 +#define EP_MAYBE_DONT_COLLIDE_WITH 80 /* values for internal purpose only (level editor) */ -#define EP_WALK_TO_OBJECT 83 -#define EP_DEADLY 84 +#define EP_WALK_TO_OBJECT 81 +#define EP_DEADLY 82 -#define NUM_ELEMENT_PROPERTIES 85 +#define NUM_ELEMENT_PROPERTIES 83 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -345,6 +344,7 @@ #define CAN_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_CAN_MOVE_INTO_ACID) #define IS_THROWABLE(e) HAS_PROPERTY(e, EP_THROWABLE) #define CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE) +#define IS_GRAVITY_REACHABLE(e) HAS_PROPERTY(e, EP_GRAVITY_REACHABLE) /* macros for special configurable properties */ #define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL) @@ -359,7 +359,6 @@ #define IS_BD_ELEMENT(e) HAS_PROPERTY(e, EP_BD_ELEMENT) #define IS_SP_ELEMENT(e) HAS_PROPERTY(e, EP_SP_ELEMENT) #define IS_SB_ELEMENT(e) HAS_PROPERTY(e, EP_SB_ELEMENT) -#define IS_SP_BUGGY_BASE(e) HAS_PROPERTY(e, EP_SP_BUGGY_BASE) #define IS_GEM(e) HAS_PROPERTY(e, EP_GEM) #define IS_FOOD_DARK_YAMYAM(e) HAS_PROPERTY(e, EP_FOOD_DARK_YAMYAM) #define IS_FOOD_PENGUIN(e) HAS_PROPERTY(e, EP_FOOD_PENGUIN) @@ -405,7 +404,6 @@ HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_EXPLOSION) #define COULD_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_COULD_MOVE_INTO_ACID) #define MAYBE_DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_MAYBE_DONT_COLLIDE_WITH) -#define IS_DIGGABLE_WITH_GRAVITY(e) HAS_PROPERTY(e, EP_DIGGABLE_WITH_GRAVITY) /* special macros used in game engine */ #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ @@ -438,6 +436,8 @@ #define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \ element_info[e].gfx_element : e) +#define SND_ELEMENT(e) GFX_ELEMENT(e) + #define IS_PLAYER(x, y) (ELEM_IS_PLAYER(StorePlayer[x][y])) #define IS_FREE(x, y) (Feld[x][y] == EL_EMPTY && !IS_PLAYER(x, y))