From cc941f23b0401f65d73f311a507ebd595fbd60a2 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 10 Mar 2004 09:56:27 +0100 Subject: [PATCH] rnd-20040310-1-src * changed tape recording to only record input, not programmed actions * YET TO COME ... added option ... for sp_sniksnak and sp_electron --- ChangeLog | 6 ++++++ src/conf_gfx.c | 3 ++- src/conftime.h | 2 +- src/files.c | 2 ++ src/game.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++-- src/init.c | 7 +++++++ 6 files changed, 71 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83532d96..ef2f8645 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ +2004-03-09 + * changed tape recording to only record input, not programmed actions + * YET TO COME ... added option ... for sp_sniksnak and sp_electron + 2004-03-08 * fixed totally broken (every 8th frame skipped) step-by-step recording * fixed bug with requester not displayed when quick-loading interrupted + * added option "can fall into acid (with gravity)" for player elements + * fixed bug with player not falling when snapping down with gravity 2004-03-07 * fixed bug which messed up key config when using keypad number keys diff --git a/src/conf_gfx.c b/src/conf_gfx.c index c7afe9ea..2981ce83 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -549,7 +549,8 @@ struct ConfigInfo image_config[] = { "sp_electron.xpos", "8" }, { "sp_electron.ypos", "10" }, { "sp_electron.frames", "8" }, - { "sp_electron.delay", "2" }, + { "sp_electron.delay", "4" }, + { "sp_electron.global_sync", "true" }, { "sp_electron.EDITOR", "RocksSP.pcx" }, { "sp_electron.EDITOR.xpos", "10" }, { "sp_electron.EDITOR.ypos", "11" }, diff --git a/src/conftime.h b/src/conftime.h index e4f04ce0..8605b781 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-03-09 02:02]" +#define COMPILE_DATE_STRING "[2004-03-10 01:26]" diff --git a/src/files.c b/src/files.c index c5d8eb30..154d228e 100644 --- a/src/files.c +++ b/src/files.c @@ -3174,7 +3174,9 @@ void LoadTapeFromFilename(char *filename) { tape.no_valid_file = TRUE; +#if 0 Error(ERR_WARN, "cannot read tape '%s' -- using empty tape", filename); +#endif return; } diff --git a/src/game.c b/src/game.c index 6a797d86..f5cf3d8e 100644 --- a/src/game.c +++ b/src/game.c @@ -3947,6 +3947,7 @@ inline static void TurnRoundExt(int x, int y) else if (element == EL_BD_BUTTERFLY) /* && MovDir[x][y] == left_dir) */ MovDelay[x][y] = 1; } +#if 0 else if (element == EL_SPACESHIP || element == EL_BD_FIREFLY || element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON) { @@ -3965,6 +3966,34 @@ inline static void TurnRoundExt(int x, int y) else if (element == EL_BD_FIREFLY) /* && MovDir[x][y] == right_dir) */ MovDelay[x][y] = 1; } +#else + else if (element == EL_SPACESHIP || element == EL_BD_FIREFLY) + { + TestIfBadThingTouchesOtherBadThing(x, y); + + if (ENEMY_CAN_ENTER_FIELD(element, left_x, left_y)) + MovDir[x][y] = left_dir; + else if (!ENEMY_CAN_ENTER_FIELD(element, move_x, move_y)) + MovDir[x][y] = right_dir; + + if (element == EL_SPACESHIP && MovDir[x][y] != old_move_dir) + MovDelay[x][y] = 9; + else if (element == EL_BD_FIREFLY) /* && MovDir[x][y] == right_dir) */ + MovDelay[x][y] = 1; + } + else if (element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON) + { + TestIfBadThingTouchesOtherBadThing(x, y); + + if (ELEMENT_CAN_ENTER_FIELD_GENERIC(element, left_x, left_y, 0)) + MovDir[x][y] = left_dir; + else if (!ELEMENT_CAN_ENTER_FIELD_GENERIC(element, move_x, move_y, 0)) + MovDir[x][y] = right_dir; + + if (MovDir[x][y] != old_move_dir) + MovDelay[x][y] = 9; + } +#endif else if (element == EL_YAMYAM) { boolean can_turn_left = YAMYAM_CAN_ENTER_FIELD(left_x, left_y); @@ -7468,12 +7497,30 @@ void GameActions() if (!options.network && !setup.team_mode) local_player->effective_action = summarized_player_action; +#if 1 + for (i = 0; i < MAX_PLAYERS; i++) + { + tape_action[i] = stored_player[i].effective_action; + + if (tape.recording && tape_action[i] && !tape.player_participates[i]) + tape.player_participates[i] = TRUE; /* player just appeared from CE */ + } + + /* only save actions from input devices, but not programmed actions */ + if (tape.recording) + TapeRecordAction(tape_action); +#endif + for (i = 0; i < MAX_PLAYERS; i++) { int actual_player_action = stored_player[i].effective_action; #if 1 - /* !!! TEST !!! */ + /* !!! THIS BREAKS THE FOLLOWING TAPES: !!! + - rnd_equinox_tetrachloride 048 + - rnd_equinox_tetrachloride_ii 096 + - rnd_emanuel_schmieg 002 + */ if (stored_player[i].MovPos == 0) CheckGravityMovement(&stored_player[i]); #endif @@ -7510,15 +7557,19 @@ void GameActions() stored_player[i].MovPos, actual_player_action, FrameCounter); #endif +#if 1 + PlayerActions(&stored_player[i], actual_player_action); +#else tape_action[i] = PlayerActions(&stored_player[i], actual_player_action); if (tape.recording && tape_action[i] && !tape.player_participates[i]) tape.player_participates[i] = TRUE; /* player just appeared from CE */ +#endif ScrollPlayer(&stored_player[i], SCROLL_GO_ON); } -#if 1 +#if 0 if (tape.recording) TapeRecordAction(tape_action); #endif diff --git a/src/init.c b/src/init.c index a78ee611..df191e0a 100644 --- a/src/init.c +++ b/src/init.c @@ -3378,6 +3378,13 @@ void InitElementPropertiesEngine(int engine_version) element_info[element].ignition_delay = 8; } } + + /* set element properties that were handled incorrectly in older levels */ + if (engine_version < VERSION_IDENT(3,0,9,0)) + { + SET_PROPERTY(EL_SP_SNIKSNAK, EP_DONT_COLLIDE_WITH, FALSE); + SET_PROPERTY(EL_SP_ELECTRON, EP_DONT_COLLIDE_WITH, FALSE); + } #endif /* this is needed because some graphics depend on element properties */ -- 2.34.1