From: Holger Schemel Date: Fri, 16 Dec 2005 23:19:34 +0000 (+0100) Subject: rnd-20051217-1-src X-Git-Tag: 3.1.2^2~22 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a845e699402866bf6d228d028226554cbe142a83;p=rocksndiamonds.git rnd-20051217-1-src * added dynamic checkboxes to custom element action settings in editor * added "CE value" counter for custom elements (instead of "CE count") * added option to use the last "CE value" after custom element change * added option to use the "CE value" of other elements in CE actions * fixed odd behaviour when pressing time orb in levels w/o time limit * added checkbox "use time orb bug" for older levels that use this bug --- diff --git a/ChangeLog b/ChangeLog index 542dc114..d2718887 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-12-16 + * added dynamic checkboxes to custom element action settings in editor + * added "CE value" counter for custom elements (instead of "CE count") + * added option to use the last "CE value" after custom element change + * added option to use the "CE value" of other elements in CE actions + * fixed odd behaviour when pressing time orb in levels w/o time limit + * added checkbox "use time orb bug" for older levels that use this bug + 2005-12-15 * added missing configuration settings for the following elements: - EL_TIMEGATE_SWITCH (time of open time gate) diff --git a/src/conftime.h b/src/conftime.h index 8f47ee3c..9ecbf26b 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2005-12-16 23:27]" +#define COMPILE_DATE_STRING "[2005-12-17 00:15]" diff --git a/src/editor.c b/src/editor.c index a36f0696..d4e44e8c 100644 --- a/src/editor.c +++ b/src/editor.c @@ -540,43 +540,44 @@ #define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 4) #define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 5) #define GADGET_ID_USE_SPRING_BUG (GADGET_ID_CHECKBUTTON_FIRST + 6) -#define GADGET_ID_GROW_INTO_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 7) -#define GADGET_ID_DOUBLE_SPEED (GADGET_ID_CHECKBUTTON_FIRST + 8) -#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 9) -#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 10) -#define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 11) -#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 12) -#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 13) -#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 14) -#define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 15) -#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 16) -#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 17) -#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 18) -#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 19) -#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 20) -#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 21) -#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 22) -#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 23) -#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 24) -#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_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 28) -#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 29) -#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 30) -#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 31) -#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 32) -#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 33) -#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 34) -#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 35) -#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 36) -#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 37) -#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 38) -#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 39) -#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 40) +#define GADGET_ID_USE_TIME_ORB_BUG (GADGET_ID_CHECKBUTTON_FIRST + 7) +#define GADGET_ID_GROW_INTO_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 8) +#define GADGET_ID_DOUBLE_SPEED (GADGET_ID_CHECKBUTTON_FIRST + 9) +#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 10) +#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 11) +#define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 12) +#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 13) +#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 14) +#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 15) +#define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 16) +#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 17) +#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 18) +#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 19) +#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 20) +#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 21) +#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 22) +#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 23) +#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 24) +#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 25) +#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 26) +#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 27) +#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 28) +#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 29) +#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 30) +#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 31) +#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 32) +#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 33) +#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 34) +#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 35) +#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 36) +#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 37) +#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 38) +#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 39) +#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 40) +#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 41) /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 41) +#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 42) #define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ ED_NUM_ELEMENTLIST_BUTTONS - 1) @@ -755,42 +756,43 @@ #define ED_CHECKBUTTON_ID_STICK_ELEMENT 2 #define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 3 #define ED_CHECKBUTTON_ID_USE_SPRING_BUG 4 -#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE 5 -#define ED_CHECKBUTTON_ID_DOUBLE_SPEED 6 -#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 7 -#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 8 -#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 9 -#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 10 -#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 11 -#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 12 -#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 13 -#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_GRAV_REACHABLE 17 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 18 -#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 19 -#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 20 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 21 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 22 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 23 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 24 -#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 25 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 26 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 27 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 28 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 29 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 30 -#define ED_CHECKBUTTON_ID_CHANGE_DELAY 31 -#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 32 -#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 33 -#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 34 -#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 35 -#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 36 -#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 37 -#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 38 - -#define ED_NUM_CHECKBUTTONS 39 +#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG 5 +#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE 6 +#define ED_CHECKBUTTON_ID_DOUBLE_SPEED 7 +#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 8 +#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 9 +#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 10 +#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 11 +#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 12 +#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 13 +#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 14 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 15 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 16 +#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 17 +#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 18 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 19 +#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 20 +#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 21 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 22 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 23 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 24 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 25 +#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 26 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 27 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 28 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 29 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 30 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 31 +#define ED_CHECKBUTTON_ID_CHANGE_DELAY 32 +#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 33 +#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 34 +#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 35 +#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 36 +#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 37 +#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 38 +#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 39 + +#define ED_NUM_CHECKBUTTONS 40 #define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_INITIAL_GRAVITY #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED @@ -2327,6 +2329,13 @@ static struct NULL, "use spring pushing bug", "use odd spring pushing behaviour" }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), + GADGET_ID_USE_TIME_ORB_BUG, GADGET_ID_NONE, + &level.use_time_orb_bug, + NULL, + "use time orb bug", "use odd time orb behaviour" + }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), GADGET_ID_GROW_INTO_DIGGABLE, GADGET_ID_NONE, @@ -7367,6 +7376,9 @@ static void DrawPropertiesConfig() if (properties_element == EL_SPRING) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_SPRING_BUG); + if (properties_element == EL_TIME_ORB_FULL) + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG); + #if 0 if (properties_element == EL_BALLOON) MapSelectboxGadget(ED_SELECTBOX_ID_WIND_DIRECTION); diff --git a/src/files.c b/src/files.c index 7ab17f2c..4cf2a857 100644 --- a/src/files.c +++ b/src/files.c @@ -199,6 +199,10 @@ static struct EL_TIME_ORB_FULL, CONF_VALUE_INTEGER_1, &li.time_orb_time, 10 }, + { + EL_TIME_ORB_FULL, CONF_VALUE_BOOLEAN_1, + &li.use_time_orb_bug, FALSE + }, /* ---------- multi-byte values ------------------------------------------ */ { @@ -392,6 +396,8 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) level->dont_collide_with_bits = ~0; /* always deadly when colliding */ level->use_spring_bug = FALSE; + level->use_time_orb_bug = FALSE; + level->use_step_counter = FALSE; /* values for the new EMC elements */ @@ -2806,6 +2812,10 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) if (level->game_version < VERSION_IDENT(2,2,0,0)) level->use_spring_bug = TRUE; + /* time orb caused limited time in endless time levels before 3.1.2 */ + if (level->game_version < VERSION_IDENT(3,1,2,0)) + level->use_time_orb_bug = TRUE; + /* only few elements were able to actively move into acid before 3.1.0 */ /* trigger settings did not exist before 3.1.0; set to default "any" */ if (level->game_version < VERSION_IDENT(3,1,0,0)) diff --git a/src/game.c b/src/game.c index 440016b0..ae9c3bd2 100644 --- a/src/game.c +++ b/src/game.c @@ -892,8 +892,21 @@ static void InitField(int x, int y, boolean init_game) break; default: +#if 1 + if (IS_CUSTOM_ELEMENT(element)) + { + if (CAN_MOVE(element)) + InitMovDir(x, y); + +#if USE_NEW_CUSTOM_VALUE + if (!element_info[element].use_last_ce_value) + CustomValue[x][y] = GET_NEW_CUSTOM_VALUE(Feld[x][y]); +#endif + } +#else if (IS_CUSTOM_ELEMENT(element) && CAN_MOVE(element)) InitMovDir(x, y); +#endif else if (IS_GROUP_ELEMENT(element)) { struct ElementGroupInfo *group = element_info[element].group; @@ -919,6 +932,8 @@ static void InitField(int x, int y, boolean init_game) break; } +#if 0 + #if USE_NEW_CUSTOM_VALUE #if 1 @@ -927,6 +942,8 @@ static void InitField(int x, int y, boolean init_game) CustomValue[x][y] = element_info[Feld[x][y]].custom_value_initial; #endif +#endif + #endif } @@ -6929,6 +6946,9 @@ static void ChangeElementNowExt(struct ElementChangeInfo *change, int x, int y, int target_element) { int previous_move_direction = MovDir[x][y]; +#if USE_NEW_CUSTOM_VALUE + int last_ce_value = CustomValue[x][y]; +#endif boolean add_player = (ELEM_IS_PLAYER(target_element) && IS_WALKABLE(Feld[x][y])); @@ -6956,6 +6976,11 @@ static void ChangeElementNowExt(struct ElementChangeInfo *change, if (element_info[Feld[x][y]].move_direction_initial == MV_START_PREVIOUS) MovDir[x][y] = previous_move_direction; +#if USE_NEW_CUSTOM_VALUE + if (element_info[Feld[x][y]].use_last_ce_value) + CustomValue[x][y] = last_ce_value; +#endif + InitField_WithBug1(x, y, FALSE); DrawLevelField(x, y); @@ -9984,8 +10009,12 @@ int DigField(struct PlayerInfo *player, else if (element == EL_TIME_ORB_FULL) { Feld[x][y] = EL_TIME_ORB_EMPTY; - TimeLeft += level.time_orb_time; - DrawGameValue_Time(TimeLeft); + + if (level.time > 0 || level.use_time_orb_bug) + { + TimeLeft += level.time_orb_time; + DrawGameValue_Time(TimeLeft); + } ResetGfxAnimation(x, y); DrawLevelField(x, y); diff --git a/src/main.h b/src/main.h index e4b4f0d8..59b935f5 100644 --- a/src/main.h +++ b/src/main.h @@ -1799,6 +1799,7 @@ struct LevelInfo boolean initial_gravity; boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */ boolean use_spring_bug; /* for compatibility with old levels */ + boolean use_time_orb_bug; /* for compatibility with old levels */ boolean instant_relocation; /* no visual delay when relocating player */ boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */ boolean grow_into_diggable; /* amoeba can grow into anything diggable */