From: Holger Schemel Date: Sun, 17 Nov 2002 03:10:39 +0000 (+0100) Subject: rnd-20021117-1-src X-Git-Tag: 3.0.0^2~215 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=08ad905f20de863e1f86eb772ecc2fbf7721529d;p=rocksndiamonds.git rnd-20021117-1-src --- diff --git a/src/conf_e2g.c b/src/conf_e2g.c index ffe88a23..b7ba1638 100644 --- a/src/conf_e2g.c +++ b/src/conf_e2g.c @@ -913,7 +913,7 @@ element_to_graphic[] = IMG_SPRING }, { - EL_SPRING_MOVING, -1, GFX_ACTION_MOVING, + EL_SPRING, -1, GFX_ACTION_MOVING, IMG_SPRING_MOVING }, { diff --git a/src/conftime.h b/src/conftime.h index bf91ef7f..5c3b0058 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-10-28 22:52]" +#define COMPILE_DATE_STRING "[2002-11-17 04:09]" diff --git a/src/game.c b/src/game.c index 81f233b0..32ee2ac3 100644 --- a/src/game.c +++ b/src/game.c @@ -292,6 +292,8 @@ static void InitField(int x, int y, boolean init_game) Feld[x][y] = EL_SP_MURPHY_CLONE; break; } + + Feld[x][y] = EL_PLAYER1; } /* no break! */ case EL_PLAYER1: @@ -2326,18 +2328,18 @@ void TurnRound(int x, int y) int element = Feld[x][y]; int old_move_dir = MovDir[x][y]; - int left_dir = turn[old_move_dir].left; + int left_dir = turn[old_move_dir].left; int right_dir = turn[old_move_dir].right; - int back_dir = turn[old_move_dir].back; + int back_dir = turn[old_move_dir].back; - int left_dx = move_xy[left_dir].x, left_dy = move_xy[left_dir].y; - int right_dx = move_xy[right_dir].x, right_dy = move_xy[right_dir].y; - int move_dx = move_xy[old_move_dir].x, move_dy = move_xy[old_move_dir].y; - int back_dx = move_xy[back_dir].x, back_dy = move_xy[back_dir].y; + int left_dx = move_xy[left_dir].x, left_dy = move_xy[left_dir].y; + int right_dx = move_xy[right_dir].x, right_dy = move_xy[right_dir].y; + int move_dx = move_xy[old_move_dir].x, move_dy = move_xy[old_move_dir].y; + int back_dx = move_xy[back_dir].x, back_dy = move_xy[back_dir].y; - int left_x = x+left_dx, left_y = y+left_dy; - int right_x = x+right_dx, right_y = y+right_dy; - int move_x = x+move_dx, move_y = y+move_dy; + int left_x = x + left_dx, left_y = y + left_dy; + int right_x = x + right_dx, right_y = y + right_dy; + int move_x = x + move_dx, move_y = y + move_dy; if (element == EL_BUG || element == EL_BD_BUTTERFLY) { @@ -2581,17 +2583,18 @@ void TurnRound(int x, int y) MovDir[x][y] = game.balloon_dir; MovDelay[x][y] = 0; } - else if (element == EL_SPRING_MOVING) + else if (element == EL_SPRING) { - if (!IN_LEV_FIELD(move_x, move_y) || !IS_FREE(move_x, move_y) || - (IN_LEV_FIELD(x, y+1) && IS_FREE(x, y+1))) - { - Feld[x][y] = EL_SPRING; + if ((MovDir[x][y] == MV_LEFT || MovDir[x][y] == MV_RIGHT) && + (!IN_LEV_FIELD(move_x, move_y) || !IS_FREE(move_x, move_y) || + (IN_LEV_FIELD(x, y + 1) && IS_FREE(x, y + 1)))) MovDir[x][y] = MV_NO_MOVING; - } + MovDelay[x][y] = 0; } - else if (element == EL_ROBOT || element == EL_SATELLITE || element == EL_PENGUIN) + else if (element == EL_ROBOT || + element == EL_SATELLITE || + element == EL_PENGUIN) { int attr_x = -1, attr_y = -1; @@ -2918,24 +2921,38 @@ void StartMoving(int x, int y) } } } - else if (CAN_MOVE(element)) + + if (CAN_MOVE(element)) /* not "else if" because of EL_SPRING */ { int newx, newy; - if ((element == EL_SATELLITE || element == EL_BALLOON || - element == EL_SPRING_MOVING) + if ((element == EL_SATELLITE || + element == EL_BALLOON || + element == EL_SPRING) && JustBeingPushed(x, y)) return; + if (element == EL_SPRING && MovDir[x][y] == MV_DOWN) + Feld[x][y + 1] = EL_EMPTY; /* was set to EL_BLOCKED above */ + if (!MovDelay[x][y]) /* start new movement phase */ { /* all objects that can change their move direction after each step */ /* (MAMPFER, MAMPFER2 and PACMAN go straight until they hit a wall */ - if (element!=EL_YAMYAM && element!=EL_DARK_YAMYAM && element!=EL_PACMAN) + if (element != EL_YAMYAM && + element != EL_DARK_YAMYAM && + element != EL_PACMAN) { +#if 0 + if (element == EL_SPRING) + printf("1--> %d\n", MovDir[x][y]); +#endif TurnRound(x, y); - +#if 0 + if (element == EL_SPRING) + printf("2--> %d\n", MovDir[x][y]); +#endif if (MovDelay[x][y] && (element == EL_BUG || element == EL_SPACESHIP || element == EL_SP_SNIKSNAK || @@ -3256,7 +3273,7 @@ void ContinueMoving(int x, int y) int direction = MovDir[x][y]; int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); - int horiz_move = (dx!=0); + int horiz_move = (dx != 0); int newx = x + dx, newy = y + dy; int step = (horiz_move ? dx : dy) * TILEX / 8; @@ -3273,8 +3290,8 @@ void ContinueMoving(int x, int y) else if (CAN_FALL(element) && horiz_move && y < lev_fieldy-1 && IS_BELT_ACTIVE(Feld[x][y+1])) step /= 2; - else if (element == EL_SPRING_MOVING) - step*=2; + else if (element == EL_SPRING && horiz_move) + step *= 2; #if OLD_GAME_BEHAVIOUR else if (CAN_FALL(element) && horiz_move && !IS_SP_ELEMENT(element)) @@ -3369,8 +3386,13 @@ void ContinueMoving(int x, int y) GfxAction[newx][newy] = GfxAction[x][y]; /* keep action one frame */ GfxAction[x][y] = GFX_ACTION_DEFAULT; +#if 0 if (!CAN_MOVE(element)) MovDir[newx][newy] = 0; +#else + if (CAN_FALL(element) && MovDir[newx][newy] == MV_DOWN) + MovDir[newx][newy] = 0; +#endif DrawLevelField(x, y); DrawLevelField(newx, newy); @@ -6231,13 +6253,13 @@ int DigField(struct PlayerInfo *player, else { RemoveField(x, y); - Feld[x+dx][y+dy] = element; + Feld[x + dx][y + dy] = element; } if (element == EL_SPRING) { - Feld[x+dx][y+dy] = EL_SPRING_MOVING; - MovDir[x+dx][y+dy] = move_direction; + Feld[x + dx][y + dy] = EL_SPRING; + MovDir[x + dx][y + dy] = move_direction; } player->push_delay_value = (element == EL_SPRING ? 0 : 2 + RND(8)); diff --git a/src/init.c b/src/init.c index b78b3206..22ac7a8f 100644 --- a/src/init.c +++ b/src/init.c @@ -1750,7 +1750,7 @@ void InitElementProperties() EL_SP_SNIKSNAK, EL_SP_ELECTRON, EL_BALLOON, - EL_SPRING_MOVING + EL_SPRING }; static int ep_can_move_num = SIZEOF_ARRAY_INT(ep_can_move); diff --git a/src/main.c b/src/main.c index e10f3d63..364cedcd 100644 --- a/src/main.c +++ b/src/main.c @@ -2562,12 +2562,14 @@ struct ConfigInfo image_config[] = { "twinkle_blue.frames", "3" }, { "twinkle_blue.delay", "2" }, { "twinkle_blue.mode_pingpong", "1" }, + { "twinkle_blue.global_sync", "0" }, { "twinkle_white", "RocksHeroes.pcx" }, { "twinkle_white.xpos", "13" }, { "twinkle_white.ypos", "11" }, { "twinkle_white.frames", "3" }, { "twinkle_white.delay", "2" }, { "twinkle_white.mode_pingpong", "1" }, + { "twinkle_white.global_sync", "0" }, { "steelwall_topleft", "RocksElements.pcx" }, { "steelwall_topleft.xpos", "0" }, diff --git a/src/main.h b/src/main.h index ff6f5f50..223ca8eb 100644 --- a/src/main.h +++ b/src/main.h @@ -690,31 +690,30 @@ #define EL_TIMEGATE_CLOSING (EL_FIRST_RUNTIME_REAL + 20) #define EL_PEARL_BREAKING (EL_FIRST_RUNTIME_REAL + 21) #define EL_TRAP_ACTIVE (EL_FIRST_RUNTIME_REAL + 22) -#define EL_SPRING_MOVING (EL_FIRST_RUNTIME_REAL + 23) -#define EL_SP_MURPHY_CLONE (EL_FIRST_RUNTIME_REAL + 24) -#define EL_QUICKSAND_EMPTYING (EL_FIRST_RUNTIME_REAL + 25) -#define EL_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 26) -#define EL_BD_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 27) -#define EL_AMOEBA_DRIPPING (EL_FIRST_RUNTIME_REAL + 28) -#define EL_SP_EXIT_OPEN (EL_FIRST_RUNTIME_REAL + 29) -#define EL_INVISIBLE_STEELWALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 30) -#define EL_INVISIBLE_SAND_ACTIVE (EL_FIRST_RUNTIME_REAL + 31) -#define EL_INVISIBLE_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 32) -#define EL_CONVEYOR_BELT1_LEFT_ACTIVE (EL_FIRST_RUNTIME_REAL + 33) -#define EL_CONVEYOR_BELT1_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 34) -#define EL_CONVEYOR_BELT1_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 35) -#define EL_CONVEYOR_BELT2_LEFT_ACTIVE (EL_FIRST_RUNTIME_REAL + 36) -#define EL_CONVEYOR_BELT2_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 37) -#define EL_CONVEYOR_BELT2_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 38) -#define EL_CONVEYOR_BELT3_LEFT_ACTIVE (EL_FIRST_RUNTIME_REAL + 39) -#define EL_CONVEYOR_BELT3_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 40) -#define EL_CONVEYOR_BELT3_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 41) -#define EL_CONVEYOR_BELT4_LEFT_ACTIVE (EL_FIRST_RUNTIME_REAL + 42) -#define EL_CONVEYOR_BELT4_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 43) -#define EL_CONVEYOR_BELT4_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 44) +#define EL_SP_MURPHY_CLONE (EL_FIRST_RUNTIME_REAL + 23) +#define EL_QUICKSAND_EMPTYING (EL_FIRST_RUNTIME_REAL + 24) +#define EL_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 25) +#define EL_BD_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 26) +#define EL_AMOEBA_DRIPPING (EL_FIRST_RUNTIME_REAL + 27) +#define EL_SP_EXIT_OPEN (EL_FIRST_RUNTIME_REAL + 28) +#define EL_INVISIBLE_STEELWALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 29) +#define EL_INVISIBLE_SAND_ACTIVE (EL_FIRST_RUNTIME_REAL + 30) +#define EL_INVISIBLE_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 31) +#define EL_CONVEYOR_BELT1_LEFT_ACTIVE (EL_FIRST_RUNTIME_REAL + 32) +#define EL_CONVEYOR_BELT1_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 33) +#define EL_CONVEYOR_BELT1_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 34) +#define EL_CONVEYOR_BELT2_LEFT_ACTIVE (EL_FIRST_RUNTIME_REAL + 35) +#define EL_CONVEYOR_BELT2_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 36) +#define EL_CONVEYOR_BELT2_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 37) +#define EL_CONVEYOR_BELT3_LEFT_ACTIVE (EL_FIRST_RUNTIME_REAL + 38) +#define EL_CONVEYOR_BELT3_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 39) +#define EL_CONVEYOR_BELT3_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 40) +#define EL_CONVEYOR_BELT4_LEFT_ACTIVE (EL_FIRST_RUNTIME_REAL + 41) +#define EL_CONVEYOR_BELT4_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 42) +#define EL_CONVEYOR_BELT4_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 43) /* "unreal" (and therefore not drawable) runtime elements */ -#define EL_FIRST_RUNTIME_UNREAL (EL_FIRST_RUNTIME_REAL + 45) +#define EL_FIRST_RUNTIME_UNREAL (EL_FIRST_RUNTIME_REAL + 44) #define EL_BLOCKED (EL_FIRST_RUNTIME_UNREAL + 0) #define EL_EXPLOSION (EL_FIRST_RUNTIME_UNREAL + 1) diff --git a/src/tools.c b/src/tools.c index fed92762..49321336 100644 --- a/src/tools.c +++ b/src/tools.c @@ -700,18 +700,25 @@ void DrawPlayer(struct PlayerInfo *player) if (player_is_moving && last_element == EL_EXPLOSION) { - int frame = Frame[last_jx][last_jy]; - int delay = 2; + int graphic = IMG_EXPLOSION; + int phase = Frame[last_jx][last_jy] - 1; + int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2); + int frame = (phase / delay - 1); - if (frame > 2) - DrawGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), GFX_EXPLOSION, - ((frame - 1) / delay - 1)); + if (game.emulation == EMU_SUPAPLEX) + graphic = (Store[last_jx][last_jy] == EL_SP_INFOTRON ? + IMG_SP_EXPLOSION_INFOTRON : + IMG_SP_EXPLOSION); + + if (frame >= 0) + DrawGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), graphic, frame); } /* draw elements that stay over the player */ /* handle the field the player is leaving ... */ if (player_is_moving && IS_OVER_PLAYER(last_element)) DrawLevelField(last_jx, last_jy); + /* ... and the field the player is entering */ if (IS_OVER_PLAYER(element)) DrawLevelField(jx, jy); @@ -2839,7 +2846,6 @@ int el2gfx_OLD(int element) case EL_TUBE_RIGHT_UP: return GFX_TUBE_RIGHT_UP; case EL_TUBE_RIGHT_DOWN: return GFX_TUBE_RIGHT_DOWN; case EL_SPRING: return GFX_SPRING; - case EL_SPRING_MOVING: return GFX_SPRING; case EL_TRAP: return GFX_TRAP_INACTIVE; case EL_TRAP_ACTIVE: return GFX_TRAP_ACTIVE; case EL_BD_WALL: return GFX_BD_WALL;