#define CHUNK_SIZE_NONE -1 /* do not write chunk size */
#define FILE_VERS_CHUNK_SIZE 8 /* size of file version chunk */
#define LEVEL_HEADER_SIZE 80 /* size of level file header */
-#define LEVEL_HEADER_UNUSED 11 /* unused level header bytes */
+#define LEVEL_HEADER_UNUSED 10 /* unused level header bytes */
#define LEVEL_CHUNK_CNT2_SIZE 160 /* size of level CNT2 chunk */
#define LEVEL_CHUNK_CNT2_UNUSED 11 /* unused CNT2 chunk bytes */
#define LEVEL_CHUNK_CNT3_HEADER 16 /* size of level CNT3 header */
change->post_change_function = NULL;
}
+static void setMoveIntoAcid(struct LevelInfo *level, int element)
+{
+ int bit_nr = get_special_property_bit(element, EP_CAN_MOVE_INTO_ACID);
+
+ if (bit_nr > -1)
+ level->can_move_into_acid |= (1 << bit_nr);
+}
+
static void setLevelInfoToDefaults(struct LevelInfo *level)
{
int i, j, x, y;
level->time = 100;
level->gems_needed = 0;
+
level->amoeba_speed = 10;
+
level->time_magic_wall = 10;
level->time_wheel = 10;
level->time_light = 10;
level->time_timegate = 10;
+
level->amoeba_content = EL_DIAMOND;
+
level->double_speed = FALSE;
level->initial_gravity = FALSE;
level->em_slippery_gems = FALSE;
level->block_last_field = FALSE;
level->sp_block_last_field = TRUE;
+ level->use_spring_bug = FALSE;
+
+ level->can_move_into_acid = ~0; /* everything can move into acid */
level->use_custom_template = FALSE;
level->block_last_field = (getFile8Bit(file) == 1 ? TRUE : FALSE);
level->sp_block_last_field = (getFile8Bit(file) == 1 ? TRUE : FALSE);
+ level->use_spring_bug = (getFile8Bit(file) == 1 ? TRUE : FALSE);
+
ReadUnusedBytesFromFile(file, LEVEL_HEADER_UNUSED);
return chunk_size;
/* Default behaviour for EM style gems was "slippery" only in 2.0.1 */
if (level->game_version == VERSION_IDENT(2,0,1,0))
level->em_slippery_gems = TRUE;
+
+ if (level->game_version < VERSION_IDENT(2,2,0,0))
+ level->use_spring_bug = TRUE;
+
+ if (level->game_version < VERSION_IDENT(3,0,9,0))
+ {
+ level->can_move_into_acid = 0; /* nothing can move into acid */
+
+ setMoveIntoAcid(level, EL_ROBOT);
+ setMoveIntoAcid(level, EL_SATELLITE);
+ setMoveIntoAcid(level, EL_PENGUIN);
+ setMoveIntoAcid(level, EL_BALLOON);
+ }
}
else
{
putFile8Bit(file, (level->block_last_field ? 1 : 0));
putFile8Bit(file, (level->sp_block_last_field ? 1 : 0));
+ putFile8Bit(file, (level->use_spring_bug ? 1 : 0));
+
WriteUnusedBytesToFile(file, LEVEL_HEADER_UNUSED);
}
printf("EM style slippery gems: %s\n", (level->em_slippery_gems ? "yes" : "no"));
printf("Player blocks last field: %s\n", (level->block_last_field ? "yes" : "no"));
printf("SP player blocks last field: %s\n", (level->sp_block_last_field ? "yes" : "no"));
+ printf("use spring bug: %s\n", (level->use_spring_bug ? "yes" : "no"));
printf_line("-", 79);
}